03-07-2019, 08:33 AM
Macro enum menu items
out
int w=win("Notepad++" "Notepad++")
int hmenu=GetMenu(w)
if(hmenu=0) out "no menu"; ret
sub.EnumSubmenu(hmenu 0)
#sub EnumSubmenu
function hm level
int i n=GetMenuItemCount(hm)
for i 0 n
,str s name=""
,MenuGetString(hm -i name)
,int hms=GetSubMenu(hm i)
,if hms
,,out s.format("%.*m[%s]" level 9 name)
,,sub.EnumSubmenu(hms level+1)
,else
,,int miid=GetMenuItemID(hm i)
,,out s.format("%.*m%i %s" level 9 miid name)
,