###Function###
TrayItemSetState

###Description###
Sets the state of a tray menu/item control.

###Syntax###
TrayItemSetState ( controlID, state )


###Parameters###
@@ParamTable@@
controlID
	The control identifier (controlID) as returned by a <a href="../functions/TrayCreateItem.htm">TrayCreateItem</a> or <a href="../functions/TrayCreateMenu.htm">TrayCreateMenu</a> function.
state
	See the <a href="#StateTable">State table</a> below.
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	1.
Failure:	0.
@@End@@


###Remarks###
<a id="StateTable"></a><strong>State table</strong>
@@StandardTable1@@
<strong>State</strong>	<strong>Value</strong>	<strong>Comments</strong>
No Change	0
$TRAY_CHECKED	1	Menuitem will be checked
$TRAY_UNCHECKED	4	Menuitem will be unchecked
$TRAY_ENABLE	64	Menuitem will be enabled
$TRAY_DISABLE	128	Menuitem will be greyed out
$TRAY_FOCUS	256	Menuitem will be selected
$TRAY_DEFAULT	512	Menuitem will be set as default menuitem
@@End@@

State values can be summed up as for example $TRAY_CHECKED + $TRAY_DEFAULT sets the menuitem in an checked and default state.

To reset/delete the $TRAY_DEFAULT-state for a menuitem just use this function on the item with another state, for instance with $TRAY_ENABLE.

When you set $TRAY_DEFAULT state for a menuitem, the default behavior of primary double click on tray icon is to execute this default menuitem. To disable this behavior use flag 4 as the option in TrayMenuMode.

The above constants are defined in #include <TrayConstants.au3>


###Related###
TrayCreateItem, TrayCreateMenu, TrayItemGetState, TraySetState


###Example###
@@IncludeExample@@
