Jump to content
Sign in to follow this  

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>
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
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])
Func exit()
    WinMinimizeAllUndo ( )

Share this post

Link to post
Share on other sites

lookin interesting, Although, "exit is not a valid function name, i'd suggest switching it to end to avoid compiler confusion.

as far as your origional question, i have no idea, can wait to see how this turns out.

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