Sign in to follow this  
Followers 0
friendfox

Interception screen text

11 posts in this topic

Aqua is a good tool for interception of screen text, help me to call its functions(TCaptureX.dll) use AutoIt3. Thank you.

I tried for a very long time, but failed.

My English is not good, sorry.

Download Aqua here

Share this post


Link to post
Share on other sites



$dll_file = "TCaptureX.dll"
$Dll      = DllOpen("TCaptureX.dll")
$winhand=  WinGetHandle('')
$string  = DllCall($dll,"str","GetTextFromRect","hwnd", $winhand,"long",0,"long",0,"long",400,"long",400)
MsgBox(0,'info',$string)
DllClose($dll)

"GetTextFromRect" method captures the text from the rectangle specified (left, top,

width, height) in screen coordinates, in the window specified by hwnd.

But the above code, $string returns null

Share this post


Link to post
Share on other sites

I think you're calling WinGetHandle incorrectly. You're not specifying which window to get a handle from..


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

I think you're calling WinGetHandle incorrectly. You're not specifying which window to get a handle from..

Not this reason, thank you.

Share this post


Link to post
Share on other sites

It's also a good idea to search the forum thoroughly before posting.

This post does not solve the problem, the end result of this post the same problem with my

Thank you

Share this post


Link to post
Share on other sites

Can you confirm that this "$winhand= WinGetHandle('')" causes the function to use the full desktop as its source.

HotKeySet("a", "testfunc")

$wTitle = "Notepad"

While 1
   Sleep(10)
wend

func testfunc()
    $ocr = _rectOCR($wTitle,0,0,200,200)
    MsgBox(0,"OCR", $ocr)
EndFunc

Func _rectOCR($wTitle, $rX, $rY, $rWidth, $rHeight)
    $xy = WinGetPos($wTitle)
    $Title = WinGetTitle($wTitle)
    $hwnd = Dec(StringTrimLeft(WinGetHandle($Title), 2))
    $obj = ObjCreate("TCaptureX.TextCaptureX")
    $results = $obj.GetTextFromRect($hwnd, $xy[0]+$rX, $xy[1]+$rY, $rWidth, $rHeight)
    return $results
EndFunc

This code still can not get the right result, I really need help

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Add this line to top of script,

Opt("WinTitleMatchMode",  2)      ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to  -4=Nocase

This helps?

edit: Ya, what he said..

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Add this line to top of script,

Opt("WinTitleMatchMode",  2)      ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to  -4=Nocase

This helps?

edit: Ya, what he said..

Thank you, now you can extract the text in Notepad, but still can not extract the text in IE

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  
Followers 0