如何使用C / C ++访问tdbgrid(delphi VCL控件) [英] How to use C/C++ access the tdbgrid (delphi VCL controls)

查看:76
本文介绍了如何使用C / C ++访问tdbgrid(delphi VCL控件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个目标程序由delphi / pascal编写,该应用程序有一个VCL控件TDBGrid,这个控件视图非常类似于win32标准列表框。



I我正在尝试编写一些代码来访问TDBGrid控件中的信息。包括列信息,行项。使用c / c ++。



我尝试过:



我使用Enumwindows / EnumChildWindows查找应用程序和TDBGrid控件。我不知道如何访问TDBGrid控件信息(列信息和行项)

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)

推荐答案

通过枚举窗口,你得到控件的HWND 。此 HWND 可用于向窗口发送消息。



如果您能够检索所需的信息取决于TDBGrid控件的实现方式。如果它在内部使用私有(用户定义的)消息代码并且您知道这些和参数的结构,您可以使用它们来获取信息。



但是如果控件使用函数而不是Windows消息,你将无法获取信息。



如果你有控件的源代码,你应该能够检查这个。它也可能是文档的一部分。
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.


这篇关于如何使用C / C ++访问tdbgrid(delphi VCL控件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆