CTreeCtrl::HitTest
HTREEITEM HitTest(
CPoint pt,
UINT* pFlags = NULL
) const;
HTREEITEM HitTest(
TVHITTESTINFO* pHitTestInfo
) const;
CTreeCtrl::GetCheck
BOOL GetCheck(
HTREEITEM hItem
) const;
CTreeCtrl::SetCheck
BOOL SetCheck(
HTREEITEM hItem,
BOOL fCheck = TRUE
);
CTreeCtrl::ItemHasChildren
BOOL ItemHasChildren(
HTREEITEM hItem
) const;
CTreeCtrl::GetChildItem
HTREEITEM GetChildItem(
HTREEITEM hItem
) const;
CTreeCtrl::GetParentItem
HTREEITEM GetParentItem(
HTREEITEM hItem
) const;
CTreeCtrl::GetNextItem
HTREEITEM GetNextItem(
HTREEITEM hItem,
UINT nCode
) const;
TVGN_CARET Retrieves the currently selected item.
TVGN_CHILD Retrieves the first child item of the item specified by the hItem parameter.
TVGN_DROPHILITE Retrieves the item that is the target of a drag-and-drop operation.
TVGN_FIRSTVISIBLE Retrieves the first visible item.
TVGN_LASTVISIBLE Retrieves the last expanded item in the tree. This does not retrieve the last item visible in the tree-view window.
TVGN_NEXT Retrieves the next sibling item.
TVGN_NEXTVISIBLE Retrieves the next visible item that follows the specified item.
TVGN_PARENT Retrieves the parent of the specified item.
TVGN_PREVIOUS Retrieves the previous sibling item.
TVGN_PREVIOUSVISIBLE Retrieves the first visible item that precedes the specified item.
TVGN_ROOT Retrieves the first child item of the root item of which the specified item is a part.
CWnd::CreateEx
virtual BOOL CreateEx(
DWORD dwExStyle, //WS_EX_CLIENTEDGE Specifies that a window has a 3D look — that is, a border with a sunken edge.
LPCTSTR lpszClassName,
LPCTSTR lpszWindowName,
DWORD dwStyle, //这里是建立Ctreectrl应用Tree-View Control Window Styles,见msdn
const RECT& rect,
CWnd* pParentWnd,
UINT nID,
LPVOID lpParam = NULL
);
DWORD dwStyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP |
TVS_HASBUTTONS | TVS_SHOWSELALWAYS | TVS_LINESATROOT | TVS_CHECKBOXES;
dwStyle |= ( m_bUseFriendryTree ? TVS_SINGLEEXPAND | TVS_TRACKSELECT : TVS_HASLINES );
CTreeCtrl::SetImageList
CImageList* SetImageList(
CImageList * pImageList,
int nImageListType
);
TVSIL_NORMAL Sets the normal image list, which contains the selected and nonselected images for the tree view item.
TVSIL_STATE Sets the state image list, which contains the images for tree view items that are in a user-defined state.
CTreeCtrl::GetImageList
CImageList* GetImageList(
UINT nImageList
) const;
BOOL SetItemState(
HTREEITEM hItem,
UINT nState,
UINT nStateMask //Specifies which states are to be changed.
);
CTreeCtrl::SetItemState
const ShellItem* pShellItem = reinterpret_cast< ShellItem* >( GetItemData( m_hLastSelectedTreeItem ) );