Je suis entrain de faire un petit programme comme Au3Info mais j'ai un petit soucis vers la finalisation
je ne comprend pas pourquoi les ligne en rouge ne fonctionne pas :
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
FileInstall("palette.jpg", @TempDir & "\palette.jpg", 1)
HotKeySet("^a", "copier")
Global $coleurPixel
Global $options
Global $active
Global $couleur
Global $anciennecouleur = 0xFFFFFF
Global $ancienneoptions
Global $pos
Global $non
Global $ancienpos1
Global $ancienpos2
Global $Form1 = GUICreate("Form1", 436, 243, 192, 124)
Global $Label1 = GUICtrlCreateLabel("", 8, 8, 196, 116)
GUICtrlSetBkColor($Label1, 0xFFFFFF)
Global $Group1 = GUICtrlCreateGroup("Informations", 216, 136, 217, 97)
Global $Label2 = GUICtrlCreateLabel("Couleur :", 232, 155, 46, 17)
Global $Label3 = GUICtrlCreateLabel("Positions X, Y :", 232, 183, 75, 17)
Global $Label4 = GUICtrlCreateLabel("Mode en cour : Aucun", 232, 208, 154, 17)
Global $Input1 = GUICtrlCreateInput("0xFFFFFF", 280, 152, 60, 21)
Global $Input2 = GUICtrlCreateInput("0", 309, 181, 33, 21)
Global $Input3 = GUICtrlCreateInput("0", 352, 181, 33, 21)
Global $Label5 = GUICtrlCreateLabel(",", 344, 189, 7, 17)
Global $Label6 = GUICtrlCreateLabel("Copier = Ctrl + a", 349, 154, 79, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Pic1 = GUICtrlCreatePic(@TempDir & "\palette.jpg", 216, 8, 216, 116)
Global $Group2 = GUICtrlCreateGroup("Mode", 8, 144, 201, 81)
Global $Button1 = GUICtrlCreateButton("Continuellement", 16, 160, 89, 25)
GUICtrlSetTip(-1, "L'affichage des pixel est continuel")
Global $Button2 = GUICtrlCreateButton("Par Clic", 16, 193, 89, 25)
GUICtrlSetTip(-1, "Cliquez sur le pixel que vous voulez pour savoir sa position ou sa couleur")
Global $Button3 = GUICtrlCreateButton("Clic - Alt", 110, 160, 89, 25)
GUICtrlSetTip(-1, "L'affichage du pixel est continuel, on peut choisir le pixel" & @CRLF & "que l'ont veut en appuyant sur Alt puis pour reprendre" & @CRLF & "l'affichage continuel appuyez aussi sur Alt")
Global $Button4 = GUICtrlCreateButton("Aucun", 110, 193, 89, 25)
GUICtrlSetTip(-1, "Affiche juste la couleur demander ou le pixel demander")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$options = 1
GUICtrlSetData($Label4, "Mode en cour : Continuellement")
Case $Button2
$options = 2
GUICtrlSetData($Label4, "Mode en cour : Par Clic")
Case $Button3
$options = 3
GUICtrlSetData($Label4, "Mode en cour : Clic - Alt")
Case $Button4
$options = 0
GUICtrlSetData($Label4, "Mode en cour : Aucun")
EndSwitch
couleurpos()
couleurinput()
[color=#FF0000]$info = GUIGetCursorInfo($Form1)
If Not $info[4] = 14 Or $info[4] = 0 Then
ContinueLoop
EndIf[/color]
TrayTip("", $info[4], 100)
If _IsPressed("01", "user32.dll") And $options = 2 Then
pos()
ElseIf $options = 1 Then
pos()
ElseIf $options = 3 Then
If $active = 0 Then
pos()
ElseIf _IsPressed("12", "user32.dll") And $active = 1 Then
$active = 0
EndIf
EndIf
WEnd
Func copier()
$couleur = GUICtrlRead($Input1)
ClipPut($couleur)
EndFunc ;==>copier
Func couleurinput()
$couleur = GUICtrlRead($Input1)
If $couleur = $anciennecouleur Then
Else
GUICtrlSetBkColor($Label1, $couleur)
$anciennecouleur = $couleur
EndIf
EndFunc ;==>couleurinput
Func couleurpos()
$pos1 = GUICtrlRead($Input2)
$pos2 = GUICtrlRead($Input3)
$pixel = PixelGetColor($pos1, $pos2)
$coleurPixel = Hex($pixel, 6)
GUICtrlSetData($Input1, "0x" & $coleurPixel)
EndFunc ;==>couleurpos
Func pos()
$pos = MouseGetPos()
GUICtrlSetData($Input2, $pos[0])
GUICtrlSetData($Input3, $pos[1])
EndFunc ;==>pos



