Creates a menu control for the tray menu.
TrayCreateMenu ( "sub/menutext" [, menuID [, menuentry]] )
| sub/menutext | The sub/menu text. |
| menuID | [optional] If defined, allows you to create a submenu in the referenced menu. If equal -1 it refers to first level menu. |
| menuentry | [optional] Allows you to define the entry number to be created. The entries are numbered starting at 0. |
| Success: | Returns the identifier (controlID) of the new tray menu. |
| Failure: | Returns 0. |
#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()
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