Jump to content

PixelSearch


Recommended Posts

Get the position and size of the window you want to search using WinGetPos, using the values returned from this you can figure out where to search.

ShellExecute(@WindowsDir & "\Notepad.exe")
WinWait("Untitled - Notepad")
WinActivate("Untitled - Notepad")

$PositionAndSize = WinGetPos("Untitled - Notepad")
If IsArray($PositionAndSize) Then
    $Result = PixelSearch($PositionAndSize[0], $PositionAndSize[1], $PositionAndSize[0] + $PositionAndSize[2], $PositionAndSize[1] + $PositionAndSize[3], 0x5A5E59)
EndIf

If IsArray($Result) Then MouseMove($Result[0], $Result[1])

#cs
    [0] = X
    [1] = Y
    [2] = Width
    [3] = Height
#CE
Link to comment
Share on other sites

Thanks guys, I think both ways would work, using handle or getting the position, ill just figure out what is easier though I haven't worked with handle's of windows so Ill figure out something. This will at least get me started. Maybe someone could give me and example handle?

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...