Code: Select all
#Requires AutoHotkey v2.1-
m := Menu()
loop 6
m.add 'menu' A_Index, menuhandler
m2 := Menu()
loop 4
m2.add 'submenu' A_Index, menuhandler
m.add 'submenu', m2
menuhandler(item, *) => MsgBox(item)
#HotIf WinActive('ahk_exe msedge.exe')
F1::m.show()
Without the directive, the menu is always displayed in the foreground, in the shipping of all windows.