; Holger
; http://www.autoitscript.com/forum/topic/20967-guitray-menu-with-icons-and-colors/
#include "ModernMenuRaw.au3"
#include <GUIConstantsEx.au3>

#NoTrayIcon
Opt("GUIOnEventMode", 1)
Opt("TrayMenuMode", 7)

_SetFlashTimeOut(250)
$nTrayIcon = _TrayIconCreate("Моя программа", "shell32.dll", -209)

_TrayCreateContextMenu()

$action = _TrayCreateItem('Изменить цвет выбранного')
GUICtrlSetOnEvent(-1, "SetColors")
_TrayItemSetIcon(-1, "mspaint.exe", 0)

$nAbout = _TrayCreateItem('О программе')
_TrayItemSetIcon(-1, "shell32.dll", -222)

$nExit = _TrayCreateItem('Выход')
GUICtrlSetOnEvent(-1, "_Quit")
_TrayItemSetIcon(-1, "shell32.dll", -216)

_TrayIconSetState()

While 1
	Sleep(10000)
WEnd

Func _Quit()
	_TrayIconDelete($nTrayIcon)
	Exit
EndFunc

Func SetColors()
	_SetTraySelectBkColor(0xAAFFFF)
EndFunc