How to add "File Edit View..." menù in a CDialog ?
-
Hi, I'm wondering how coudl I insert a "File Edit View.." standard Menu on thetop of CMyDialog class. I found information about inserting a ToolBar and I added it succesfully (with RepositionBars(), at least!), but nothing about the menù :( Any help will be appreciated! Bye.
-
Hi, I'm wondering how coudl I insert a "File Edit View.." standard Menu on thetop of CMyDialog class. I found information about inserting a ToolBar and I added it succesfully (with RepositionBars(), at least!), but nothing about the menù :( Any help will be appreciated! Bye.
You can add a menu resource to a dialog using the resource editor. Nothing special is required in order to do this. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com
-
Hi, I'm wondering how coudl I insert a "File Edit View.." standard Menu on thetop of CMyDialog class. I found information about inserting a ToolBar and I added it succesfully (with RepositionBars(), at least!), but nothing about the menù :( Any help will be appreciated! Bye.
1. create your menu resource in the menu editor. 2. Call:
HMENU hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(ID_MENU));
Where ID_MENU is your menu resource handle and hInstance is the instance to your current application. You could also use::GetModuleHandle(NULL) //instead of hInstance.
this will load your menu resource and assign it to an HMENU. 3. Call the SetMenu member function of your CDialog class in order to assign this menu with your dialog window. If you want to change the menu out later or get rid of this menu call SetMenu with a new menu handle or NULL, respectively. When your app is done, free the menu resources with DestroyMenu(hMenu); You can also associate a menu with a dialog if you have created a special class that subclasses the dialog class by setting the MENU field in the CLASSINFO structure before you register your class. If you would like more details on this method feel free to ask. -
Hi, I'm wondering how coudl I insert a "File Edit View.." standard Menu on thetop of CMyDialog class. I found information about inserting a ToolBar and I added it succesfully (with RepositionBars(), at least!), but nothing about the menù :( Any help will be appreciated! Bye.
-
Hi, I'm wondering how coudl I insert a "File Edit View.." standard Menu on thetop of CMyDialog class. I found information about inserting a ToolBar and I added it succesfully (with RepositionBars(), at least!), but nothing about the menù :( Any help will be appreciated! Bye.