getDisplayNameOf method
Retrieves the display name for the specified file object or subfolder.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellfolder-getdisplaynameof.
Implementation
Pointer<STRRET> getDisplayNameOf(Pointer<ITEMIDLIST> pidl, SHGDNF uFlags) {
final pName = adaptiveCalloc<STRRET>();
final hr$ = HRESULT(_GetDisplayNameOfFn(ptr, pidl, uFlags, pName));
if (hr$.isError) {
free(pName);
throw WindowsException(hr$);
}
return pName;
}