Jemand eine Idee, warum nach erfolgreicher Ausführung der Fensteranimation (Button1) keine weiteren Animationen mehr möglich sind? Scheinbar können danach keinerlei Buttons mehr genutzt werden, das eingebaute Timerlabel zeigt aber, dass das Programm ansich noch innerhalb der GUI Schleife ist und somit auch GUI messages auswerten sollte. Lässt man sich alle GUI messages (ungleich 0) in die console ausgeben sieht man auch die messages für Mausklicks, allerdings keine Messages bei Klicks auf Controls. Ich bin ein wenig verwirrt.
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
GUISetBkColor(0x0066CC)
$Button1 = GUICtrlCreateButton("Button1", 64, 64, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 112, 184, 75, 25)
$Button3 = GUICtrlCreateButton("Button3", 360, 208, 75, 25)
$aliveLabel = GUICtrlCreateLabel("",300,50,100,20)
$Edit1 = GUICtrlCreateEdit("", 88, 288, 473, 121)
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$test = TimerInit()
$i = 0
While 1
$nMsg = GUIGetMsg()
if $nMsg > 0 Then ConsoleWrite("nMsg id: " & $nMsg & @CRLF)
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
ConsoleWrite("button1 function called" & @CRLF)
GUISetState(@SW_HIDE,$Form1)
$hwnd = WinGetHandle($Form1)
$result = DllCall("user32.dll", "BOOL", "AnimateWindow", "hwnd", $hwnd, "dword", 5000, "dword", 131072+5) ; activate + diagonal
If @error <> 0 Then
ConsoleWrite("ERROR: " & @error & @CRLF)
GUISetState(@SW_SHOW,$Form1)
Else
if IsArray($result) Then
;_ArrayDisplay($result)
Else
ConsoleWrite("String 1: " & $result & @CRLF)
EndIf
EndIf
Case $Button2
ConsoleWrite("button2 function called" & @CRLF)
$temp = GUISetState(@SW_HIDE,$Form1)
ConsoleWrite("return hide: " & $temp & @CRLF)
Sleep(3000)
$temp = GUISetState(@SW_SHOW,$Form1)
ConsoleWrite("return show: " & $temp & @CRLF)
EndSwitch
If TimerDiff($test) > 1000 Then
$i+=1
GUICtrlSetData($aliveLabel,$i)
$test = TimerInit()
EndIf
WEnd