首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

WM_NOTIFY用错了,该如何解决

2013-01-19 
WM_NOTIFY用错了WM_NOTIFY message9 out of 14 rated this helpful - Rate this topicSent by a common co

WM_NOTIFY用错了


WM_NOTIFY message

9 out of 14 rated this helpful - Rate this topic
Sent by a common control to its parent window when an event has occurred or the control requires some information.
Parameters
wParam
The identifier of the common control sending the message. This identifier is not guaranteed to be unique. An application should use the hwndFrom or idFrom member of the NMHDR structure (passed as the lParam parameter) to identify the control.
lParam
A pointer to an NMHDR structure that contains the notification code and additional information. For some notification messages, this parameter points to a larger structure that has the NMHDR structure as its first member.


提到不要直接使用wParam,而应该使用lParam.  

我的用法就是错误的

case WM_NOTIFY:
if(wparam==IDC_LISTVIEW)//我是用了wparam
{
OnListViewColumnClick(hListView,(NMHDR*)lparam);//自定义函数

return 0;

}
break;

[解决办法]
消息:
LVM_SORTITEMS

LVM_SORTITEMSEX

宏:
ListView_SortItems

ListView_SortItemsEx

热点排行