+ -
当前位置:首页 → 问答吧 → 有关NMHDR结构的转换问题,请高手详解

有关NMHDR结构的转换问题,请高手详解

时间:2011-11-25

来源:互联网

ON_NOTIFY消息里有很多NMHDR结构的消息参数,但在实际运用过程中都需要强制转换成其它结构体,问题就是要转换成哪些可用的结构体,有没有这方面的资料总结呢?
在网上找了很多有关这个结构解析的资料,但看他们的举例,都换成了不同的结构体,来响应不同的事件。但我就查不到,不知道用哪个结构体好。请各位指点一下,谢谢!

作者: lrypower   发布时间: 2011-11-25

http://blog.csdn.net/wzyzb/article/details/3974360

作者: chunyou128   发布时间: 2011-11-25

MSDN吧,最全~

作者: VisualEleven   发布时间: 2011-11-25

MSDN上面也没有啊,我查了好几遍,都没有说清楚呀
引用 2 楼 visualeleven 的回复:

MSDN吧,最全~

作者: lrypower   发布时间: 2011-11-25

这个网上也没有说明怎样去获知用哪个消息结构体,如果要查,因该查什么呀?
引用 1 楼 chunyou128 的回复:

http://blog.csdn.net/wzyzb/article/details/3974360

作者: lrypower   发布时间: 2011-11-25

NMHDR各成员表示的内容随不同对象(控件)而不同
最全的资料当然是msdn,有问题直接查msdn
vs6的msdn获取可以从以下路径获取NMHD在各个控件中的含义
[平台SDK]->[USER Interface services]->[shell and common controls]->
[common controls] 
比如要查tree view control's NM_CLICK:
再选择[tree view controls]->tree view notification message]->NM_CLICK
即可看到 针对 NMHDR 结构的详细说明,其他msdn查找方法也类似。

作者: gameslq   发布时间: 2011-11-25

我用2008的MSDN,想查NM_DBLCLK(tree view)如下:接下来就没有了,也不知道有哪些结构体可以让我看,NMHDR是通用结构体,接下来要转成什么我就不知道了
NM_DBLCLK (tree view) Notification

--------------------------------------------------------------------------------

Notifies the parent window of a tree-view control that the user has double-clicked the left mouse button within the control. This notification is sent in the form of a WM_NOTIFY message.

Syntax

LPNMHDR lpnmh = (LPNMHDR) lParam;
Parameters

lpnmh
Pointer to an NMHDR structure that contains additional information about this notification message.
Return Value

Return nonzero to prevent the default processing, or zero to allow the default processing.

Notification Requirements

Minimum DLL Version None 
Header commctrl.h 
Minimum operating systems Windows NT 3.51, Windows 95 


引用 5 楼 gameslq 的回复:

NMHDR各成员表示的内容随不同对象(控件)而不同
最全的资料当然是msdn,有问题直接查msdn
vs6的msdn获取可以从以下路径获取NMHD在各个控件中的含义
[平台SDK]->[USER Interface services]->[shell and common controls]->
[common controls]
比如要查tree view control's N……

作者: lrypower   发布时间: 2011-11-25

NMHDR成员随着控件的不同而不同,这一点有点像消息中的lParam和wParam,所以你只能在MSDN中去看你要操作的具体控件才知道。

作者: wltg2001   发布时间: 2011-11-25