-
context menu
Displaying a context menu is supported only for popup menus in Windows. If you use TrackPopupMenuEx() you have to pass a handle to a popup menu (subenu). If you try to use it with the main menu handle, it displays only small thin line. But I need to display the whole menu like context, how can I accomplish this?
-
Use 'CreatePopupMenu' to return a handle (HMENU) to an empty menu then use 'InsertMenuItem' to add/append any menuitems you need. You can also use 'InsertMenu' and 'AppendMenu' to add menuitems.
And your english is really good, Larry, so no apology is necessary :)
-
I've already tried this. It doesn't work. I think submenus are the problem. Try it if you don't believe me. I get the number of items in the "root" using GetMenuItemCount() and do a GetMenuItemInfo() call on every single item. I use obtained information with InsertMenuItem() which adds new item to the temporary popup menu.
If you wonder what I meant by "it doesn't work", I'll describe it better. I have a menu resource and use this resource to display the main application menu (LoadMenu() function). And I need to display the same resource as a context menu. If I use the method we are talking about, the context menu displays only once and never appears again. And besides this, the main application menu "freezes".
My english only seems to be good, sometimes it's really bad, but thanks anyway. :)