检查delphi控件对象而不修改源代码
我有一个由Delphi开发的股票程序,我想要一个可以从股票程序中读取数据的工具,例如Delphi网格对象中的股票价格。
被测试的Stock程序是闭源的,因此没有机会修改QTP/Robot检查器所需的源代码。我无法判断它使用的是哪个 Delphi 版本,该对象都不是标准的 Delphi 控件。
那么任何人都可以知道是否可以通过其他技术检查delphi程序对象数据?
提前致谢。
I have an Stock program which developed by Delphi, I want a tools which can read the data from the stock program, for example, the stock price in Delphi grid object.
The Stock program under test is close source, so no chance modify source code which QTP/Robot inspector required. I cannot tell out which Delphi version it is using, neither the object is a standard delphi control.
So anyone can tell out is it possible to inspect that delphi program object data through other technology ?
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用像Winsight这样的工具来找出程序窗口的结构,并使用FindWindow和EnumerateChildWindows来查找控件。然后您可以使用 GetWindowText api 来获取控件的文本。这适用于大多数控件,但可能不适用于所有控件。例如,TLabel 控件没有句柄,但可以自行绘制。它没有用于获取文本的句柄,并且不会显示在 WinSight 中。您必须对窗口进行 OCR 才能获取这些标签文本。 :p
但是这个“测试”对我来说听起来更像是“黑客”或“控制”,如果你甚至不知道使用了什么类型的控件以及使用哪个版本的 Delphi,为什么你是测试这个程序的人方式?
You can use a tool like Winsight to find out the structure of the program window, and use FindWindow and EnumerateChildWindows to find the controls. Then you can use GetWindowText api to get the text of the control. This will work with most controls, but might not work for all. For instance TLabel control has no handle, but does its drawing itself. It has not handle to get the text from and it won't show up in WinSight. You'll have to OCR the window to get those label texts. :p
But this 'testing' sounds more like 'hacking' or 'controlling' to me, if you don't even know what kind of controls are used and which version of Delphi is used, why are you the one testing this program this way?
尝试从 Delphi 网格控件中读取数据对您来说是行不通的。它不像标准的 Windows 编辑控件,您可以在其上调用 GetWindowText。
如果您确实想从这个现有程序中获取信息,那么您需要查看其内部存储器或在屏幕抓取上进行 OCR。想想都非常可怕。
Trying to read data out of a Delphi grid control is not going to work out for you. It's not like a standard Windows edit control which you could just call GetWindowText on.
If you really want to get the information from this existing program then you'd need to poke at its internal memory or do an OCR on a screen grab. All pretty horrible to contemplate.