﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
937	TrayItemSetState() and TrayItemGetState()	anonymous	Jpm	"I'm getting an odd result using the TrayItemGetState function. I have written some code to take action when the user clicks an item in my tray menu, depending on its state. The code also toggles the checked state of the item. No matter which state the menu item is in, the call to TrayItemGetState always returns 68. Am I doing something wrong? Here's some example code which always returns 68 on my machine...

{{{
#include <Constants.au3>

; Set up Tray Menu...
AutoItSetOption(""TrayAutoPause"", 0)
AutoItSetOption(""TrayMenuMode"", 1)
AutoItSetOption(""TrayOnEventMode"", 1)
$optionsMenu = TrayCreateMenu(""Quick Options"")
$startOnBoot = TrayCreateItem(""Start with Windows"", $optionsMenu)
$exitItem = TrayCreateItem(""Exit"")
TrayItemSetOnEvent($startOnBoot, ""SetOptions"")
TrayItemSetOnEvent($exitItem, ""AppExit"")

TrayItemSetState($startOnBoot, $TRAY_UNCHECKED)

while(1)

WEnd

Func SetOptions()
ConsoleWrite(""TrayItemGetState = "" & TrayItemGetState($startOnBoot) & @LF)
If BitAND(TrayItemGetState($startOnBoot), $TRAY_UNCHECKED) = $TRAY_UNCHECKED Then
TrayItemSetState($startOnBoot, $TRAY_CHECKED)
Else
TrayItemSetState($startOnBoot, $TRAY_UNCHECKED)
EndIf
EndFunc ;==>SetOptions

Func AppExit()
Exit
EndFunc ;==>AppExit
}}}
"	Bug	closed	3.3.1.0	AutoIt	3.3.0.0	None	Fixed		
