[Now Supported on Windows NT]
Retrieves the attributes of one or more file objects or subfolders.
HRESULT GetAttributesOf(
UINT cidl, | // Number of file objects |
LPCITEMIDLIST *apidl, | // Pointer to array of pointers to ITEMIDLIST structures |
ULONG *rgfInOut | // Address of value containing attributes of the file objects |
); |
Parameters
cidl
Number of file objects to get the attributes of.
apidl
Pointer to an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object relative to the parent folder. Each ITEMIDLIST structure must contain exactly one SHITEMID structure followed by a terminating zero.
rgfInOut
Address of a ULONG value that specifies the common (logically AND'ed) attributes of specified file objects.
Return Values
Returns NOERROR if successful or an OLE-defined error value otherwise.
Remarks
The following tables list the attribute flags that may be returned by this method. File object attributes include capability flags, display attributes, contents flags, and miscellaneous attributes.
A file object's capability flags may include zero or more of the following values:
SFGAO_CANCOPY | The specified file objects or folders can be copied (same value as the DROPEFFECT_COPY flag). |
SFGAO_CANDELETE | The specified file objects or folders can be deleted. |
SFGAO_CANLINK | It is possible to create shortcuts for the specified file objects or folders (same value as the DROPEFFECT_LINK flag). |
SFGAO_CANMOVE | The specified file objects or folders can be moved (same value as the DROPEFFECT_MOVE flag). |
SFGAO_CANRENAME | The specified file objects or folders can be renamed. |
SFGAO_CAPABILITYMASK | Mask for the capability flags. |
SFGAO_DROPTARGET | The specified file objects or folders are drop targets. |
SFGAO_HASPROPSHEET | The specified file objects or folders have property sheets. |
A file object's display attributes may include zero or more of the following values:
SFGAO_DISPLAYATTRMASK | Mask for the display attributes. |
SFGAO_GHOSTED | The specified file objects or folders should be displayed using a ghosted icon. |
SFGAO_LINK | The specified file objects are shortcuts. |
SFGAO_READONLY | The specified file objects or folders are read-only. |
SFGAO_SHARE | The specified folders are shared. |
A file object's contents flags may include zero or more of the following values:
SFGAO_CONTENTSMASK | Mask for the contents attributes. |
SFGAO_HASSUBFOLDER | The specified folders have subfolders (and are, therefore, expandable in the left pane of Windows Explorer). |
A file object may have zero or more of the following miscellaneous attributes:
SFGAO_FILESYSTEM | The specified folders or file objects are part of the file system (that is, they are files, directories, or root directories). |
SFGAO_FILESYSANCESTOR | The specified folders contain one or more file system folders. |
SFGAO_FOLDER | The specified items are folders. |
SFGAO_REMOVABLE | The specified file objects or folders are on removable media. |
SFGAO_VALIDATE | Validate cached information. |
Remarks
You can optimize this operation by not returning unspecified flags.
See Also