This is wonderful, thanks!
It's working well so far, except unable to set icons for submenu items (i.e. items that open submenus).
Another thing: if an item is "checked", sometimes the checkmark can be seen underneath the menu icon.
Also, would like to be able to use icon handles so that GetWindowIcon can be used.
Thanks again.
;Creates and shows a popup menu. ;Also has functions to disable, check items, etc. ;A MenuPopup variable also can be used as menu handle with Windows API menu functions.
;EXAMPLES
#compile"__MenuPopup"
str s= ;1 Text (1 is item id; Text is label) ;- ;2 Use - line for separator ;>3 Submenu ;,15 Tabs at the beginning are ignored ;,16 Tab in the middle right-aligns text ;,< ;| ;25 Use | line for vertical break ;>30 Another submenu (with id) ;,31 &Ampersand (&&) underlines the character ;,-32 (separator with id) ;,Menu item id is optional ;,< __ImageList- il=ImageList_Create(1616ILC_MASK|ILC_COLOR3208)
_i=GetWindowIcon(win("Quick"));ImageList_ReplaceIcon(il -1 _i);DestroyIcon(_i)
_i=GetWindowIcon(win("Firefox"));ImageList_ReplaceIcon(il -1 _i);DestroyIcon(_i) SetThreadMenuIcons"1=0 2=1 30=0"+il 2
POINT p int px(xm) py(ym)
p.x=px
p.y=py SetThreadMenuIcons"2=1""$qm$\il_qm.bmp"1 int i=ShowMenu("1 A[]2 B"0 p) out i
(I got part of the above code from other topic)
At mouse pointer location a menu pops-up and the "B" item shows an Icon when I run this from QM.
But the compiled version doesn't show an icon.
Is there something that must be set in the 'make exe' dialog window?
Or must I hardcode the path to the iconfile somwhere in the above code (Helpfile > Make exe > Resources)?
int i=ShowMenu("1 Notepad++[]2 Camtasia2") sel i ,case0ret ,case1mac"Notepad++" ,case2mac"Camtasia2"
I get a warning this should not run from macro. Do I need to turn it into a function? Thanks
... Update! Turning into function works great. Does this garbage collect on its own or is there somethings to be careful of? Thanks