Adding a pop-up menu to a window.
I've been trying to add a pop-up menu to a window in C++ windows programming for several days now. I know I'm suppose to add the event in WM_CONTEXTMENU however I don't know what to add... I read the help files but they dont help at all.
Does anyone have sample code or suggestions so I can get through this?
Thank You very much :).
I guess raw win32 API...
I think that link discusses menu's from the top. I'd like to right click anywhere on the screen and have a menu pop up, sort of like when you right click on your desktop you have options like "refresh, paste, properties, etc"
I think that link discusses menu's from the top. I'd like to right click anywhere on the screen and have a menu pop up, sort of like when you right click on your desktop you have options like "refresh, paste, properties, etc"
Quote:Original post by pulpfist
Yes doing that would be no more than a simple extension to the eksample code
In what way? I'm a total idiot when it comes to these things
Ill see if I find any resources... Ill merge it here if I find some
http://www.winprog.org/tutorial/menus.html
Maybe the contents of the resource.* files stays the same, and you just have to attach the menu to a components handle rather than to the main window.
Im not sure :/
[Edited by - pulpfist on November 27, 2005 6:34:38 PM]
http://www.winprog.org/tutorial/menus.html
Maybe the contents of the resource.* files stays the same, and you just have to attach the menu to a components handle rather than to the main window.
Im not sure :/
[Edited by - pulpfist on November 27, 2005 6:34:38 PM]
To create the popup menu, you can call CreatePopupMenu(), which returns an HMENU. You can call InsertMenu() and AppendMenu() to populate the popup menu with menu items. Then you can call TrackPopupMenu() to actually show the popup. After you're done with it, call DestroyMenu() release the resources that the menu consumes.
Thanks too everybody for their help! I finally got the hang of it!
I'm very happy I have a board like this to get help from, THANKS AGAIN .
I'm very happy I have a board like this to get help from, THANKS AGAIN .
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement