Skip to content

Latest commit

 

History

History
103 lines (74 loc) · 6.77 KB

nf-shobjidl_core-ishellfolder-getdisplaynameof.md

File metadata and controls

103 lines (74 loc) · 6.77 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shobjidl_core.IShellFolder.GetDisplayNameOf
IShellFolder::GetDisplayNameOf (shobjidl_core.h)
Retrieves the display name for the specified file object or subfolder.
GetDisplayNameOf
GetDisplayNameOf method [Windows Shell]
GetDisplayNameOf method [Windows Shell]
IShellFolder interface
GetDisplayNameOf method [Windows Shell]
IShellFolder2 interface
IShellFolder interface [Windows Shell]
GetDisplayNameOf method
IShellFolder.GetDisplayNameOf
IShellFolder2 interface [Windows Shell]
GetDisplayNameOf method
IShellFolder2::GetDisplayNameOf
IShellFolder::GetDisplayNameOf
_win32_IShellFolder_GetDisplayNameOf
shell.IShellFolder_GetDisplayNameOf
shobjidl_core/IShellFolder2::GetDisplayNameOf
shobjidl_core/IShellFolder::GetDisplayNameOf
shell\IShellFolder_GetDisplayNameOf.htm
shell
2164bbe6-e030-4a64-85db-9ee1cd3c136d
12/05/2018
GetDisplayNameOf, GetDisplayNameOf method [Windows Shell], GetDisplayNameOf method [Windows Shell],IShellFolder interface, GetDisplayNameOf method [Windows Shell],IShellFolder2 interface, IShellFolder interface [Windows Shell],GetDisplayNameOf method, IShellFolder.GetDisplayNameOf, IShellFolder2 interface [Windows Shell],GetDisplayNameOf method, IShellFolder2::GetDisplayNameOf, IShellFolder::GetDisplayNameOf, _win32_IShellFolder_GetDisplayNameOf, shell.IShellFolder_GetDisplayNameOf, shobjidl_core/IShellFolder2::GetDisplayNameOf, shobjidl_core/IShellFolder::GetDisplayNameOf
shobjidl_core.h
Shobjidl.h
Windows
Windows XP [desktop apps only]
Windows 2000 Server [desktop apps only]
Shobjidl.idl
Shell32.dll (version 4.0 or later)
Windows
19H1
IShellFolder::GetDisplayNameOf
shobjidl_core/IShellFolder::GetDisplayNameOf
c++
APIRef
kbSyntax
COM
Shell32.dll
IShellFolder.GetDisplayNameOf
IShellFolder2.GetDisplayNameOf

IShellFolder::GetDisplayNameOf

-description

Retrieves the display name for the specified file object or subfolder.

-parameters

-param pidl [in]

Type: PCUITEMID_CHILD

PIDL that uniquely identifies the file object or subfolder relative to the parent folder.

-param uFlags [in]

Type: SHGDNF

Flags used to request the type of display name to return. For a list of possible values, see the SHGDNF enumerated type.

-param pName [out]

Type: STRRET*

When this method returns, contains a pointer to a STRRET structure in which to return the display name. The type of name returned in this structure can be the requested type, but the Shell folder might return a different type.

-returns

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

-remarks

It is the caller's responsibility to free resources allocated by this function.

Normally, pidl can refer only to items contained by the parent folder. The PIDL must be single-level and contain exactly one SHITEMID structure followed by a terminating zero. If you want to retrieve the display name of an item that is deeper than one level away from the parent folder, use SHBindToParent to bind with the item's immediate parent folder and then pass the item's single-level PIDL to IShellFolder::GetDisplayNameOf.

Also, if the SHGDN_FORPARSING flag is set in uFlags and the SHGDN_INFOLDER flag is not set, pidl can refer to an object at any level below the parent folder in the namespace hierarchy. At one time, pidl could be a multilevel PIDL, relative to the parent folder, and could contain multiple SHITEMID structures. However, this is no longer supported and pidl should now refer only to a single child item.

The simplest way to retrieve the display name from the structure pointed to by pName is to pass it to either StrRetToBuf or StrRetToStr. These functions take a STRRET structure and return the name. You can also examine the structure's uType member, and retrieve the name from the appropriate member.

The flags specified in uFlags are hints about the intended use of the name. They do not guarantee that IShellFolder will return the requested form of the name. If that form is not available, a different one might be returned. In particular, there is no guarantee that the name returned by the SHGDN_FORPARSING flag will be successfully parsed by IShellFolder::ParseDisplayName. There are also some combinations of flags that might cause the GetDisplayNameOf/ParseDisplayName round trip to not return the original identifier list. This occurrence is exceptional, but you should check to be sure.

Note  The parsing name that is returned when uFlags has the SHGDN_FORPARSING flag set is not necessarily a normal text string. Virtual folders such as My Computer might return a string containing the folder object's GUID in the form "::{GUID}". Developers who implement IShellFolder::GetDisplayNameOf are encouraged to return parse names that are as close to the display names as possible, because the end user often needs to type or edit these names.
 

-see-also

IShellFolder

IShellFolder2