Constants

All constants are accessible through the callback.CBFSShell.Constants class.

Drag/Drop Effects

DROP_EFFECT_NONE
Value: 0x00000000
The drop target does not accept the data
DROP_EFFECT_COPY
Value: 0x00000001
The data from the drag source is copied to the drop target.
DROP_EFFECT_MOVE
Value: 0x00000002
The data from the drag source is moved to the drop target.
Value: 0x00000004
The data from the drag source is linked to the drop target.

Drag Data (Content) Formats

DATA_FORMAT_CF_HDROP
Value: "CF_HDROP"
Standard CF_HDROP format (clipboard format Id 15). Elements of the DragData collection with this type contain Unicode file paths.
DATA_FORMAT_CF_BITMAP
Value: "CF_BITMAP"
Standard CF_BITMAP format (clipboard format Id 2).
DATA_FORMAT_CF_TEXT
Value: "CF_TEXT"
Standard CF_TEXT format (clipboard format Id 1).
DATA_FORMAT_CF_UNICODETEXT
Value: "CF_UNICODETEXT"
Standard CF_UNICODETEXT format (clipboard format Id 13).
DATA_FORMAT_CF_RTF
Value: "Rich Text Format"
Text in RTF format
DATA_FORMAT_CFSTR_SHELLIDLIST
Value: "Shell IDList Array"
Array of Windows Shell Id lists. An element of the DragData collection with this type contains a PIDL. If the PIDL can be resolved to a filename, the corresponding field will also be non-empty.
DATA_FORMAT_CFSTR_FILENAMEA
Value: "FileName"
A file name in system-default (8-bit CP_ACP or UTF8) format.
DATA_FORMAT_CFSTR_FILENAMEW
Value: "FileNameW"
A file name in Unicode (UTF16) format
DATA_FORMAT_CFSTR_INETURLA
Value: "UniformResourceLocator"
A URL in system-default (8-bit CP_ACP or UTF8) format.
DATA_FORMAT_CFSTR_INETURLW
Value: "UniformResourceLocatorW"
A URL in Unicode (UTF16) format.
DATA_FORMAT_CFSTR_FILEDESCRIPTORA
Value: "FileGroupDescriptor"
Files with binary data included. Each element of the DragData collection with this type contains a filename with data.
DATA_FORMAT_CFSTR_FILEDESCRIPTORW
Value: "FileGroupDescriptorW"
Files with binary data included. Each element of the DragData collection with this type contains a filename with data.

Drag Operation Types

DRAG_TYPE_ENTER
Value: 0
Cursor entered the folder
DRAG_TYPE_OVER
Value: 1
Cursor is moving over the folder
DRAG_TYPE_LEAVE
Value: 2
Cursor is leaving the folder
DRAG_TYPE_START
Value: 5
A drag operation has been initiated in the folder.

Key State Flags

KEY_STATE_MK_LBUTTON
Value: 0x00000001
Left mouse button
KEY_STATE_MK_RBUTTON
Value: 0x00000002
Right mouse button
KEY_STATE_MK_MBUTTON
Value: 0x00000010
Middle mouse button
KEY_STATE_MK_SHIFT
Value: 0x00000004
Shift keyboard key
KEY_STATE_MK_CONTROL
Value: 0x00000008
Control keyboard key
KEY_STATE_MK_ALT
Value: 0x00000020
Alt keyboard key

Namespace Locations

NS_LOCATION_NONE
Value: ""
No location. Used for extensions that implement "file as folder" feature and that may appear anywhere within the Windows Shell namespace.
NS_LOCATION_COMMONPLACES
Value: "CommonPlaces"
Add or Remove Programs Windows Shell folder or Programs and Features (Windows 10 and later). Corresponds to FOLDERID_ChangeRemovePrograms well-known ID.
NS_LOCATION_CONTROLPANEL
Value: "ControlPanel"
Control Panel folder. Corresponds to FOLDERID_ControlPanelFolder well-known ID.
NS_LOCATION_DESKTOP
Value: "Desktop"
Desktop folder and Desktop itself. Corresponds to FOLDERID_Desktop well-known ID.
NS_LOCATION_FONTS
Value: "FontsFolder"
Fonts folder. Corresponds to FOLDERID_Fonts well-known ID.
NS_LOCATION_MYCOMPUTER
Value: "MyComputer"
My Computer Windows Shell folder. Corresponds to FOLDERID_ComputerFolder well-known ID.
NS_LOCATION_NETWORK_NEIGHBORHOOD
Value: "NetworkNeighborhood"
Network Windows Shell folder. Corresponds to FOLDERID_NetworkFolder well-known ID.
NS_LOCATION_ENTIRE_NETWORK
Value: "NetworkNeighborhood\\EntireNetwork"
Network Shortcuts folder. Corresponds to FOLDERID_NetHood well-known ID.
NS_LOCATION_PRINTERS_AND_FAXES
Value: "PrintersAndFaxes"
Printers and Faxes folder or Devices and Printers (Windows 10 or later). Corresponds to FOLDERID_PrintersFolder well-known ID.
NS_LOCATION_USERS_FILES
Value: "UsersFiles"
User's root folder. Corresponds to FOLDERID_UsersFiles well-known ID.
NS_LOCATION_USERS_LIBRARIES
Value: "UsersLibraries"
Libraries folder. Corresponds to FOLDERID_UsersLibraries well-known ID.

Shell item comparison options

ICO_ALLFIELDS
Value: 0x01
All item properties should be compared Compare all the information of the items. For instance, if the two items are files, the folder should compare their names, sizes, file times, attributes, and any other information in the items.
ICO_CANONICALONLY
Value: 0x02
Only item internal names should be compared. When comparing by name, compare the system names but not the display names. When this flag is passed, the two items are compared by whatever criteria are the most efficient, as long as comparison is performed consistently. This flag is useful when comparing for equality or when the results of the sort are not displayed to the user. This flag cannot be combined with other flags.

Shell Notification Types

CHANGE_NOTIFY_RENAME
Value: 0x00000001
The name of a nonfolder item has changed. Both PIDL/Path and NewPIDL/NewPath parameters are valid. Renaming of a folder is indicated by the CHANGE_NOTIFY_RENAME_FOLDER flag.
CHANGE_NOTIFY_CREATE
Value: 0x00000002
A nonfolder item has been created. Either PIDL, Path, or both parameters are valid. Creation of a folder is indicated by the CHANGE_NOTIFY_CREATE_FOLDER flag.
CHANGE_NOTIFY_DELETE
Value: 0x00000004
A nonfolder item has been deleted. Either PIDL, Path, or both parameters are valid. Deletion of a folder is indicated by the CHANGE_NOTIFY_DELETE_FOLDER flag.
CHANGE_NOTIFY_CREATE_FOLDER
Value: 0x00000008
A folder has been created. Either PIDL, Path, or both parameters are valid.
CHANGE_NOTIFY_DELETE_FOLDER
Value: 0x00000010
A folder has been removed. Either PIDL, Path, or both parameters are valid.
CHANGE_NOTIFY_ATTRIBUTES
Value: 0x00000800
The attributes of an item or folder have changed Either PIDL, Path, or both parameters are valid.
CHANGE_NOTIFY_UPDATE_FOLDER
Value: 0x00001000
The contents of an existing folder have changed, but the folder still exists and has not been renamed. Either PIDL, Path, or both parameters are valid.
CHANGE_NOTIFY_UPDATE
Value: 0x00002000
An existing item (a folder or a non-folder item) has changed, but the item still exists and has not been renamed. Either PIDL, Path, or both parameters are valid.
CHANGE_NOTIFY_RENAME_FOLDER
Value: 0x00020000
The name of a folder has changed. Both PIDL/Path and NewPIDL/NewPath parameters are valid.
CHANGE_NOTIFY_DEFAULT
Value: 0x0002001F
The default value of the Notifications property

Types of External Update

UPDATE_TYPE_CREATE
Value: 0x00000001
A new item or folder is created. This flag must be exclusive if used.
UPDATE_TYPE_CHANGE
Value: 0x00000002
An item or folder has been changed. For folders, use this flag to tell the Windows Shell that the folder's contents have been changed.
UPDATE_TYPE_DELETE
Value: 0x00000004
An item or folder has been deleted.
UPDATE_TYPE_ATTRIBUTES
Value: 0x00000008
The attributes of an item or a folder have been updated.
UPDATE_TYPE_RENAME
Value: 0x00000010
An item was renamed; its name and possibly its Id have been changed. This flag must be exclusive if used.

Flags associated with ShellMenu items

CMF_DEFAULT
Value: 0x00
No command flags are set
CMF_HASSPLITBUTTON
Value: 0x02
A split button is displayed.
CMF_ISSEPARATOR
Value: 0x08
The command is a separator.
CMF_HASLUASHIELD
Value: 0x0010
A UAC shield is displayed.
CMF_TOGGLEABLE
Value: 0x0100
The item is a switch.

Item Property Types

PROP_TYPE_BOOL
Value: 1
Boolean
PROP_TYPE_LONG
Value: 2
64-bit signed integer
PROP_TYPE_DATE
Value: 3
Date
PROP_TYPE_STRING
Value: 4
Text string
PROP_TYPE_ICON
Value: 5
Index of icon. The index is used to choose the icon that will be displayed. The set of icons is defined in the property description (see AddIconColumn for details).

RefreshView Values

REFRESH_VIEW_NO_REFRESH
Value: 0
Do not refresh anything
REFRESH_VIEW_ITEM
Value: 1
Refresh the item
REFRESH_VIEW_CHILDREN
Value: 2
Refresh views with the item and, if the item is a folder, views with the item's direct children.
REFRESH_VIEW_GRANDCHILDREN
Value: 3
Refresh views with the item and, if the item is a folder, views with the item's children and grandchildren (recursively).

Shell Item Attributes

SFGAO_CANCOPY
Value: 0x00000001
The specified items can be copied.
SFGAO_CANMOVE
Value: 0x00000002
The specified items can be moved.
Value: 0x00000004
Shortcuts can be created for the specified items.

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 Windows File Explorer's File menu and to normal shortcut menus.

SFGAO_STORAGE
Value: 0x00000008
The specified items can be bound to an IStorage object. Should not be changed if item content is used.
SFGAO_CANRENAME
Value: 0x00000010
The specified items can be renamed.
SFGAO_CANDELETE
Value: 0x00000020
The specified items can be deleted.
SFGAO_HASPROPSHEET
Value: 0x00000040
The specified items have property sheets.
SFGAO_DROPTARGET
Value: 0x00000100
The specified items are drop targets.
SFGAO_PLACEHOLDER
Value: 0x00000800
The specified items are not fully present and recalled on open or access.
SFGAO_SYSTEM
Value: 0x00001000
The specified items are system items.
SFGAO_ENCRYPTED
Value: 0x00002000
The specified items are encrypted and might require special presentation.
SFGAO_ISSLOW
Value: 0x00004000
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.
SFGAO_GHOSTED
Value: 0x00008000
The specified items are shown as dimmed and unavailable to the user.
Value: 0x00010000
The specified items are shortcuts.
SFGAO_SHARE
Value: 0x00020000
The specified objects are shared.
SFGAO_READONLY
Value: 0x00040000
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 Read-Only attribute.
SFGAO_HIDDEN
Value: 0x00080000
The item is hidden and should not be displayed unless the Show hidden files and folders option is enabled in Folder Settings. ShellItem property: IsHidden.
SFGAO_NONENUMERATED
Value: 0x00100000
The items are non-enumerated items and should be hidden. Should not be changed.
SFGAO_NEWCONTENT
Value: 0x00200000
The items contain new content, as defined by the particular application.
SFGAO_STREAM
Value: 0x00400000
Indicates that the item has a stream associated with it. Should not be changed if item content is used. Default for items: true.
SFGAO_STORAGEANCESTOR
Value: 0x00800000
Children of this item are accessible through IStream or IStorage. Those children are flagged with SFGAO_STORAGE or SFGAO_STREAM. Should not be changed if item content is used.
SFGAO_VALIDATE
Value: 0x01000000
When specified as input, SFGAO_VALIDATE instructs the folder to validate that the items contained in a folder or Windows Shell item array exist. Should not be changed.
SFGAO_REMOVABLE
Value: 0x02000000
The specified items are on removable media or are themselves removable devices.
SFGAO_COMPRESSED
Value: 0x04000000
The specified items are compressed.
SFGAO_BROWSABLE
Value: 0x08000000
The specified items can be hosted inside a web browser or Explorer frame. To be used with non-folder items.
SFGAO_FILESYSANCESTOR
Value: 0x10000000
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. This attribute is added automatically to folders that represent filesystem objects. If the root folder is expected to contain filesystem items, add this flag to the Attributes property of the ShellFolder component.
SFGAO_FOLDER
Value: 0x20000000
The specified items are folders. Should not be changed. In the ShellFolder component, this flag is added or removed automatically depending on the value of the IsFolder parameter of the ListItem method.
SFGAO_FILESYSTEM
Value: 0x40000000
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 attribute is added automatically to folders and items that represent filesystem objects.

SFGAO_HASSUBFOLDER
Value: 0x80000000
The specified folders have subfolders. The SFGAO_HASSUBFOLDER attribute is only advisory and might be returned by Windows 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 Windows Shell always returns SFGAO_HASSUBFOLDER when a folder is located on a network drive.

Already handled, but may be changed if needed (when the application can determine for sure that the folder is empty).

SFGAO_DEFAULT_ROOT
Value: 0xA0C00108
Default value for the namespace root folder. This attribute is a combination of SFGAO_FOLDER, SFGAO_HASSUBFOLDER, SFGAO_STREAM, SFGAO_STORAGEANCESTOR, SFGAO_DROPTARGET, SFGAO_STORAGE, and is used to initialize the value of the Attributes property of ShellFolder.

Shell Item Enumeration Flags

SHCONTF_FOLDERS
Value: 0x00000020
Include items that are folders in the enumeration. Do not include folders when the flag is not set.
SHCONTF_NONFOLDERS
Value: 0x00000040
Include items that are not folders in the enumeration. Do not include non-folder items when the flag is not set.
SHCONTF_INCLUDEHIDDEN
Value: 0x00000080
Include items that are hidden but not system in the enumeration. Do not include hidden system items when the flag is set.
SHCONTF_INCLUDESUPERHIDDEN
Value: 0x00010000
Include items that are both system and hidden in the enumeration. Do not include just hidden (non-system) system items when the flag is set.

Shell Column Flags

SHCOLSTATE_TYPE_STR
Value: 0x00000001
The value is displayed as a string. Use with a dynamic column to specify the type of its data.
SHCOLSTATE_TYPE_INT
Value: 0x00000002
The value is displayed as an integer. Use with a dynamic column to specify the type of its data.
SHCOLSTATE_TYPE_DATE
Value: 0x00000003
The value is displayed as a date. Use with a dynamic column to specify the type of its data.
SHCOLSTATE_ONBYDEFAULT
Value: 0x00000010
The column should be visible by default in Details view. If not set, the column will not be visible, which may be confusing for users.
SHCOLSTATE_SLOW
Value: 0x00000020
Will be slow to compute. Perform on a background thread.
SHCOLSTATE_HIDDEN
Value: 0x00000100
Not displayed in the UI.
SHCOLSTATE_NOSORTBYFOLDERNESS
Value: 0x00000800
When sorting by contents of this column, do not sort subfolders separately from non-folder items.
SHCOLSTATE_FIXED_WIDTH
Value: 0x00001000
Can't resize the column.
SHCOLSTATE_NODPISCALE
Value: 0x00002000
The width is the same in all dpi.
SHCOLSTATE_FIXED_RATIO
Value: 0x00004000
Fixed width and height ratio.
SHCOLSTATE_NO_GROUPBY
Value: 0x00040000
Grouping is disabled for this column.

Property Description View Flags

PDVF_CENTERALIGN
Value: 0x00000001
Content of the column cell should be centered.
PDVF_RIGHTALIGN
Value: 0x00000002
Content of the column cell should be aligned to the right.
PDVF_BEGINNEWGROUP
Value: 0x00000004
Show this property as the beginning of the next collection of properties in the view.
PDVF_FILLAREA
Value: 0x00000008
Fill the remainder of the view area with the content of this property.
PDVF_HIDELABEL
Value: 0x00000200
Hide the label of this property if the view normally shows the label.
PDVF_CANWRAP
Value: 0x00001000
The content of the column cell can be wrapped to the next row.

Error Codes

CBFSSHELL_ERR_FILE_NOT_FOUND
Value: 2
An item with given ID cannot be found.
CBFSSHELL_ERR_CANT_LOAD_PROXY
Value: 20
Cannot load native proxy DLL. The attempted location can be found in the error message.
CBFSSHELL_ERR_PROXY_VERSION_MISMATCH
Value: 28
The major version of the proxy DLL doesn't match the major version of the .NET assembly.
CBFSSHELL_ERR_STREAM_EOF
Value: 38
End of data stream has been reached and no data could be read.
CBFSSHELL_ERR_NOT_INSTALLED
Value: 55
Proxy DLL not installed properly.
CBFSSHELL_ERR_INSTALL_FAILED
Value: 56
Installation of the native proxy DLL failed. The specific error code returned by the OS can be found in the error message.
CBFSSHELL_ERR_UNINSTALL_FAILED
Value: 57
Uninstallation of the native proxy DLL failed. The specific error code returned by the OS can be found in the error message.
CBFSSHELL_ERR_INIT_FAILED
Value: 58
Initialization of the native proxy DLL failed. The specific error code returned by the OS can be found in the error message.
CBFSSHELL_ERR_PROXY_NAME_MISMATCH
Value: 59
The current license and the ID in the native proxy DLL name don't match.
CBFSSHELL_ERR_CANT_WRITE_TO_REGISTRY
Value: 60
Writing to the Windows registry failed.
CBFSSHELL_ERR_ALREADY_STARTED
Value: 61
This Menu instance has already been started.
CBFSSHELL_ERR_MENU_ITEM_ALREADY_REG
Value: 62
A menu item with the same verb is already registered.
CBFSSHELL_ERR_MENU_ITEM_NOT_REG
Value: 63
No menu items have been registered.
CBFSSHELL_ERR_PARENT_MENU_ITEM_NOT_FOUND
Value: 64
A parent with the given verb has not been found.
CBFSSHELL_ERR_PARENT_MENU_ITEM_IS_SUBITEM
Value: 65
The menu item with the given verb is a subitem. Only one level of subitems is supported.
CBFSSHELL_ERR_MENU_ITEM_IS_PARENT
Value: 66
The menu item with the given verb is a parent of some other item or items.
CBFSSHELL_ERR_INVALID_PARAMETER
Value: 87
The passed parameter was not valid.
CBFSSHELL_ERR_INSUFFICIENT_BUFFER
Value: 122
The provided buffer is too small to accommodate all the data that must be placed in it.