I'm new to AutoIT and i have a question about the tray function in the beta.
to call a GUI from the tray menu works fine but using a button or any another control to hide the GUI and come back to the traymenu doesn't work ( or better i don't know how to!)
Can someone tell me how to make it work?
Here is my simple code
#include <GUIConstants.au3>
Global Const $s_Title = 'Tray & GUI'
Global Const $s_Version = 'v0.1'
Global Const $GUI_Height = '457'
Global Const $GUI_Width = '412'
Opt("TrayMenuMode",1)
TraySetToolTip($s_Title & " - " & $s_Version)
$settingsitem = TrayCreateItem("Preferences")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("End")
TraySetState()
$PreferencesWindow = GUICreate($s_Title &" " & $s_Version & " Preferences", $GUI_Width, $GUI_Height)
$ButtonendePref = GUICtrlCreateButton("OK", 320,405,60)
GUISetState(@SW_HIDE)
While 1
$msgTray = TrayGetMsg()
$msgGui = GUIGetMsg()
Select
Case $msgTray = 0
ContinueLoop
Case $msgGui = $ButtonendePref
MsgBox ("", "Ende", $s_Title & " " & $s_Version)
Case $msgTray = $aboutitem
MsgBox ("", "Über", $s_Title & " " & $s_Version)
Case $msgTray = $settingsitem
Switch2PreferencesWindow()
Case $msgTray = $exititem
ExitLoop
EndSelect
WEnd
Exit
Func Switch2PreferencesWindow()
GUISwitch($PreferencesWindow)
GUISetState(@SW_Show)
EndFunc