Jump to content

Recommended Posts

Posted

Hey guys,

I saw this code on another thread. I want to make a new thread so it's cleaner.

;----------------------------------------------------------------
;;;;;The very first pixel should be as unique as possible...
;----------------------------------------------------------------
$info = _ImageSearchGetInfo(326,313,339,331)

$xy = _ImageSearch(0,0,640,480,$info)
If Not @error Then MsgBox(4096,"",$xy[0] & "," & $xy[1])

Func _ImageSearchGetInfo($l,$t,$r,$b)
    Dim $array[4]
    $color = PixelGetColor($l, $t)
    $chksum = PixelChecksum($l, $t, $r, $b)
    $array[0] = $r - $l
    $array[1] = $b - $t
    $array[2] = $color
    $array[3] = $chksum
    Return $array
EndFunc

Func _ImageSearch($left,$top,$width,$height,$ISarray)
    $x = $left
    $y = $top
    $boundX = $left + $width
    $boundY = (($top + $height) - $ISarray[1])

    While $x <= $boundX And $y <= $boundY
        $initXY = PixelSearch($x, $y, $boundX, $y, $ISarray[2])
        If Not @error Then
            If $ISarray[3] = PixelChecksum($initXY[0], $initXY[1], $initXY[0] + $ISarray[0], $initXY[1] + $ISarray[1]) Then
                Return $initXY
            Else
                If ($initXY[0] + $ISarray[0]) > $boundX Then
                    $y = $y + 1
                Else
                    $x = $initXY[0] + 1
                EndIf
            EndIf
        Else
            $y = $y + 1
        EndIf
    WEnd
    SetError(1)
EndFunc

Can someone please tell me how I can use this function to capture a msgbox? Or, I saw another thread but couldn't recall where. There was a function wherein we can specify a coordinate and capture the text sitting on the msgbox(no controls or classname on text). Then once we have that text captured, it can be compared against a font, something like this......Can someone please show me how?

Thanks,

Neil

Posted (edited)

Lazycat made a dll once...

<{POST_SNAPBACK}>

Ok, I do see some examples :)

Can it capture the active child dialog window?

Thanks,

Neil

Edited by v1rtu0s1ty
Posted

$aCoordinates = WinGetPos()

<{POST_SNAPBACK}>

Correct me if am wrong, that function will retrieve the current active windows coordinate and pass it to $aCoordinates. If so, is $aCoordinates an array?

Thanks,

Posted

Yep, the exacts are in the help file :)

<{POST_SNAPBACK}>

Hi, can it capture image and save it as a .gif file? GIF files are better when it comes to plain dialogue boxes.

Thanks,

Neil

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
×
×
  • Create New...