|
-
April 16th, 1999, 03:52 PM
#1
How to get a menu window's HMENU from its HWND?
I'm writing an application which uses Windows Hooks to detect when a pop-up menu is about to be displayed as a result of the user right-clicking inside another application. The idea is to disable one of the items in the pop-up menu before it gets displayed to prevent the user from invoking it.
I've been able to figure out how to intercept the pop-up menu when it comes up by checking for the WM_SHOWWINDOW message and then comparing its window class to "#32768". Unfortunately once I get the window handle (HWND) for it, I don't know how to turn it into a menu handle (HMENU) so I can call ModifyMenu on it. I've tried casting it but it doesn't work (IsMenu fails). Do you know how to go from a menu's HWND to its HMENU?
I appreciate your help!
Alvaro
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|