Sign in to follow this  

Adding a pop-up menu to a window.

This topic is 4400 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :).

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Lol I thought I didn't need any more help...

I've been using InsertMenu to insert different things into my HMENU. However what if I want to insert another HMENU!? like a submenu within a popup menu... Anyone know?

Share this post


Link to post
Share on other sites

This topic is 4400 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this