// Add about option to system menu
HMENU hSystemMenu = ::GetSystemMenu(GetHwnd(),FALSE);
::AppendMenu(hSystemMenu,MF_SEPARATOR,0,wxT(""));
::AppendMenu(hSystemMenu,MF_STRING,IDM_ABOUT,wxT("About..."));
::DrawMenuBar(GetHwnd());
HMENU hSystemMenu = ::GetSystemMenu(GetHwnd(),FALSE);
::AppendMenu(hSystemMenu,MF_SEPARATOR,0,wxT(""));
::AppendMenu(hSystemMenu,MF_STRING,IDM_ABOUT,wxT("About..."));
::DrawMenuBar(GetHwnd());
#define IDM_ABOUT wxID_HIGHEST // System menu "About..." ID
In your main application window, whether frame or dialog, add the following function:
// Override MSWWindowProc to respond to system menu "About..." selection
bool MSWTranslateMessage(WXMSG* pMsg);
bool MSWTranslateMessage(WXMSG* pMsg);
bool MainDlg::MSWTranslateMessage(WXMSG* pMsg)
{
if ((pMsg->message == WM_SYSCOMMAND) && (pMsg->wParam == IDM_ABOUT))
{
wxAboutDialogInfo aboutDlgInfo;
aboutDlgInfo.SetName(wxT("My Application"));
aboutDlgInfo.SetVersion(wxT("1.00"));
...
wxAboutBox(aboutDlgInfo);
return true; // Message processed
}
else
return wxDialog::MSWTranslateMessage(pMsg);
}
{
if ((pMsg->message == WM_SYSCOMMAND) && (pMsg->wParam == IDM_ABOUT))
{
wxAboutDialogInfo aboutDlgInfo;
aboutDlgInfo.SetName(wxT("My Application"));
aboutDlgInfo.SetVersion(wxT("1.00"));
...
wxAboutBox(aboutDlgInfo);
return true; // Message processed
}
else
return wxDialog::MSWTranslateMessage(pMsg);
}