Sign in to follow this  
Conqueran

Adding a pop-up menu to a window.

Recommended Posts

Conqueran    139
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
Conqueran    139
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
Conqueran    139
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

Share this post


Link to post
Share on other sites
SiCrane    11839
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
Conqueran    139
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

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