Pour Configurer l'affichage de vos contrôles et détecter la collision physique de deux contrôles ainsi que les coordonnées de collision.
Exemples :
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "Ctrl.au3"
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Ctrl.au3", 525, 438, 92, 324)
Global $Button1 = GUICtrlCreateButton("A", 40, 32, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button2 = GUICtrlCreateButton("U", 88, 168, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button3 = GUICtrlCreateButton("T", 344, 72, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button4 = GUICtrlCreateButton("O", 184, 296, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button5 = GUICtrlCreateButton("I", 352, 216, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button6 = GUICtrlCreateButton("T", 400, 224, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button7 = GUICtrlCreateButton("Start", 232, 384, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Form1
Case $Form1
Case $Form1
Case $Form1
Case $Button1
Case $Button2
Case $Button3
Case $Button4
Case $Button5
Case $Button6
Case $Button7
If _ScanToDetectColision($Button5,$Button6) Then
MsgBox(48,"Ctrls","Deux controles se touchent!",2)
EndIf
_WinAPIClientToDesktopCenter($Form1)
Sleep(1000)
_WinAPIClientToWindowCenter($Form1, $Button7)
Sleep(2000)
_WinAPISetCtrlPosByChilInfos($Form1,Default,Default)
Sleep(2000)
_WinAPISetCtrlPosX_by_Y($Form1)
Sleep(2000)
_WinAPISetUniqueCtrl($Form1)
EndSwitch
WEnd
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "Ctrl.au3"
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Ctrl.au3", 525, 438, 92, 324)
Global $Button1 = GUICtrlCreateButton("A", 40, 32, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button2 = GUICtrlCreateButton("U", 88, 168, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button3 = GUICtrlCreateButton("T", 344, 72, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button4 = GUICtrlCreateButton("O", 184, 296, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button5 = GUICtrlCreateButton("I", 352, 216, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button6 = GUICtrlCreateButton("T", 400, 224, 75, 25)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
Global $Button7 = GUICtrlCreateButton("Start", 232, 384, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Form1
Case $Form1
Case $Form1
Case $Form1
Case $Button1
Case $Button2
Case $Button3
Case $Button4
Case $Button5
Case $Button6
Case $Button7
If _ScanToDetectColision($Button5,$Button6) Then
MsgBox(48,"Ctrls","Deux controles se touchent!",2)
EndIf
_WinAPIClientToDesktopCenter($Form1)
Sleep(1000)
_WinAPIClientToWindowCenter($Form1, $Button7)
Sleep(2000)
_WinAPISetCtrlPosByChilInfos($Form1,Default,Default)
Sleep(2000)
_WinAPISetCtrlPosX_by_Y($Form1)
Sleep(2000)
_WinAPISetUniqueCtrl($Form1)
EndSwitch
WEnd