WM_REFLECT_NOTIFY和WM_NOTIFY [英] WM_REFLECT_NOTIFY vs WM_NOTIFY
问题描述
WM_REFLECT_NOTIFY
的文章,而我找不到任何文档.
The documentation for WM_NOTIFY is easy enough to find, however I'm finding a fair amount of sample code and articles that refer to WM_REFLECT_NOTIFY
, for which I can't find any documentation.
什么是WM_REFLECT_NOTIFY
,在哪里可以找到它的文档,并且此消息与WM_NOTIFY
有何不同?
What is WM_REFLECT_NOTIFY
, where can I find the documentation for it and how is this message different from WM_NOTIFY
?
参考示例:
- Flickering in listview with ownerdraw and virtualmode
- ListViewSubItem.Bounds almost works
推荐答案
WM_REFLECT_NOTIFY
被称为值为0x204E
,即0x2000
+ WM_NOTIFY
.消息反射的典型用法是将通知发送回其起源,以使据称子类化的控件可以自行处理通知.
WM_REFLECT_NOTIFY
is referred to as having value of 0x204E
, that is 0x2000
+ WM_NOTIFY
. Typical use of message reflection is to send back notification to its origin so that supposedly subclassed control could handle notification itself.
因此,您可能缺少和需要查找文档的知识是控件以常规方式将WM_NOTIFY
发送到其父级.父级使用消息号0x2000
+原始Msg
将具有相同消息参数的SendMessage
返回给控件.参数wParam
,lParam
的含义应该与原始消息相同(在您的情况下为WM_NOTIFY
).
Hence the knowledge you are possibly missing and looking documentation for is that the control sends WM_NOTIFY
to its parent in a regular way. And the parent does SendMessage
with the same message parameters back to the control using message number 0x2000
+ original Msg
. The meaning of the parameters wParam
, lParam
is supposed to be the same of original message (WM_NOTIFY
in your case).
常量0x2000
可能因框架而异,或者是控件和托管窗口之间的私有协议.
The constant 0x2000
might possibly vary from framework to framework or be otherwise private agreement between controls and hosting windows.
MFC和ActiveX控件反映WM_NOTIFY
消息,使它们成为OCM_NOTIFY
消息,其中(olectl.h):
MFC and ActiveX controls, for instance, reflect WM_NOTIFY
messages making them OCM_NOTIFY
messages, where (olectl.h):
#define OCM_NOTIFY (OCM__BASE + WM_NOTIFY)
#define OCM__BASE (WM_USER+0x1c00)
最后是(winuser.h):
and finally (winuser.h):
#define WM_USER 0x0400
也就是说,OCM_NOTIFY
是0x204E
,就像您的WM_REFLECT_NOTIFY
.有关MSDN文档的信息,请参见:反映的窗口消息ID .
That is, the OCM_NOTIFY
is 0x204E
, just as your WM_REFLECT_NOTIFY
. The MSDN docs on those from here: Reflected Window Message IDs.
这篇关于WM_REFLECT_NOTIFY和WM_NOTIFY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!