10-02-2009, 04:39 PM
Small bug with submenu icon being misplaced:
Macro MenuPopup help
Macro MenuPopup help
;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(16 16 ILC_MASK|ILC_COLOR32 0 8)
_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
MenuPopup x.AddItems(s)
int i=x.Show
out i