tags:

views:

83

answers:

1

I am writing an application that needs to read a data field on another Delphi program and I do not have access to the source code of the 3rd party program. The data field contains the "foreign key" to a record I need to retrieve or create in my application.

I would appreciate any links to knowledge or components that will help me with my program.

+3  A: 

I'm assuming that you are trying to "screen scrape" a text field from another app. You can use FindWindow to get a handle that that window, then dig through the child windows to find the control that you're looking for (WinDowse by Greatis will be very helpful here for exploring manually). Finally, send a WM_GetText message to the control that has the data. Here is an example of how to do this: About.Com article on digging and scraping with Internet Explorer.

Edit: D'oh! WM_GetText is already wrapped in the VCL with the GetWindowText function defined in windows.pas. ex:

GetWindowText(Wnd, PC, sizeof(PC));
Chris Thornton
Unfortunately this will only work if the control in question has a windows handle. Use something like WinSpy++ (http://www.catch22.net/software/winspy) to investigate if the control has a handle or not, and if so what the properties of the control are.
skamradt
Without a handle, I suppose you're left with OCR'ing.
Chris Thornton
The link to Greatis.com is broken or the site is down(?)
Link is working here.
Chris Thornton
Where is "here"? I followed the link to your site did not see a link. Retried the link in you answer and it does not work.
www.greatis.com/windowse.htmor google: greatis windowseI see it when I go there, I swear....
Chris Thornton
I tried on 2 different computers. I tried from a 3rd computer and it worked! That's weird. Thanks for the link. Just what I'm looking for! I appreciate you taking time to answer my question.