Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get HMENU of popup menu from containing window handle?

985 views
Skip to first unread message

kuc...@gmail.com

unread,
Mar 23, 2006, 6:25:55 AM3/23/06
to
I wrote a hook for MSN Messenger, I'm catching context menu opening
(WM_INITMENUPOPUP), get menu handle (HMENU) and add my own menu items.
>From version 8.0 MSN Messenger stopped to send WM_INITMENUPOPUP.
Maximum I can get - I'm catching WM_ENTERIDLE with parameter MSGF_MENU
- so I get a handle of the window containing this popup menu. I've
checked - it's the correct window (tried to call DestroyWindow and it
worked correctly). Now the question - how can I get menu handle (HMENU)
if I know its container window handle?

P.S. People told me that version 8.0 was written in C# and uses WinFX -
maybe somebody is familiar with it and can tell me if there's a chance
to get menu handle by using WinFX functions?

Kellie Fitton

unread,
Mar 23, 2006, 11:57:41 AM3/23/06
to

Christian ASTOR

unread,
Mar 23, 2006, 12:47:04 PM3/23/06
to
kuc...@gmail.com a écrit :

> Now the question - how can I get menu handle (HMENU)
> if I know its container window handle?

Not sure if I have understood, but there is eg MN_GETHMENU...

r_z_...@pen_fact.com

unread,
Mar 23, 2006, 2:41:59 PM3/23/06
to
If you are going to ask the same question in multiple newsgroups,
please post to all at once so everyone can see/participate in the
whole discussion. I provided an answer in
comp.os.ms-windows.programmer.win32

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com

kuc...@gmail.com

unread,
Mar 26, 2006, 12:17:32 PM3/26/06
to
No, unfortunately this doesn't help at all. I'm aware of GetMenu
function subset, it relates to menus for window. I'm talking about
different situation. Context menu is a window itself, it doesn't belong
to any window as regular menu. Correct answer was below - and it is
MN_GETHMENU.

kuc...@gmail.com

unread,
Mar 26, 2006, 12:18:05 PM3/26/06
to
Thank you very much, this is exactly what I needed!

kuc...@gmail.com

unread,
Mar 26, 2006, 12:27:05 PM3/26/06
to
No, unfortunately your solution this doesn't help at all. I'm aware of

GetMenu
function subset, it relates to menus for window. I'm talking about
different situation. Context menu is a window itself, it doesn't belong
to any window as regular menu. Correct answer was above - and it is
MN_GETHMENU.

0 new messages