SEC_TREECLASS::HitTest
Determines the location of the specified point relative to the client area of a tree view control.
Defined in: trcore.inl
Syntax
HitTest( CPoint pt, UINT* pFlags )
HitTest(TV_HITTESTINFO* pHitInfo)
Return Value
The handle of the tree view item that occupies the specified point or NULL if no item occupies the point.
Parameters
pt
Client coordinates of the point to test.
pHitInfo
Address of a TV_HITTESTINFO structure that contains the position to hit test and that receives information about the results of the hit test.
Comments
Call this function to determine the location of the specified point relative to the client area of a tree view control. When this function is called, the pt parameter specifies the coordinates of the point to test. The function returns the handle of the item at the specified point or NULL if no item occupies the point. In addition, the pFlags parameter contains a value that indicates the location of the specified point and can be one of the following:
TVHT_ABOVEAbove the client area.
TVHT_BELOWBelow the client area.
TVHT_NOWHEREIn the client area but below the last item.
TVHT_ONITEMOn the bitmap or label associated with an item.
TVHT_ONITEMBUTTONOn the button associated with an item.
TVHT_ONITEMICONOn the bitmap associated with an item.
TVHT_ONITEMINDENTIn the indentation associated with an item.
TVHT_ONITEMLABELOn the label (string) associated with an item.
TVHT_ONITEMRIGHTIn the area to the right of an item.
TVHT_ONITEMSTATEICONOn the state icon for a tree view item that is in a user-defined state.
TVHT_TOLEFTTo the right of the client area.
TVHT_TORIGHTTo the left of the client area.
TVHT_COLUMNSEPOn a column separator.
TVHT_COLUMNHEADINGOn a column header.
TVHT_INSIDEITEMBOUNDSWithin the bounding rectangle of the item
pFlags
Pointer to an integer that receives information about the results of the hit test. It can be one or more of the values listed under the flags member in the Remarks section.