#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> Local $hGUI = GUICreate("Случайное перемещение окна",700,300) Local $idButton = GUICtrlCreateButton("Переместить", 210, 170, 85, 25)
GUISetState(@SW_SHOW, $hGUI)
While 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE then ExitLoop endif if $msg = $idButton then
$x = random(0,@DesktopWidth,1) $y = random(0,@DesktopHeight,1) WinMove($hGUI,"",$x,$y)
EndIf
WEnd