Microsoft Visual C++ MFC. Win95 WinNT


- 4


ON_WM_SYSCOMMAND()

ON_WM_PAINT()

ON_WM_QUERYDRAGICON()

//}}AFX_MSG_MAP

END_MESSAGE_MAP()

 

// OnInitDialog CDialogDlg

BOOL CDialogDlg::OnInitDialog()

{

CDialog::OnInitDialog();

 

// "About..."

 

// , IDM_ABOUTBOX

//

ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);

ASSERT(IDM_ABOUTBOX < 0xF000);

 

CMenu* pSysMenu = GetSystemMenu(FALSE);

CString strAboutMenu;

strAboutMenu.LoadString(IDS_ABOUTBOX);

if (!strAboutMenu.IsEmpty())

{

pSysMenu->AppendMenu(MF_SEPARATOR);

pSysMenu->AppendMenu(MF_STRING,

IDM_ABOUTBOX, strAboutMenu);

}

 

// .

// ,

//

SetIcon(m_hIcon,TRUE); //

//

 

SetIcon(m_hIcon,FALSE); //

//

// TODO:

//

return TRUE;

}

 

// OnSysCommand CDialogDlg

void CDialogDlg::OnSysCommand(UINT nID, LPARAM lParam)

{

if ((nID & 0xFFF0) == IDM_ABOUTBOX)

{

CAboutDlg dlgAbout;

dlgAbout.DoModal();

}

else

{

CDialog::OnSysCommand(nID, lParam);

}

}

 

// ,

// ,

 

// OnPaint CDialogDlg

void CDialogDlg::OnPaint()