CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2001
    Location
    Singapore
    Posts
    200

    Displaying menu of dialog box

    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?

  2. #2
    Join Date
    Apr 2003
    Posts
    1,755

    Smile

    Code:
    BOOL CMFDDLGDlg::OnInitDialog()
    {
       ...
    
       PostMessage(WM_SYSCOMMAND, SC_KEYMENU, 'F');
    
       ...
    }
    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.

    Hope this will help you
    Last edited by rxbagain; June 1st, 2003 at 09:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured