Hallo
wie bekomme ich es bei folgendem Beispiel hin, dass auch beim klicken des Exit trayitems die gui richtig geschlossen wird?
Sie wird zwar so auch geschlossen aber nur aufgrund von einem fehler "Unknown macro".
#include <GuiConstantsEx.au3>
[/autoit][autoit][/autoit][autoit]Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
Opt("GUIOnEventMode", 1)
TrayItemSetOnEvent(TrayCreateItem("Exit"),"_winClose")
[/autoit][autoit][/autoit][autoit]$hGui = GUICreate("Gui1")
GUISetOnEvent($GUI_EVENT_CLOSE,"_winClose")
GUISetState()
$hGui2 = GUICreate("Gui2")
GUISetOnEvent($GUI_EVENT_CLOSE,"_winClose")
GUISetState()
While 1
Sleep(1000)
WEnd
Func _winClose()
If @GUI_WinHandle == $hGui Then
MsgBox(0,"","Gui 1 exit")
Exit
ElseIf @GUI_WinHandle == $hGui2 Then
MsgBox(0,"","Gui 2 exit")
Exit
Else
MsgBox(0,"","Trayitem exit")
Exit
EndIf
EndFunc
mfg