friendfox Posted December 31, 2010 Posted December 31, 2010 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
JohnOne Posted December 31, 2010 Posted December 31, 2010 Its customary to post the code you have tried, it saves people who are likely to help you covering the same ground, and may be able just to see what you are doing wrong. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
friendfox Posted January 1, 2011 Author Posted January 1, 2011 $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
somdcomputerguy Posted January 1, 2011 Posted January 1, 2011 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.
friendfox Posted January 1, 2011 Author Posted January 1, 2011 I think you're calling WinGetHandle incorrectly. You're not specifying which window to get a handle from..Not this reason, thank you.
friendfox Posted January 1, 2011 Author Posted January 1, 2011 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
JohnOne Posted January 1, 2011 Posted January 1, 2011 Can you confirm that this "$winhand= WinGetHandle('')" causes the function to use the full desktop as its source. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
friendfox Posted January 1, 2011 Author Posted January 1, 2011 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
JohnOne Posted January 1, 2011 Posted January 1, 2011 To get the window handle like that you will need to employ WinTitleMatchMode option <- helpfile. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
somdcomputerguy Posted January 1, 2011 Posted January 1, 2011 (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 January 1, 2011 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
friendfox Posted January 2, 2011 Author Posted January 2, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now