A complete Hello demo.
2025-11-14
Written by: xiaobin


property:

type: Icon Image: IDI_ICON1


#include "resource.h"

private:
CButton m_btnAbout;
CRect rt;
rt.top = 10;
rt.left = 150;
rt.right = 250;
rt.bottom = 30;
m_btnAbout.Create(_T("About"),
WS_CHILD | WS_VISIBLE,
rt,
this,
ID_ABOUT); // #define ID_ABOUT 1101
public:
afx_msg void OnBtnClick();
afx_msg void CMainWindow::OnBtnClick()
{
CAboutDlg dlgAbout; // #include "AboutDlg.h"
dlgAbout.DoModal();
}
DECLARE_MESSAGE_MAP()
BEGIN_MESSAGE_MAP(CMainWindow, CFrameWnd)
ON_COMMAND(ID_ABOUT, OnBtnClick)
END_MESSAGE_MAP()