Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=D:\s3\stage\autoit\F_getpos2.kxf
;Local $size = WinGetPos("Password Dialog")
$Form1 = GUICreate("Password Dialog",615, 438, -1, -1)
Local $size = WinGetPos("[active]")
$PasswordEdit = GUICtrlCreateInput("password", 8, 32, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$ButtonOk = GUICtrlCreateButton("&OK", 86, 64, 75, 25, $BS_NOTIFY)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25, $BS_NOTIFY)
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17, 0)
$Button1 = GUICtrlCreateButton("<Back", 400, 384, 65, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
#Region ### START Koda GUI section ### Form=D:\s3\stage\autoit\F_getpos1.kxf
$Form2 = GUICreate("Form1", 615, 438, -1, -1)
$Button1 = GUICtrlCreateButton("<Back", 312, 368, 89, 33)
$Button2 = GUICtrlCreateButton("Next>", 416, 368, 81, 33)
$Input1 = GUICtrlCreateInput("Input1", 96, 104, 193, 21)
;GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;WinGetPos
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ButtonOk ; Si clic sur le bouton $Btn1
Local $size = WinGetPos("[active]")
;Example()
GUISetState(@SW_HIDE, $Form1) ; On masque la GUI 1
;GUICreate("form1", $size[0], $size[1], $size[2], $size[3])
;Example()
GUISetState(@SW_SHOWNOACTIVATE ,$Form2) ; On affiche la GUI 2
WinMove ("[active]","",$size[0], $size[1], $size[2], $size[3])
;Local $size = WinGetPos("Password Dialog")
Case $Button1 ; Si clic sur le bouton $Btn1
Local $size1 = WinGetPos("[active]")
;Example()
GUISetState(@SW_HIDE, $Form2) ; On masque la GUI 1
;GUICreate("Password Dialog", $size[0], $size[1], $size[2], $size[3])
;Example()
GUISetState(@SW_SHOWNOACTIVATE ,$Form1) ; On affiche la GUI 2
WinMove ("[active]","",$size1[0], $size1[1], $size1[2], $size1[3])
EndSwitch
WEnd
Func Example()
; Retrieve the position as well as height and width of the active window.
Local $aPos = WinGetPos("[ACTIVE]")
; Display the array values returned by WinGetPos.
MsgBox(4096, "", "X-Pos: " & $aPos[0] & @CRLF & _
"Y-Pos: " & $aPos[1] & @CRLF & _
"Width: " & $aPos[2] & @CRLF & _
"Height: " & $aPos[3])
EndFunc ;==>Example