Sets the clickmode of the tray icon - what mouseclicks will display the tray menu.
TraySetClick ( flag )
| flag | 0 = Tray menu will never be shown through a mouseclick 1 = Pressing primary mouse button 2 = Releasing primary mouse button 4 = Double-click primary mouse button 8 = Pressing secondary mouse button 16 = Releasing secondary mouse button 32 = Double-click secondary mouse button 64 = Hovering over the tray icon |
#NoTrayIcon
Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.
Local $settingsitem = TrayCreateMenu("Settings")
TrayCreateItem("Display", $settingsitem)
TrayCreateItem("Printer", $settingsitem)
TrayCreateItem("")
Local $aboutitem = TrayCreateItem("About")
TrayCreateItem("")
Local $exititem = TrayCreateItem("Exit")
TraySetState()
TraySetClick(16)
While 1
Local $msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $aboutitem
MsgBox(64, "About:", "AutoIt3-Tray-sample")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd
Exit