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

make existing HMENU a popup

3 views
Skip to first unread message

Gernot Frisch

unread,
Jan 13, 2012, 10:41:43 AM1/13/12
to
Hi,

I want to wrap a GUI library and need to modify an existing menu to have the
MF_POPUP style:

HMENU main = CreateMenu();
HMENU file = CreatePopupMenu();
// no MF_POPUP here!
InsertMenuA(main, 0, MF_BYPOSITION, (UINT_PTR)file, "File");

HMENU fnew = CreatePopupMenu();
InsertMenuA(file, -1, MF_BYPOSITION, (UINT_PTR)fnew, "New");
// now modify "file" to have the MF_POPUP style. I have no pointer to
"main" here.

Alf P. Steinbach

unread,
Jan 13, 2012, 12:52:37 PM1/13/12
to
It's very long ago, but as I recall the MF_POPUP flag applies to a menu
entry, not to a menu object in itself.

So, the literal question seems to be practically impossible, but simply
specify MF_BYPOSITION|MF_POPUP when you create the menu entry.


Cheers & hth.,

- Alf

0 new messages