使用SendMessage API从Delphi TcxGrid检索信息的常量消息 [英] Constant messages to retrieve information from a Delphi TcxGrid by using SendMessage API
问题描述
我正在尝试使用AutoIt在Delphi开发的应用程序中操纵TcxGrid.
AutoIt有很多自定义库,但是它们中的任何一个都与TcxGrid有关,因为该对象不是标准的Windows对象.我可以使用任何其他IDE或编程语言(C#,C ++,甚至是Delphi),但我会遇到同样的问题:如何从此控件中检索信息?
基本上是为了与我们使用的其他进程进行通讯:
I'm trying to manipulating a TcxGrid in an application developed in Delphi using AutoIt.
AutoIt have a lot of custom libraries but any of them related with TcxGrid because this object is not a standard Windows object. I could use any other IDE or programming language (C#, C++, even Delphi) but I'll be stuck at the same problem: How to retrieve information from this control?
Basicaly to comunicate with other processes we use:
LRESULT SendMessage(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam)
但是真正的问题是如何知道Delphi对象中使用的常量消息.
有人知道在哪里可以找到用于与TcxGrid对象进行通信的常量吗?我已经考虑过创建一个循环并增加消息值并逐个测试它,但这将花费很长的时间.
其他相关搜索:
Windows文档的SendMessage:
https://docs.microsoft.com/zh-cn/windows/win32/api/winuser/nf-winuser-sendmessage
ComboBox的Windows文档(仅作为示例):
https://docs.microsoft.com/en-us/windows/win32/controls/bumper-combobox-control-reference-messages
类似的疑问1:
从Delphi应用程序访问TcxGrid控件c#使用WinAPI
类似的疑问2:
使用SendMessage API检索ComboBox计数和项目
But the real problem is how to know the constant messages used in Delphi objects.
Anybody have any idea where to find the constants used to communicate with a TcxGrid object? I already considered creating a loop and increasing the message value and testing it one by one, but this will take a loooong time.
Other related searches:
Windows documentation for SendMessage:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage
Windows documentation for a ComboBox (just as example):
https://docs.microsoft.com/en-us/windows/win32/controls/bumper-combobox-control-reference-messages
Similar doubt 1:
Accessing TcxGrid controls from a Delphi application from c# using WinAPI
Similar doubt 2:
Retrieve a ComboBox counts and items by using SendMessage API
推荐答案
-
仅对源代码的访问将显示所用消息的完整列表.任何旧版本也将是一个很好的解决方案.
Only access to source codes will show a complete list of messages used. Any old versions would be a good solution too.
所有Delphi TWinControl
后代组件均支持标准Windows消息,例如 WM _ *
(例如, WM_CHAR
, WM_LBUTTONUP
等).Delphi还使用特殊的 CM _ *
消息.消息列表在Delphi源代码中可用.主要模块是 Winapi.Messages
和 Vcl.Controls
.
All Delphi TWinControl
descendant components support standard Windows messages such as WM_*
(eg, WM_CHAR
, WM_LBUTTONUP
etc). Delphi also uses special CM_*
messages. The list of messages is available in the Delphi source. The main modules are Winapi.Messages
and Vcl.Controls
.
第三方开发者很少添加他们的消息.使用Delphi语言进行数据交换通常不需要这样做.
Third-party developers rarely add their messages. This is usually not required for data exchange within the Delphi language.
- 最困难的方法是在工作时跟踪窗口发送的所有消息.将
SetWindowsHookEx
函数与参数WH_GETMESSAGE
,WH_CALLWNDPROC
一起使用.请注意LPARAM
和WPARAM
的值.它们还包含重要信息.
- The hard way is to track all the messages sent by the window when working. Use the
SetWindowsHookEx
function with parametersWH_GETMESSAGE
,WH_CALLWNDPROC
. Be mindful of theLPARAM
andWPARAM
values. They also contain important information.
添加:网格通常使用内置组件( EDIT
, COMBOBOX
等)输入信息.当它们可见时,您也可以向他们发送消息.
Addition: Grids usually use built-in components (EDIT
, COMBOBOX
etc) to enter information. When they are visible you can also send messages to them.
这篇关于使用SendMessage API从Delphi TcxGrid检索信息的常量消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!