Jump to content

Decoy Mouse Pointer


Zinefer
 Share

Recommended Posts

I am trying to create a second mouse pointer using GDI. I found some crosshair code and modified it a bit to follow the mouse around. However, instead of it just moving around it kindof paints across myscreen until something refreshed it. I have tried everything I can think of to cause the screen to refresh but, to no avail.

Please, let me know if you have any ideas! c

Thanks so much.

Here is my code:

while 1
    $pos = MouseGetPos()
    pict($pos[0]+20, $pos[1])
    sleep(2)
WEnd


Func drawpix($dc,$x,$y,$color) 
    DllCall ("gdi32.dll", "long", "SetPixel", "long", $dc[0], "long", $x, "long", $y, "long", $color) 
EndFunc 
    
 Func pict($x,$y) 
    $dc= DllCall ("user32.dll", "int", "GetDC", "hwnd", "") 
    drawpix($dc,$x-4+1,$y-4+1,0x000000FF) 
    drawpix($dc,$x-4+1,$y-4+2,0x000000FF) 
    drawpix($dc,$x-4+1,$y-4+6,0x000000FF) 
    drawpix($dc,$x-4+1,$y-4+7,0x000000FF) 
    drawpix($dc,$x-4+2,$y-4+1,0x000000FF)
    drawpix($dc,$x-4+2,$y-4+7,0x000000FF) 
    drawpix($dc,$x-4+3,$y-4+3,0x000000FF) 
    drawpix($dc,$x-4+3,$y-4+5,0x000000FF) 
    drawpix($dc,$x-4+4,$y-4+4,0x00000000) 
    drawpix($dc,$x-4+5,$y-4+3,0x000000FF) 
    drawpix($dc,$x-4+5,$y-4+5,0x000000FF) 
    drawpix($dc,$x-4+6,$y-4+1,0x000000FF) 
    drawpix($dc,$x-4+6,$y-4+7,0x000000FF) 
    drawpix($dc,$x-4+7,$y-4+1,0x000000FF) 
    drawpix($dc,$x-4+7,$y-4+2,0x000000FF) 
    drawpix($dc,$x-4+7,$y-4+6,0x000000FF) 
    drawpix($dc,$x-4+7,$y-4+7,0x000000FF) 
    DllCall ("user32.dll", "int", "ReleaseDC", "hwnd", 0,  "int", $dc[0]) 
;DllCall("gdi32.dll", "int", "DeleteDC", "hwnd", $dc)
 EndFunc
Edited by Zinefer
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...