Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There is a target program written by delphi/pascal, the application has a VCL control TDBGrid, this control view is very simliar to win32 standard listbox.

I'm trying to write some code to access the info from the TDBGrid control. including the column information , the row items. using c/c++.

What I have tried:

I use the Enumwindows/EnumChildWindows to find the application and the TDBGrid control. I don't know how to access the TDBGrid control info ( the column info and row items)
Posted
Updated 20-Jun-18 21:25pm

1 solution

By enumerating the windows you get the HWND of the control. This HWND can be used to send messages to the window.

If you would be able to retrieve the required information depends on how the TDBGrid control is implemeted. If it uses private (user defined) message codes internally and you know these and the structure of the parameters, you can use them to get the information.

But if the control uses functions instead of Windows messages, you will not be able to get the information.

If you have the source code of the control, you should be able to check this. It might be also part of the documentation.
 
Share this answer
 
Comments
Yount_0701 21-Jun-18 3:52am    
I understand what you said here.Standard win32 application depends on Windows message loop.The windows platform is driven by windows message.I use the spy++ to follow the normal operation on this TDBGrid control,the messages are not standard WM_ messages , all belong to self-defined messages.
retrive the information of the control means to review the implement source code(by pascal),not a choice
is there any other way ?
Jochen Arndt 21-Jun-18 4:20am    
If you don't have the source but know that messages are used you can write a control application and use Spy++ to catch the messages. Then you should be able to decode the message codes and hopefully also the the meanings of the lParam and wParam.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900