[R] Parametre de fonction

Aide et conseils concernant AutoIt et ses outils.
Règles du forum
.
Répondre
overflow
Niveau 5
Niveau 5
Messages : 138
Enregistré le : sam. 05 déc. 2009 23:49
Status : Hors ligne

[R] Parametre de fonction

#1

Message par overflow »

Bonsoir et bonne fete a tous !!! (on approche de l heure fatidique !!)

J ai quelques souci avec la commande pour afficher des pixel sur une Form
Alors j essaye de me tourner vers la "Gdi.dll"

J ai trouver cette fonction sur un forum allemand

mais ca coince avec la variable $hDC

Code : Tout sélectionner


Func _SetPixelV($hDC, $x, $y, $color, $DLL = "gdi32.dll")
    
    $setpixel = DllCall($DLL, "long", "SetPixelV", "long", $hDC, "long", $x, "long", $y, "long", $color)

EndFunc   ;==>_SetPixelV

 
dans la theorie c est "handle to the device context"

mais dans la pratique . . . .

j ai tester un wingethandle($maform) et meme un $maform direct mais rien

je precise qu a l appel de cette fonction, $DLL est egal a = DllOpen("gdi32.dll")


Cette fonction est censé m afficher un point au coordoné x,y de couleur $color et biensure je pensais que $hDC etait le handle de ma fenetre . . .

voila si vous aviez des infos qui pourrais m aider je vous en serais reconnaissant

en exemple ca donnerais ca :

Code : Tout sélectionner

$interface = GUICreate("Ma forme",296,344,232,281,-1,$WS_EX_TOPMOST)
GUISetState(@SW_SHOW)
 

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
              Exit
    EndSwitch

    $DLL = DllOpen("gdi32.dll")

    _SetPixelV($interface, 57, 29, 2555, $DLL); ne fonction pas , $hwnd=wingatehandle($interface) ne marche pas non plus ;(
    DllClose($DLL)


WEnd


Func _SetPixelV($hDC, $x, $y, $color, $DLL = "gdi32.dll")
    $setpixel = DllCall($DLL, "long", "SetPixelV", "long", $hDC, "long", $x, "long", $y, "long", $color)
EndFunc   ;==>_SetPixelV
 
Modifié en dernier par overflow le ven. 01 janv. 2010 00:34, modifié 1 fois.
overflow
Niveau 5
Niveau 5
Messages : 138
Enregistré le : sam. 05 déc. 2009 23:49
Status : Hors ligne

Re: [..] Parametre de fonction

#2

Message par overflow »

Oups bon et bien de posté un message ici a du me porter chance
je ne trouvais rien depuis 1 heure et hop la c est venu d un coup !!

Code : Tout sélectionner

$hWND=WinGetHandle($interface)


_SetPixelV($hWND, 57, 40, 2555);

Func _SetPixelV($hDC, $x, $y, $color)
    $dc= DllCall ("user32.dll", "int", "GetDC", "hwnd", $hDC)
    $setpixel = DllCall("gdi32.dll", "long", "SetPixelV", "long", $dc[0], "long", $x, "long", $y, "long", $color)
EndFunc   ;==>_SetPixelV


 


voila !!

Bonnes anné !!!!
Répondre