The following code does exactly that, but the message coming out from %A_ThisMenuItem% is &MyItem1, My&Item2 and MyItem&3, rather thanTo underline one of the letters in a menu item's name, precede that letter with an ampersand (&). When the menu is displayed, such an item can be selected by pressing the corresponding key on the keyboard.
MyItem1, MyItem2 and MyItem3. I don't think that's what we want. How can I fix this? Thanks.
Code: Select all
Menu, MyMenu, Add, &MyItem1, MenuHandler
Menu, MyMenu, Add, My&Item2, MenuHandler
Menu, MyMenu, Add, MyItem&3, MenuHandler
Menu, MyMenu, Show
return
MenuHandler:
MsgBox You selected "%A_ThisMenuItem%" from the menu %A_ThisMenu%.