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