I have created a dialog box and have attached a menu to the dialog box. Is there is any way to display the menu immediately when the dialog box is invoked without the user clicking on the menu?
Printable View
I have created a dialog box and have attached a menu to the dialog box. Is there is any way to display the menu immediately when the dialog box is invoked without the user clicking on the menu?
Where "F" is the Mnemonic of the menu item, in my case It is &File. So if you want to show the &Help, place 'H' in the lParam.Code:BOOL CMFDDLGDlg::OnInitDialog()
{
...
PostMessage(WM_SYSCOMMAND, SC_KEYMENU, 'F');
...
}
Hope this will help you