i'm just curious if there was a way to define a popup menu handle either by resource or some api?
ie,:
why I ask? i've been searchin with no avail, but i want to use the resource menu i created with trackpopupmenu, but the problem is, it does not display the popup text, instead a small bar
any ideas?
i'm using getmenu api, and then trackpopupmenu
also, i'm using masm32 v8 with radasm 2.0.0.10
i tried to use:
invoke CreatePopupMenu
mov hPopupmenu,eax
invoke AppendMenu,hPopupmenu,MF_POPUP,IDM_POPUP1,ADDR STRPOPUPMENU
invoke Appendmenu,IDM_POPUP1,MF_STRING,IDM_SUBMENU1,ADDR STRSUBMENU1
to create a sub menu, but it doesnt appear to be workin, any idea?
ie,:
MyMenu MENU
BEGIN
POPUP "&POPUP 1" ; <-- how do I set a handle, or control id for a popup???
BEGIN
MENUITEM "Sub Menu1",IDM_START
MENUITEM "Sub Menu2",IDM_STOP,GRAYED
END
END
why I ask? i've been searchin with no avail, but i want to use the resource menu i created with trackpopupmenu, but the problem is, it does not display the popup text, instead a small bar
any ideas?
i'm using getmenu api, and then trackpopupmenu
also, i'm using masm32 v8 with radasm 2.0.0.10
i tried to use:
invoke CreatePopupMenu
mov hPopupmenu,eax
invoke AppendMenu,hPopupmenu,MF_POPUP,IDM_POPUP1,ADDR STRPOPUPMENU
invoke Appendmenu,IDM_POPUP1,MF_STRING,IDM_SUBMENU1,ADDR STRSUBMENU1
to create a sub menu, but it doesnt appear to be workin, any idea?
MyMenu MENU
BEGIN
[b]POPUP ""
BEGIN[/b]
POPUP "&POPUP 1"
BEGIN
MENUITEM "Sub Menu1",IDM_START
MENUITEM "Sub Menu2",IDM_STOP,GRAYED
END
[b]END[/b]
END
TrackPopupMenu starts displaying from the second menu level. Use LoadMenu to get a handle to a resource menu.
MyMenu MENU
BEGIN
[b]POPUP ""
BEGIN[/b]
POPUP "&POPUP 1"
BEGIN
MENUITEM "Sub Menu1",IDM_START
MENUITEM "Sub Menu2",IDM_STOP,GRAYED
END
[b]END[/b]
END
TrackPopupMenu starts displaying from the second menu level. Use LoadMenu to get a handle to a resource menu. I have got the same problem as xkardisx so i have copy and paste your res example to my *.rc menu file and if you think it's working, you must be joking. I have got small and buggy bar and cant get rid of it .
Hi AceEmbler,
Load the menu with LoadMenu :
Then get the handle of the submenu you want to track :
then display the sub menu with TrackPopupMenuEx :
As tenkey said the TrackPopupMenuEx only takes second level menus.
Load the menu with LoadMenu :
invoke LoadMenu,[hInst],IDM_MENU
mov [hMenu],eax
Then get the handle of the submenu you want to track :
invoke GetSubMenu,[hMenu],0 ; 0 = first submenu
mov [hPopup],eax
then display the sub menu with TrackPopupMenuEx :
invoke TrackPopupMenuEx, [hPopup], TPM_RETURNCMD, [posX], [posY], [hwnd], NULL
As tenkey said the TrackPopupMenuEx only takes second level menus.
Hi AceEmbler,
Load the menu with LoadMenu :
invoke LoadMenu,[hInst],IDM_MENU
mov [hMenu],eax
Then get the handle of the submenu you want to track :
invoke GetSubMenu,[hMenu],0 ; 0 = first submenu
mov [hPopup],eax
then display the sub menu with TrackPopupMenuEx :
invoke TrackPopupMenuEx, [hPopup], TPM_RETURNCMD, [posX], [posY], [hwnd], NULL
As tenkey said the TrackPopupMenuEx only takes second level menus.
That's what i call help.
Do i have to destroy SubMenu handle or just my main Menu handle ??
btw i have to edit *rc file with my menu manually is there a way to do such a menu with radasm menueditor ??
You have only to destroy the main menu handle, all submenus will be destroyed with it:
invoke DestroyMenu,
Yes, you can create these types of menus with RadASM. Just use the menu editor normally. Create a leftmost menu item then your sub menu items will be one to the right of that. When you load the menu it will be submenu 0.
invoke DestroyMenu,
Yes, you can create these types of menus with RadASM. Just use the menu editor normally. Create a leftmost menu item then your sub menu items will be one to the right of that. When you load the menu it will be submenu 0.