#include <GUIConstantsEx.au3> #include <StructureConstants.au3> #include <WindowsConstants.au3> Local $hGUI = GUICreate("GUI") GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg($WM_WINDOWPOSCHANGING, 'WM_WINDOWPOSCHANGING') While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func WM_WINDOWPOSCHANGING($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wPara