Jump to content

Getting text from a TPanel?


Recommended Posts

Good morning! (or afternoon)

I've got a TPanel in an existing window which I'm trying to extract data from.

The only way I have found so far is to use use OCR (_TesseractScreenCapture). It captures well, but sadly it causes a black CMD window to flash on the screen. This is quite distracting to the user, who has just opened a new window and is preparing to type in some information.

So my question is:

  • Is there some way to extract the data from the TPanel control? The data/text I'm trying to capture is NOT in the Hidden Text, or Text data of the window.
  • if not, is there some way to HIDE the flash of the black CMD window?

Thank you for any hints or tips!

Link to comment
Share on other sites

...So my question is:

  • if not, is there some way to HIDE the flash of the black CMD window?

Thank you for any hints or tips!

Yes, the black flashing window is caused by the
ShellExecuteWait
call on line 116 of SimpleTesseract.au3. All I needed to do was change
ShellExecuteWait(@ProgramFilesDir & "\tesseract\tesseract.exe", $capture_filename & " " & $ocr_filename)
to
ShellExecuteWait(@ProgramFilesDir & "\tesseract\tesseract.exe", $capture_filename & " " & $ocr_filename,"","",@SW_HIDE)
. This hides the window that ShellExecuteWait creates. It works well.
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...