Code: Select all
#SingleInstance Force
A_TrayMenu.Delete ; Remove the default tray menu.
global testArray := [ 21, 32, 54]
Loop testArray.Length
{
A_TrayMenu.Add "testArray[" A_Index "] = " testArray[A_Index], (*) => WhatsTheNumber(A_Index)
}
A_TrayMenu.Add ; Separator
A_TrayMenu.Add "Exit", (*) => ExitApp()
WhatsTheNumber(indx) {
global testArray
MsgBox "testArray[" indx "] = " testArray[indx]
}