// PromptDlg.cpp : implementation file // #include "stdafx.h" #include "DeviceEdit.h" #include "PromptDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPromptDlg dialog CPromptDlg::CPromptDlg(CWnd* pParent /*=NULL*/) : CDialog(CPromptDlg::IDD, pParent) { //{{AFX_DATA_INIT(CPromptDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_Brush.CreateSolidBrush(RGB(111, 111, 111)); } void CPromptDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPromptDlg) //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CPromptDlg, CDialog) //{{AFX_MSG_MAP(CPromptDlg) ON_WM_PAINT() ON_WM_CTLCOLOR() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPromptDlg message handlers void CPromptDlg::ShowMsg(bool bShow) { if ( bShow ) { // SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); ShowWindow(SW_SHOW); } else { ShowWindow(SW_HIDE); } } BOOL CPromptDlg::OnInitDialog() { CDialog::OnInitDialog(); _CWndCS(this); CenterWindow(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CPromptDlg::OnPaint() { CPaintDC dc(this); // device context for painting RECT rect; GetClientRect(&rect); dc.FillRect(&rect,&CBrush(RGB(111, 111, 111))); } HBRUSH CPromptDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); if ( pWnd->GetDlgCtrlID() ==IDC_STATIC_MSG) { pDC->SetBkMode(TRANSPARENT); return m_Brush; } return hbr; }