Sign in to follow this  
Followers 0
dexxa

ddraw.dll

7 posts in this topic

i am just wondering if i want to draw a dot or a line(many dots) on any windows, do i need to call ddraw.dll? if i do need to use ddraw.dll, wut functions would be right for the job? thank you

Share this post


Link to post
Share on other sites



Heading to bed, so I don't have time to do it myself:

Search for 'SetPixel' or maybe 'PixelSet'.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

thx

but can u show me an example? i cant seem to get it to work.

Share this post


Link to post
Share on other sites

Sure, now that I have time :)

http://www.autoitscript.com/forum/index.ph...wtopic=8831&hl=

Not the best example, but it should get the job done. Any questions, feel free to ask.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Or... Here's a simpler example, with comments:

Func _PixelSet($WinHandle, $X, $Y, $Color)
    Local $WinHandle, $X, $Y, $Color, $dc
    $dc= DllCall ("user32.dll", "int", "GetDC", "hwnd", ($WinHandle)); get the window handles device context
    DllCall ("gdi32.dll", "long", "SetPixel", "long", $dc[0], "long", $x, "long", $y, "long", $color); the actuall 'SetPixel' function
    DllCall ("user32.dll", "int", "ReleaseDC", "hwnd", 0,  "int", $dc[0]); finally, realese the device context!
EndFunc

And here's a cool example :)

HotKeySet ("d", "Draw")
HotKeySet ("^e", "MyExit")
MsgBox (4096, "NOTE", "Press 'D' to draw and Ctrl+E to exit... The default color is Green.")
Func SetPixel ($handle, $x, $y, $color)
    $dc= DllCall ("user32.dll", "int", "GetDC", "hwnd", $handle)
    $setpixel= DllCall ("gdi32.dll", "long", "SetPixel", "long", $dc[0], "long", $x, "long", $y, "long", $color)
    $realesedc= DllCall ("user32.dll", "int", "ReleaseDC", "hwnd", 0,  "int", $dc[0])
EndFunc

Func Draw ()
    $pos= MouseGetPos ()
    SetPixel ("", $pos[0], $pos[1], 0x00FF00)
    Sleep (10)
EndFunc

Func MyExit ()
    Exit
    EndFunc

While 1
    Sleep (100)
    WEnd

Press "D" to draw anywhere, and press "E" to exit at anytime :D To get the dots off the screen, put something over them, like a window or something, or just refresh the screen :D

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites
Posted Image

Share this post


Link to post
Share on other sites

I drew on my wallpaper and to get rid of it I had to 'refresh' my desktop because when I closed it, it didn't disappear.


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0