Freigeben über


CTreeCtrl::SetInsertMark

This member function implements the behavior of the Win32 message TVM_SETINSERTMARK, as described in the Windows SDK.

BOOL SetInsertMark(
   HTREEITEM hItem,
   BOOL fAfter = TRUE 
);

Parameters

  • hItem
    HTREEITEM that specifies at which item the insertion mark will be placed. If this argument is NULL, the insertion mark is removed.

  • fAfter
    BOOL value that specifies if the insertion mark is placed before or after the specified item. If this argument is nonzero, the insertion mark will be placed after the item. If this argument is zero, the insertion mark will be placed before the item.

Return Value

Nonzero if successful; otherwise 0.

Example

// Set the insert mark to be before the item at the point myPoint.
UINT uFlags;
HTREEITEM hItem = m_TreeCtrl.HitTest(myPoint, &uFlags);

if ((hItem != NULL) && (TVHT_ONITEM & uFlags))
{
   m_TreeCtrl.SetInsertMark(hItem, FALSE);
}

Requirements

Header: afxcmn.h

See Also

Concepts

CTreeCtrl Class

CTreeCtrl Members

Hierarchy Chart