Jump to content

Drawing on screen


Recommended Posts

Hello, i've found this code and i thought if it would be possible to use it somwhere not on desktop only?

#include <ButtonConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <GUIConstants.au3>
#include <GDIplus.au3>
SRandom(@AutoItPID)
WinMinimizeAll ()
HotKeySet("{ESC}", "exit")
Dim $x, $y, $Color, $Width
While "Drawing Pixel"
$pixel2 = PixelSearch(0,0,1000,768, 0x000000)  
   If IsArray($pixel2) = True Then
   $Width = 5
    $x =$pixel2[0]   
    $y = $pixel2[1]
    $Color = 0xFFA9EC
    drawapixel()    
   EndIf  
WEnd
Func drawapixel()
    $hnd = DllCall("user32.dll", "int", "GetDC", "hwnd", 0)
    $Pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $Width, "int", $Color)
    DllCall("gdi32.dll", "int", "SelectObject", "int", $hnd[0], "int", $Pen[0])
    DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hnd[0], "int", $x, "int", $y, "int", 0)
    DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hnd[0], "int", $x, "int", $y)
    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "int", $hnd[0])
EndFunc  
Func exit()
    WinMinimizeAllUndo ( )
    Exit
EndFunc
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...