Jump to content
Sign in to follow this  

Show button menu in ModernMenu

Recommended Posts


Hello, is it possible to show the button menu without clicking the button?

I have read all pages of the ModernMenu thread, but mostly were asking to show tray menu.


Basically, I want to create one hidden GUI with multiple menus. The menu will be shown if shortcut is pressed. So, just like the behavior of a GUI with multiple buttons to place the contextmenus using dummy and GUICtrlCreateContextMenu.

I have tried to add _GUICtrlMenu_TrackPopupMenu after the GUISetState in the example script.

_GUICtrlMenu_TrackPopupMenu($FileMenu,$hMainGUI,  $x[0], $x[1], 3, 2, 2, 0)

I also tried jennico way to show tray

DllCall($hUser32Dll, "int", "SetForegroundWindow","hwnd", GUICtrlGetHandle($MenuMenu))
DllCall($hUser32Dll, "int", "ShowWindow", "hwnd", $hMainGUI,"int", @SW_SHOW)

And, I changed to use GUICtrlCreateContextMenu too, instead GUICtrlCreateMenu.

GUICtrlCreateButton("", 1, 1, 1, 1)
$cDummy = GUICtrlCreateDummy()
$FileMenu       = GUICtrlCreateContextMenu($cDummy)
$nSideItem1     = _CreateSideMenu($FileMenu)

I cannot make it to work, is it possible to show the ModernMenu without the need to click?

Thank you.

I just started to learn about ModernMenu by playing around with the example script. I don't think it is wise to post hundreds lines of code, so I quoted some codes instead to make it easier.. I hope.


I think ModernMenu uses GUICtrlCreateMenu to create the menu. After searching on the forum, _GUICtrlMenu_TrackPopupMenu can only be use to show menu that created using GUICtrlCreateContextMenu or _GUICtrlMenu_CreatePopup, not with GUICtrlCreateMenu... unless I missed something while checking the forum.

So, I guess, the question is now... is it possible to show menu that is created using GUICtrlCreateMenu, not using GUICtrlCreateContextMenu or _GUICtrlMenu_CreatePopup?

Any help would be appreciated.

Edited by MDCT

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this