CListCtrl的LVN_ITEMCHANGED消息如何判断是选中Item触发的还是取消选中Item触发的

ranqd 2006-03-18 03:58:34
由选中A改为选中B的时候LVN_ITEMCHANGED消息被触发了3次,1是A的文字背景消失触发,2是A取消选中触发,3是B被选中触发,我如何在响应LVN_ITEMCHANGED消息的函数中判断是哪种情况触发的呢?
...全文
837 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
striking 2006-03-18
  • 打赏
  • 举报
回复
LRESULT CLeftView::OnItemChanged(NMLISTVIEW* pnmlv)
{
if ((pnmlv->uChanged & LVIF_STATE) &&
(pnmlv->uNewState & LVIS_SELECTED)) {
m_pFormView->SetForm(pnmlv->iItem);
}
return 0;
}
uNewState
Specifies the new item state. This member is zero for notification messages that do not use it.
uOldState
Specifies the old item state. This member is zero for notification messages that do not use it.
uChanged
Set of flags that indicate the item attributes that have changed. This member is zero for notification messages that do not use it. Otherwise, it can have the same values as the mask member of the LVITEM structure.

以上代码是例子

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧