How can you make a popup menu with submenuitems of menu items.

so that you can open an menu that stiks at the first but with options of that menuitem selected?
Posted on 2003-01-21 12:30:27 by Bolle
use CreateMenu and AppendMenu.
if you have

one
two ->two_one
two_two
three

you should create a separate menu for "two" and then append it after "one", with MF_MENU. If you want to set parameters to elements, access them through the menu they're in (either "main_menu" or "two")
Posted on 2003-01-21 14:14:47 by Ultrano
Can i also do it in a Resource file or is it only possible in code?
Posted on 2003-02-03 06:06:21 by Bolle
It is possible with just apis
Posted on 2003-02-03 06:19:17 by roticv
It's a lot easier to do it in your resource file than with code. Here's an example from one of my little programs:

600 MENUEX MOVEABLE IMPURE LOADONCALL DISCARDABLE
BEGIN
POPUP "&File", , , 0
BEGIN
MENUITEM "&Exit", 1000
END
POPUP "&Options", , , 0
BEGIN
MENUITEM "&Color Map", 1200
POPUP "Color &Mode", , , 0
BEGIN
MENUITEM "&Iterations", 1210
MENUITEM "Longitude Angle", 1211
MENUITEM "Latitude Angle", 1212
END
POPUP "&Structure", , , 0
BEGIN
MENUITEM "&Tetrahedra", 1250
MENUITEM "&Pyramid", 1251
MENUITEM "&Cube", 1252
END
MENUITEM "Zoom 0", 1220
END
POPUP "&Help", , , 0
BEGIN
MENUITEM "&About", 1900
END
END

When you want a sub-menu for an item, you simply label it as a POPUP (instead of a MENUITEM) and proceed to describe its content as if it were a separate menu (such as the Color Mode and Structure items within the Options in the above example). You could even insert additional popup menus within those ones if you need to.

Raymond
Posted on 2003-02-03 10:03:30 by Raymond
No, it is also possible in a menu resource. If bit 4 in the flags is set in a menu item, it will open up a submenu. In this case, the menu identifier is left out. Set bit 7 in the flags of the last item of the submenu to end it.
Example:
push dword themenu
call
mov ,eax
; ...
themenu:
dw 16,"Main menu",0
dw 0,1,"Option 1",0
dw 16,"Submenu",0
dw 0,2,"Sub-item 1",0
dw 128,3,"Sub-item 2",0
dw 128,4,"Option 2",0
Posted on 2003-02-03 10:04:42 by Sephiroth3
Thank you all for the info it now works finally
:)
thanks
Posted on 2003-02-03 11:45:40 by Bolle