CTreeCtrl 双击 如何判断 当前双击的位置 是不是 ’+ ‘ 或者 '-'

phoenixbing 2013-08-23 10:13:57
CTreeCtrl 双击 如何判断 当前双击的位置 是不是 ’+ ‘ 或者 '-'
...全文
42 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eleven 2013-08-23
  • 打赏
  • 举报
回复
flags Variable that receives information about the results of a hit test. This member can be one or more of the following values: TVHT_ABOVE Above the client area. TVHT_BELOW Below the client area. TVHT_NOWHERE In the client area, but below the last item. TVHT_ONITEM On the bitmap or label associated with an item. TVHT_ONITEMBUTTON On the button associated with an item. TVHT_ONITEMICON On the bitmap associated with an item. TVHT_ONITEMINDENT In the indentation associated with an item. TVHT_ONITEMLABEL On the label (string) associated with an item. TVHT_ONITEMRIGHT In the area to the right of an item. TVHT_ONITEMSTATEICON On the state icon for a tree-view item that is in a user-defined state. TVHT_TOLEFT To the left of the client area. TVHT_TORIGHT To the right of the client area.
Eleven 2013-08-23
  • 打赏
  • 举报
回复
NM_DBLCLK通知 CTreeCtrl::HitTest()
fishion 2013-08-23
  • 打赏
  • 举报
回复
可能是响应WM_LBUTTONDOWN消息,调用GetCursorPos得到鼠标坐标,把坐标传入CTreeCtrl 控件的HitTest方法中,然后判断第二值是否为TVHT_ONITEMBUTTON
phoenixbing 2013-08-23
  • 打赏
  • 举报
回复
其实我就是想知道 我当前双击的是哪个节点。 用getSelectedItem 就有一个问题。当客户单击一个节点后这时候焦点在这个节点上。这时候如果双击 + .就会取到上次单击的节点。 但其实客户并没有双击这个节点。 而我需要的逻辑是 只有双击节点时才响应。 现在的效果是双击 + 。就触发了。

15,979

社区成员

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

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