Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi, read data from 3rd party data field

Tags:

hook

delphi

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.

like image 894
Donald Adams Avatar asked Feb 13 '26 18:02

Donald Adams


1 Answers

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));
like image 52
Chris Thornton Avatar answered Feb 17 '26 10:02

Chris Thornton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!