Dim $i, $b, $a
Dim $List[3], $ok[4], $positon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WindowsConstants.au3>
$positon = WinGetPos("[CLASS:Notepad]", "")
If Not @error Then
$Form1 = GUICreate("Form1", 362, 269, $positon[0] + $positon[2] + 3, $positon[1] + 4)
$Input1 = GUICtrlCreateInput("Input1", 8, 8, 137, 50)
$List[1] = GUICtrlCreateList("", 160, 0, 193, 152)
GUICtrlSetData($List[1], "123")
GUICtrlSetData($List[1], "345")
GUICtrlSetData($List[1], "789")
$List[2] = GUICtrlCreateList("", 160, 160, 193, 153)
GUICtrlSetData($List[2], "bhg")
GUICtrlSetData($List[2], "llj")
GUICtrlSetData($List[2], "87u")
$ok[1] = GUICtrlCreateButton("ok1", 20, 80, 30, 30)
$ok[2] = GUICtrlCreateButton("ok2", 20, 150, 30, 30)
$ok[3] = GUICtrlCreateButton("ok3", 20, 200, 30, 30)
;GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
GUISetState()
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
$status = WinGetState("[CLASS:Notepad]", "")
;MsgBox(0,0,$status)
If BitAnd($status, 16) Then ;最小化
WinSetState($Form1,"",@SW_MINIMIZE)
ElseIf BitAnd($status, 8) Then
$array=WinGetPos("[CLASS:Notepad]")
WinMove("Form1","",$array[0]+$array[2],$array[1])
;WinSetOnTop("Form1","",1)
WinSetState($Form1,"",@SW_RESTORE)
EndIf
If WinActive("[CLASS:Notepad]") Then
WinSetOnTop("Form1","",1)
Else
WinSetOnTop("Form1","",0)
EndIf
WEnd
回复 1# fenhanxue |