使用: UINT nFlags; HTREEITEM hItem=GetTreeCtrl().HitTest(posMousePoint, &nFlags); 的时候,注意把nFlags赋予下面你需要的值,那么,就能获得你点击发生时, 你所需要的ITEM。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.
是不是按照1、2、3、4...的顺序来对应控件中的排列顺序?
GetCursorPos(&posMouse);
ScreenToClient(&posMouse); UINT nFlags;
HTREEITEM hItem=GetTreeCtrl().HitTest(posMousePoint, &nFlags);
你们到是可以成立一个csdn考拉大联盟^^
UINT nFlags;
HTREEITEM hItem=GetTreeCtrl().HitTest(posMousePoint, &nFlags);
的时候,注意把nFlags赋予下面你需要的值,那么,就能获得你点击发生时,
你所需要的ITEM。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.
截面上有TREE BOX和LIST BOX两个控件
实现的目的是点击一下TREE BOX中的叶子选项
在LIST BOX中出现相应的列表项
双击LIST BOX中的表项则弹出一个DIALOG
-----------------------------------------
谢谢