Erlaubt die Produktion von Spezialeffekte wenn Fenster angezeigt oder versteckt werden
#include <WinAPISysWin.au3>
_WinAPI_AnimateWindow ( $hWnd, $iFlags [, $iDuration = 1000] )
$hWnd | Das Handle zum Fenster welches animiert werden soll. |
$iFlags | Das Flag welches dem Typ der Animation angibt. Dieser Parameter kann einen oder mehrere der folgenden Werte annehmen. Man sollte aber beachten, dass standardmäßig die Effekte angezeigt werden, wenn ein Fenster angezeigt wird. Um den Effekt auf das Verstecken von Fenstern anzuwenden, sollte man AW_HIDE und einen logischen ODER-Operator mit einen der angebrachten Flags verwenden: $AW_ACTIVATE $AW_BLEND $AW_CENTER $AW_HIDE $AW_HOR_NEGATIVE $AW_HOR_POSITIVE $AW_SLIDE $AW_VER_NEGATIVE $AW_VER_POSITIVE |
$iDuration | [optional] Gibt an wie lange die Animation, in Millisekunden, dauern soll. Standard ist 1000. |
Erfolg: | True. |
Fehler: | False. Es ist _WinAPI_GetLastError() aufzurufen um erweiterte Fehlerinformationen zu erhalten. |
Suche nach AnimateWindow in der MSDN Bibliothek.
#include <APISysConstants.au3>
#include <GUIConstantsEx.au3>
#include <MenuConstants.au3>
#include <TrayConstants.au3>
#include <WinAPIGdi.au3>
#include <WinAPISysWin.au3>
#include <WindowsConstants.au3>
#NoTrayIcon
Opt('TrayMenuMode', 1)
Local $hTray = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', 'TrayNotifyWnd1')
Local $idTrayRestoreItem = TrayCreateItem('Zurücksetzen')
TrayItemSetState(-1, $TRAY_DEFAULT)
TrayCreateItem('')
Local $idTrayExitItem = TrayCreateItem('Exit')
TraySetClick(8)
Global $g_hForm = GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'))
Global $g_idDummy = GUICtrlCreateDummy()
GUIRegisterMsg($WM_SYSCOMMAND, 'WM_SYSCOMMAND')
GUISetState(@SW_SHOW)
While 1
Switch TrayGetMsg()
Case $idTrayRestoreItem
_WinAPI_DrawAnimatedRects($g_hForm, _WinAPI_GetWindowRect($hTray), _WinAPI_GetWindowRect($g_hForm))
GUISetState(@SW_SHOW, $g_hForm)
TraySetState(2)
Case $idTrayExitItem
ExitLoop
EndSwitch
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_WinAPI_AnimateWindow($g_hForm, BitOR($AW_BLEND, $AW_HIDE))
ExitLoop
Case $g_idDummy ; Minimieren
_WinAPI_DrawAnimatedRects($g_hForm, _WinAPI_GetWindowRect($g_hForm), _WinAPI_GetWindowRect($hTray))
GUISetState(@SW_HIDE, $g_hForm)
TraySetState(1)
EndSwitch
WEnd
Func WM_SYSCOMMAND($hWnd, $iMsg, $wParam, $lParam)
#forceref $iMsg, $lParam
Switch $hWnd
Case $g_hForm
Switch $wParam
Case $SC_MINIMIZE
GUICtrlSendToDummy($g_idDummy)
Return 0
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_SYSCOMMAND