SFGAO
Applies to: desktop apps only
Attributes that can be retrieved on an item (file or folder) or set of items.
| Constant/value | Description |
|---|---|
|
The specified items can be copied. |
|
The specified items can be moved. |
|
Shortcuts can be created for the specified items. This attribute has the same value as DROPEFFECT_LINK. If a namespace extension returns this attribute, a Create Shortcut entry with a default handler is added to the shortcut menu that is displayed during drag-and-drop operations. The extension can also implement its own handler for the link verb in place of the default. If the extension does so, it is responsible for creating the shortcut. A Create Shortcut item is also added to the Windows Explorer File menu and to normal shortcut menus. If the item is selected, your application's IContextMenu::InvokeCommand method is invoked with the lpVerb member of the CMINVOKECOMMANDINFO structure set to link. Your application is responsible for creating the link. |
|
The specified items can be bound to an IStorage object through IShellFolder::BindToObject. For more information about namespace manipulation capabilities, see IStorage. |
|
The specified items can be renamed. Note that this value is essentially a suggestion; not all namespace clients allow items to be renamed. However, those that do must have this attribute set. |
|
The specified items can be deleted. |
|
The specified items have property sheets. |
|
The specified items are drop targets. |
|
This flag is a mask for the capability attributes: SFGAO_CANCOPY, SFGAO_CANMOVE, SFGAO_CANLINK, SFGAO_CANRENAME, SFGAO_CANDELETE, SFGAO_HASPROPSHEET, and SFGAO_DROPTARGET. Callers normally do not use this value. |
|
Windows 7 and later. The specified items are system items. |
|
The specified items are encrypted and might require special presentation. |
|
Accessing the item (through IStream or other storage interfaces) is expected to be a slow operation. Applications should avoid accessing items flagged with SFGAO_ISSLOW. Note Opening a stream for an item is generally a slow operation at all times. SFGAO_ISSLOW indicates that it is expected to be especially slow, for example in the case of slow network connections or offline (FILE_ATTRIBUTE_OFFLINE) files. However, querying SFGAO_ISSLOW is itself a slow operation. Applications should query SFGAO_ISSLOW only on a background thread. An alternate method, such as retrieving the PKEY_FileAttributes property and testing for FILE_ATTRIBUTE_OFFLINE, could be used in place of a method call that involves SFGAO_ISSLOW. |
|
The specified items are shown as dimmed and unavailable to the user. |
|
The specified items are shortcuts. |
|
The specified objects are shared. |
|
The specified items are read-only. In the case of folders, this means that new items cannot be created in those folders. This should not be confused with the behavior specified by the FILE_ATTRIBUTE_READONLY flag retrieved by IColumnProvider::GetItemData in a SHCOLUMNDATA structure. FILE_ATTRIBUTE_READONLY has no meaning for Win32 file system folders. |
|
The item is hidden and should not be displayed unless the Show hidden files and folders option is enabled in Folder Settings. |
|
Do not use. |
|
The items are nonenumerated items and should be hidden. They are not returned through an enumerator such as that created by the IShellFolder::EnumObjects method. |
|
The items contain new content, as defined by the particular application. |
|
Not supported. |
|
Not supported. |
|
Indicates that the item has a stream associated with it. That stream can be accessed through a call to IShellFolder::BindToObject or IShellItem::BindToHandler with IID_IStream in the riid parameter. |
|
Children of this item are accessible through IStream or IStorage. Those children are flagged with SFGAO_STORAGE or SFGAO_STREAM. |
|
When specified as input, SFGAO_VALIDATE instructs the folder to validate that the items contained in a folder or Shell item array exist. If one or more of those items do not exist, IShellFolder::GetAttributesOf and IShellItemArray::GetAttributes return a failure code. This flag is never returned as an [out] value. When used with the file system folder, SFGAO_VALIDATE instructs the folder to discard cached properties retrieved by clients of IShellFolder2::GetDetailsEx that might have accumulated for the specified items. |
|
The specified items are on removable media or are themselves removable devices. |
|
The specified items are compressed. |
|
The specified items can be hosted inside a web browser or Windows Explorer frame. |
|
The specified folders are either file system folders or contain at least one descendant (child, grandchild, or later) that is a file system (SFGAO_FILESYSTEM) folder. |
|
The specified items are folders. Some items can be flagged with both SFGAO_STREAM and SFGAO_FOLDER, such as a compressed file with a .zip file name extension. Some applications might include this flag when testing for items that are both files and containers. |
|
The specified folders or files are part of the file system (that is, they are files, directories, or root directories). The parsed names of the items can be assumed to be valid Win32 file system paths. These paths can be either UNC or drive-letter based. |
|
This flag is a mask for the storage capability attributes: SFGAO_STORAGE, SFGAO_LINK, SFGAO_READONLY, SFGAO_STREAM, SFGAO_STORAGEANCESTOR, SFGAO_FILESYSANCESTOR, SFGAO_FOLDER, and SFGAO_FILESYSTEM. Callers normally do not use this value. |
|
The specified folders have subfolders. The SFGAO_HASSUBFOLDER attribute is only advisory and might be returned by Shell folder implementations even if they do not contain subfolders. Note, however, that the converse—failing to return SFGAO_HASSUBFOLDER—definitively states that the folder objects do not have subfolders. Returning SFGAO_HASSUBFOLDER is recommended whenever a significant amount of time is required to determine whether any subfolders exist. For example, the Shell always returns SFGAO_HASSUBFOLDER when a folder is located on a network drive. |
|
This flag is a mask for content attributes, at present only SFGAO_HASSUBFOLDER. Callers normally do not use this value. |
|
Mask used by the PKEY_SFGAOFlags property to determine attributes that are considered to cause slow calculations or lack context: SFGAO_ISSLOW, SFGAO_READONLY, SFGAO_HASSUBFOLDER, and SFGAO_VALIDATE. Callers normally do not use this value. |
Requirements
|
Minimum supported client | Windows Vista |
|---|---|
|
Minimum supported server | Windows Server 2008 |
|
Header |
|
|
IDL |
|
See also
Send comments about this topic to Microsoft
Build date: 3/7/2012
I add a shell namespace extension on my computer.
i have inserted an menu item by implement IContextMenu. but what can i do to delete the default "Create Shortcut"?
- 3/27/2012
- Bill.Qian
A: there is no data source independent way to set attributes. for file system items you can use SetFileAttributes() with the path for the item to control some of these values
- 9/24/2009
- Anil Kumar Sharma
- 3/16/2011
- Chris_Guzak
For the file system data source querying this attribute is itself a slow operation so
it should be avoided, consider querying for and testing PKEY_FileAttributes
instead as this reports FILE_ATTRIBUTE_XXX values that correspond to some
meaningful cases that application might want to consider, for example FILE_ATTRIBUTE_OFFLINE
- 1/5/2011
- Chris_Guzak
- 10/30/2007
- Alexander Stoyan
- 10/22/2009
- Stanley Roark
generally the performance of this function should be fast, not requiring access to the data store (IO).
there are some exceptions, see the values in SFGAO_PKEYSFGAOMASK
SFGAO_HASSUBFOLDERS - this may require accessing the store
SFGAO_VALIDATE - this is designed to test to see if the item exists, that requries accessing the store and thus may be slow.
SFGAO_ISSLOW – avoid the use of this as this is itself slow (irony here)
SFGAO_READONLY – some data sources require IO to probe to see if the item is writeable
- 5/20/2009
- Chris_Guzak