在用$XY/$XY2之前,要先判断是不是数组:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form2 = GUICreate("Form2", 392, 60, -200, -200, BitOR($WS_MINIMIZEBOX, $WS_POPUP, $WS_GROUP), BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
GUISetState(@SW_SHOW)
$new = WinWait("Panel V7.1", "")
While 1
$XY = WinGetPos($Form2)
$XY2 = WinGetPos($new)
If IsArray($XY) And IsArray($XY2) Then
If $XY2[0] <> $XY[0] Or $XY2[1] <> $XY[1] Then
WinMove($Form2, "", $XY2[0] + 1, $XY2[1] + 320)
WinSetOnTop('Form2', '', 1)
EndIf
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|