共用方式為


CMFCShellTreeCtrl::GetItemPath

Retrieves the path of an item in the CMFCShellTreeCtrl Class object.

BOOL GetItemPath(
   CString& strPath,
   HTREEITEM htreeItem = NULL
) const;

Parameters

  • [out] strPath
    A reference to a string parameter. The method writes the path of the item to this parameter.

  • [in] htreeItem
    The method retrieves the path for this tree control item.

Return Value

Nonzero if successful; 0 otherwise.

Remarks

If this method fails, strPath contains the empty string.

If you do not specify hTreeItem, this method tries to obtain the string for the currently selected item. If no item is selected and hTreeItem is NULL, this method fails.

Requirements

Header: afxshelltreectrl.h

See Also

Reference

CMFCShellTreeCtrl Class

Hierarchy Chart