Introduction

Welcome to CBFS Shell, a suite of easy-to-use components for extending Windows File Explorer. Define how users interact with files and folders, customize context menus, add informational columns and more. CBFS Shell modules run in Windows Explorer and in your application; they communicate with each other via an efficient RPC mechanism. CBFS Shell supports Windows 7 and later, including Windows 11, on x86, x64, and ARM64 processor architectures.

Included Libraries

The .NET Edition includes libraries (.dll files) which are supported in different environments. The following libraries are present in the lib directory after installation:

  • lib\net47\callback.CBFSShell.dll is designed for use in .NET Framework 4.7 and up. This library maintains a familiar API in line with previous versions of the product.

  • lib\netstandard2.0\callback.CBFSShell.dll is designed for use in .NET Standard 2.0 and up. The .NET Standard library maintains the same API as the .NET Framework version of the library and can be used in projects that are based on .NET Core and .NET 5 and later.

Included Components

ShellFolder The ShellFolder component enables creating a virtual folder containing items in the Windows Shell.
ShellMenu The ShellMenu component enables customizing Shell context menu items and commands.
ShellNotify The ShellNotify component enables monitoring file system change notifications.

Additional Information

You will always find the latest information about CBFS Shell at our web site: www.callback.com. We offer free, fully-functional 30-day trials for all of our products, and our technical support staff are happy to answer any questions you may have during your evaluation.

Please direct all technical questions to support@callback.com. To help support technicians assist you as quickly as possible, please provide a detailed and accurate description of your problem, the results you expected, and the results that you received while using our product. For questions about licensing and pricing, and all other general inquiries, please contact sales@callback.com.

Thank You!

Thank you for choosing CBFS Shell for your development needs. We realize that you have a choice among development tools, and that by choosing us you are counting on us to be a key component in your business. We work around the clock to provide you with ongoing enhancements, support, and innovative products; and we will always do our best to exceed your expectations!

Deployment Instructions

CBFS Shell includes a .NET library and a native proxy library which must both be distributed to deployment machines. CBFS Shell is supported on Windows 7 and later on x86, x64, and ARM64 processors.

Libraries

  • CBFS Shell Proxy DLL: The lib/native directory of the installation contains a native proxy library compiled for specific processor architectures. The <Id> portion of the proxy DLL name is a unique identifier tied to the license.

    • CBFSShell.<Id>.x86.dll
    • CBFSShell.<Id>.x64.dll
    • CBFSShell.<Id>.ARM64.dll

  • CBFS Shell .NET Assembly: The lib directory of the installation contains libraries compiled for specific target frameworks such as .NET Framework 4.7 or .NET Core. All versions of the assembly are compiled as "Any CPU" and the same binary supports x86, x64, and ARM64 processes.

    • callback.CBFSShell.dll

Deployment

When distributing your CBFS Shell application, it is essential to prepare the target machine by calling the Install method. This should invoked from installers rather than directly from the main application. For instance, it should be called from an install function or wizard.

The installation step enables your application to leverage the full functionality of ShellFolder or ShellMenu. Once this part is completed, remember to restart Windows File Explorer. This will rebuild the structures of the Windows Shell and allow users to find the namespace or menu.

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.
DROP_EFFECT_SCROLL
Value: -2147483648
Scrolling is occurring in the target. This is a supplementary flag that has a binary value 0x80000000.

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

MK_LBUTTON
Value: 0x00000001
Left mouse button
MK_RBUTTON
Value: 0x00000002
Right mouse button
MK_MBUTTON
Value: 0x00000010
Middle mouse button
MK_SHIFT
Value: 0x00000004
Shift keyboard key
MK_CONTROL
Value: 0x00000008
Control keyboard key
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 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 nonfolder) 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.

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_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.