Page 1 sur 1

[Ex] Afficher l'heure analogique sur le bureau

Posté : mer. 21 mai 2008 18:59
par MClaveau
Vraiment une toute petite chose...

Code : Tout sélectionner

$xcentre=@DesktopWidth/2
$ycentre=@DesktopHeight/2

$angle = (24-@HOUR)*360/12 -(@MIN/60)*360/12 +90 
$angle=Mod($angle,360)*3.1415265/180
$x = cos($angle)*@DesktopHeight/5
$y = sin($angle)*@DesktopHeight/5
trait($xcentre-$x/6,$ycentre+$y/6, $xcentre+$x,$ycentre-$y)

$angle = (60-@MIN)*360/60 +90 
$angle=Mod($angle,360)*3.1415265/180
$x = cos($angle)*@DesktopHeight/3
$y = sin($angle)*@DesktopHeight/3
trait($xcentre-$x/10,$ycentre+$y/10, $xcentre+$x,$ycentre-$y)

Sleep(4250)
Exit


Func trait($x1,$y1, $x2,$y2)
    $acolor = 0xff0000; color Bleu Vert Rouge
    $epaisseur = 4

    $hd = DllCall("user32.dll", "int", "GetDC", "hwnd", 0)
    $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $epaisseur, "int", $acolor)
    DllCall("gdi32.dll", "int", "SelectObject", "int", $hd[0], "int", $pen[0])
    DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hd[0], "int", $x1, "int", $y1, "int", 0)
    DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hd[0], "int", $x2, "int", $y2)
    ;DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hd[0], "int", 700, "int", 400)  ;possible X fois LineTo
    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "int", $hd[0])
    Sleep(12)
EndFunc
 

Re: [Ex] Afficher l'heure analogique sur le bureau

Posté : mer. 28 mai 2008 16:07
par d3v1lm33
euh bonjour serait il possible de me passer la commande permettant de tracer un trait transparent et un cercle (transparent) je mettrais un petit mot ans mon programme :D