Illustrates a single application window with a menu and About box.
2025-11-26
Written by: xiaobin
This article adds menu events and shortcut key responses in CFrameWnd. The modifications are based on the HelloMFC example.
Create(NULL, _T("Hello MFC"),
WS_OVERLAPPEDWINDOW,
rectDefault,
NULL,
MAKEINTRESOURCE(IDR_MENU1)
);
LoadAccelTable(MAKEINTRESOURCE(IDR_ACCELERATOR1));

void CMainWindow::OnHelpAboutus()
{
// TODO: Add your command handler code here
OnBtnClick();
}




Remove the message mapping for MyApp.
BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
////ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()