Jump to content

Hooks for DrawText, TextOut & ExtTextOut ?


Recommended Posts

Hi! I'm new here, although I have been coding with AutoIT for the past 6 months. I need help with an idea I have in mind. I am writing an application in AutoIT to capture text from a third-party program that does not use standard Windows controls. So, when I use Au3 Info, none of the text on that program shows up under Visible text nor Hidden text. From what I've gathered so far, I understand that creating hooks to capture text from API functions such as DrawText, ExtTextOut, etc is the best way to go.

My question is this: is it not possible to create hooks within my AutoIT exe in order to capture text from the third-party program, rather than creating a DLL in some other language and then calling it from my AutoIT exe??

I've managed to find a couple of neat examples on how to do this for the TextOut API function but the code is in PowerBASIC. And I havent the foggiest idea as to how I can translate PowerBASIC into AutoIT. If anyone's interested, the PowerBASIC examples can be found here:

http://www.powerbasic.com/support/pbforums...ead.php?t=23093

http://www.powerbasic.com/support/pbforums...ead.php?t=21331

If there's someone here who can shining a guiding light or provide a few AutoIT code snippets, I'd be most grateful. Thanx in advance!!!

Link to comment
Share on other sites

To hook functions in external applications, you need a DLL. Since AutoIt can't be compiled as DLL, this it not possible to install a hook in an external appliaction. You always need a DLL in another language. What you can do in AutoIt is to inject the e.g. powerbasic-DLl into another process and receive messages from it.

//Edit: Here is an example: http://www.autoitscript.com/forum/index.php?showtopic=87240

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

  • 1 year later...

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