msdn上没找到很详细地描述
我再用的时候发现单击一个与treeitem的右侧(垂直高度相同,水平靠右,单击点确实在treeitem之外)时,可以得到这个treeitem,但是nFlags返回的数是32;与我直接点那个treeitem返回的是2or4不同,是什么原因呢?

解决方案 »

  1.   

    判断用的。看看你的当前的鼠标在什么地方! 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.  #define TVHT_ONITEMRIGHT        0x0020   // 0X20 就是 32 了,你不在ITEM 的 右方点的鼠标吗?#define TVHT_ONITEMICON         0x0002   // 
    #define TVHT_ONITEMLABEL        0x0004   //   2 OR 4 当然是如他们自己的定义的含义了!还有什么不明白?  :) 
      

  2.   

    see了,再问一个问题,3x
    这些宏是在那里定义的?
      

  3.   

    //好人做到底……  :)C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\Include\COMMCTRL.H(4064):#define TVHT_ONITEMRIGHT       0x0020///BTW:自己搜索就可以了。