• Welcome to Valhalla Legends Archive.
 

[Win32] Finding the active PopupMenu

Started by CupHead, December 12, 2003, 08:36 PM

Previous topic - Next topic

CupHead

I'm interested in getting the active popup menu (Created by TrackPopupMenu) and its items and then handling them as normal menu items.  At the moment, I have a timer that calls FindWindow in order to come back with the handle to the menu if it's popped up.  Sometimes this returns, but there are never any items in the menu, so I must be doing something wrong.  If anyone has ideas or better solutions, let me know.

Also:
(When applied to the popup window's handle.)
GetSubMenu returns 0.
GetMenuItemCount returns -1.

Edit: Fixed GetMenuItemCount's return value.

Skywing

I don't think the window handle for the menu will be the same thing as the menu handle.