dexxa Posted April 12, 2005 Share Posted April 12, 2005 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 Link to comment Share on other sites More sharing options...
Insolence Posted April 12, 2005 Share Posted April 12, 2005 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. Link to comment Share on other sites More sharing options...
dexxa Posted April 13, 2005 Author Share Posted April 13, 2005 thx but can u show me an example? i cant seem to get it to work. Link to comment Share on other sites More sharing options...
Insolence Posted April 13, 2005 Share Posted April 13, 2005 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. Link to comment Share on other sites More sharing options...
layer Posted April 13, 2005 Share Posted April 13, 2005 (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 To get the dots off the screen, put something over them, like a window or something, or just refresh the screen Edited April 13, 2005 by layer FootbaG Link to comment Share on other sites More sharing options...
dexxa Posted April 13, 2005 Author Share Posted April 13, 2005 Link to comment Share on other sites More sharing options...
buzz44 Posted April 13, 2005 Share Posted April 13, 2005 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. qq Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now