ShellNotify Class

Properties   Methods   Events   Config Settings   Errors  

The ShellNotify class enables monitoring file system change notifications.

Syntax

ShellNotify

Remarks

The ShellNotify class provides a simple way to monitor changes such as creation, renaming, deletion, or modification of files or folders. The class uses the Windows API to register as an observer of shell notifications.

Activate

First, set the Path property to the desired location to listen for changes. The target may be a local or remote filesystem, and a path may be specified using the drive letter format or a UNC path. For instance, you can set C:\Path\To\Folder if the target is a mapped drive, or \\servername\sharename if the target is a network share.

After that, you may set the Recursive property depending on whether you would like to include changes for subfolders. You may also set the value of Notifications to control the types of changes to monitor.

ShellNotify component = new ShellNotify(); component.Path = "C:\Temp"; component.Recursive = True;

The next step is to call Activate to begin listening for changes. As users interact with files and folders at the specified Path, the corresponding events will be triggered. Activate must be called again if the Explorer process is terminated.

component.Activate();

Deactivate

To unregister as an observer of changes, call the Deactivate method. This action will cease monitoring change notifications and only needs to be called once.

component.Deactivate();

PIDLs

A PIDL (or an IDL) is a fundamental Windows Shell concept. At a high level, it is pretty simple, as it is just a value that represents a Windows Shell item in the Windows Shell Namespace. It is a bit like a full filesystem path for a physical file or folder, except that it is a binary object and not a string. The name "PIDL" and "IDL" can be used interchangeably. The leading P stands for pointer, the IDL stands for item identifier list, and PIDL generally refers to an IDL itself rather than the pointer to it.

The below information is provided as a general knowledge. Your application will deal with PIDLs only when they denote some Windows Shell items that are not necessarily a part of the Windows Shell namespace extension that you create. Such PIDLs can be used with the Windows Shell API if you decide to call it directly. When CBFS Shell exposes these PIDL values they will appear hex-encoded. If an application needs to call a shell function, it has to decode the PIDL before calling that function.

Just like a full filesystem path is a list of strings separated by the directory separator (on Windows, it is the \ (backslash) character), a PIDL is a list (L is for list) of Ids (identifiers). Unlike a filesystem path, though, a PIDL is binary, and Ids are separated by a special PIDL separator (two consecutive zero bytes).

Microsoft provides more details about PIDLs here Identifying Namespace Objects.

Troubleshooting

Following are some helpful resources for troubleshooting issues.

  • If events are not triggered for any changes, note that the class relies on Explorer running and not terminating or restarting. If the Explorer process ends then you will need to call Activate again.
  • If certain events are not triggered, it may be that the system components behave differently depending on the target you are monitoring. For instance, to monitor changes to a network share one needs to handle ItemChanged.
  • If you are seeing strange behavior not contained in this list, please reach out to us with a description of the problem and we are happy to help. Our support team is available over email at support@callback.com

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

NotificationsThe property specifies which changes to monitor.
PathThe property specifies what path or namespace item to monitor.
RecursiveThis property specifies whether changes in subfolders should be monitored.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

ActivateThis method initiates monitoring for changes.
ConfigSets or retrieves a configuration setting.
DeactivateThis method stops monitoring changes.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

ErrorThis event is fired if an unhandled error occurs during an event.
FileCreatedThis event fires when a file is created.
FileDeletedThis event fires when a file is deleted.
FileRenamedThis event fires when a file is renamed.
FolderCreatedThis event fires when a folder is created.
FolderDeletedThis event fires when a folder is deleted.
FolderRenamedThis event fires when a folder is renamed.
ItemChangedThis event fires when any item is changed.

Config Settings


The following is a list of config settings for the class with short descriptions. Click on the links for further details.

BuildInfoInformation about the product's build.
LicenseInfoInformation about the current license.

Notifications Property (ShellNotify Class)

The property specifies which changes to monitor.

Syntax

ANSI (Cross Platform)
int GetNotifications();
int SetNotifications(int iNotifications); Unicode (Windows) INT GetNotifications();
INT SetNotifications(INT iNotifications);
int cbfsshell_shellnotify_getnotifications(void* lpObj);
int cbfsshell_shellnotify_setnotifications(void* lpObj, int iNotifications);
int GetNotifications();
int SetNotifications(int iNotifications);

Default Value

0x0002001F

Remarks

The property specifies which changes the class should monitor. The value may be a combination of the following flags:

UPDATE_TYPE_CREATE0x00000001A new item or folder is created.

This flag must be exclusive if used.

UPDATE_TYPE_CHANGE0x00000002An 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_DELETE0x00000004An item or folder has been deleted.

UPDATE_TYPE_ATTRIBUTES0x00000008The attributes of an item or a folder have been updated.

UPDATE_TYPE_RENAME0x00000010An item was renamed; its name and possibly its Id have been changed.

This flag must be exclusive if used.

The default value of 0x0002001F (CHANGE_NOTIFY_DEFAULT) is a combination of the following flags:

Data Type

Integer

Path Property (ShellNotify Class)

The property specifies what path or namespace item to monitor.

Syntax

ANSI (Cross Platform)
char* GetPath();
int SetPath(const char* lpszPath); Unicode (Windows) LPWSTR GetPath();
INT SetPath(LPCWSTR lpszPath);
char* cbfsshell_shellnotify_getpath(void* lpObj);
int cbfsshell_shellnotify_setpath(void* lpObj, const char* lpszPath);
QString GetPath();
int SetPath(QString qsPath);

Default Value

""

Remarks

This property specifies the target to monitor. If omitted, all of the Windows Shell namespace is monitored. A target may be any namespace item such as a folder or non-folder item.

An application may set this property to a filesystem path in drive-letter format, a path in UNC format, or a hex-encoded PIDL if a Windows Shell folder or item with no filesystem path is to be monitored. For instance:

  • C:\Path\To\Folder
  • \\<server>\<share>

Data Type

String

Recursive Property (ShellNotify Class)

This property specifies whether changes in subfolders should be monitored.

Syntax

ANSI (Cross Platform)
int GetRecursive();
int SetRecursive(int bRecursive); Unicode (Windows) BOOL GetRecursive();
INT SetRecursive(BOOL bRecursive);
int cbfsshell_shellnotify_getrecursive(void* lpObj);
int cbfsshell_shellnotify_setrecursive(void* lpObj, int bRecursive);
bool GetRecursive();
int SetRecursive(bool bRecursive);

Default Value

TRUE

Remarks

This property specifies whether changes in subfolders of the folder specified by Path property should also be monitored. This setting will be ignored if the Path property references a non-folder item.

Data Type

Boolean

Activate Method (ShellNotify Class)

This method initiates monitoring for changes.

Syntax

ANSI (Cross Platform)
int Activate();

Unicode (Windows)
INT Activate();
int cbfsshell_shellnotify_activate(void* lpObj);
int Activate();

Remarks

Use this method to begin monitoring for changes in the target location specified by the Path property. The types of changes that will be included in monitoring are set in the Notifications property.

Activate must be called again if the Explorer process is terminated.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Config Method (ShellNotify Class)

Sets or retrieves a configuration setting.

Syntax

ANSI (Cross Platform)
char* Config(const char* lpszConfigurationString);

Unicode (Windows)
LPWSTR Config(LPCWSTR lpszConfigurationString);
char* cbfsshell_shellnotify_config(void* lpObj, const char* lpszConfigurationString);
QString Config(const QString& qsConfigurationString);

Remarks

Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Deactivate Method (ShellNotify Class)

This method stops monitoring changes.

Syntax

ANSI (Cross Platform)
int Deactivate();

Unicode (Windows)
INT Deactivate();
int cbfsshell_shellnotify_deactivate(void* lpObj);
int Deactivate();

Remarks

Use this method to stop monitoring for changes and unregister as an observer of change notifications.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Error Event (ShellNotify Class)

This event is fired if an unhandled error occurs during an event.

Syntax

ANSI (Cross Platform)
virtual int FireError(ShellNotifyErrorEventParams *e);
typedef struct {
int ErrorCode;
const char *Description; int reserved; } ShellNotifyErrorEventParams;
Unicode (Windows) virtual INT FireError(ShellNotifyErrorEventParams *e);
typedef struct {
INT ErrorCode;
LPCWSTR Description; INT reserved; } ShellNotifyErrorEventParams;
#define EID_SHELLNOTIFY_ERROR 1

virtual INT CBFSSHELL_CALL FireError(INT &iErrorCode, LPSTR &lpszDescription);
class ShellNotifyErrorEventParams {
public:
  int ErrorCode();

  const QString &Description();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void Error(ShellNotifyErrorEventParams *e);
// Or, subclass ShellNotify and override this emitter function. virtual int FireError(ShellNotifyErrorEventParams *e) {...}

Remarks

This event fires if an unhandled error occurs. Developers can use this information to track down unhandled errors that occur in the class.

ErrorCode contains an error code and Description contains a textual description of the error.

FileCreated Event (ShellNotify Class)

This event fires when a file is created.

Syntax

ANSI (Cross Platform)
virtual int FireFileCreated(ShellNotifyFileCreatedEventParams *e);
typedef struct {
const char *PIDL; int lenPIDL;
const char *Path; int reserved; } ShellNotifyFileCreatedEventParams;
Unicode (Windows) virtual INT FireFileCreated(ShellNotifyFileCreatedEventParams *e);
typedef struct {
LPCSTR PIDL; INT lenPIDL;
LPCWSTR Path; INT reserved; } ShellNotifyFileCreatedEventParams;
#define EID_SHELLNOTIFY_FILECREATED 2

virtual INT CBFSSHELL_CALL FireFileCreated(LPSTR &lpPIDL, INT &lenPIDL, LPWSTR &lpszPath);
class ShellNotifyFileCreatedEventParams {
public:
  const QByteArray &PIDL();

  const QString &Path();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void FileCreated(ShellNotifyFileCreatedEventParams *e);
// Or, subclass ShellNotify and override this emitter function. virtual int FireFileCreated(ShellNotifyFileCreatedEventParams *e) {...}

Remarks

This event fires upon creation, when the Windows Shell registers file creation within the namespace.

PIDL contains a byte array that represents an item in the Windows Shell namespace. Please see PIDL for more information.

Path contains the full path of the item. This parameter is only applicable when the item is part of a filesystem with a path.

Note: The events are triggered in the same thread that the Windows Shell used for a notification. Performing time-consuming operations within this event will prevent other events firing in a timely manner and may affect overall performance.

FileDeleted Event (ShellNotify Class)

This event fires when a file is deleted.

Syntax

ANSI (Cross Platform)
virtual int FireFileDeleted(ShellNotifyFileDeletedEventParams *e);
typedef struct {
const char *PIDL; int lenPIDL;
const char *Path; int reserved; } ShellNotifyFileDeletedEventParams;
Unicode (Windows) virtual INT FireFileDeleted(ShellNotifyFileDeletedEventParams *e);
typedef struct {
LPCSTR PIDL; INT lenPIDL;
LPCWSTR Path; INT reserved; } ShellNotifyFileDeletedEventParams;
#define EID_SHELLNOTIFY_FILEDELETED 3

virtual INT CBFSSHELL_CALL FireFileDeleted(LPSTR &lpPIDL, INT &lenPIDL, LPWSTR &lpszPath);
class ShellNotifyFileDeletedEventParams {
public:
  const QByteArray &PIDL();

  const QString &Path();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void FileDeleted(ShellNotifyFileDeletedEventParams *e);
// Or, subclass ShellNotify and override this emitter function. virtual int FireFileDeleted(ShellNotifyFileDeletedEventParams *e) {...}

Remarks

This event fires upon deletion, when the Windows Shell has registered file deletion.

PIDL contains a byte array that represents an item in the Windows Shell namespace. Please see PIDL for more information.

Path contains the full path of the item. This parameter is only applicable when the item is part of a filesystem with a path.

Note: The events are triggered in the same thread that the Windows Shell used for a notification. Performing time-consuming operations within this event will prevent other events firing in a timely manner and may affect overall performance.

FileRenamed Event (ShellNotify Class)

This event fires when a file is renamed.

Syntax

ANSI (Cross Platform)
virtual int FireFileRenamed(ShellNotifyFileRenamedEventParams *e);
typedef struct {
const char *PIDL; int lenPIDL;
const char *Path;
const char *NewPIDL; int lenNewPIDL;
const char *NewPath; int reserved; } ShellNotifyFileRenamedEventParams;
Unicode (Windows) virtual INT FireFileRenamed(ShellNotifyFileRenamedEventParams *e);
typedef struct {
LPCSTR PIDL; INT lenPIDL;
LPCWSTR Path;
LPCSTR NewPIDL; INT lenNewPIDL;
LPCWSTR NewPath; INT reserved; } ShellNotifyFileRenamedEventParams;
#define EID_SHELLNOTIFY_FILERENAMED 4

virtual INT CBFSSHELL_CALL FireFileRenamed(LPSTR &lpPIDL, INT &lenPIDL, LPWSTR &lpszPath, LPSTR &lpNewPIDL, INT &lenNewPIDL, LPWSTR &lpszNewPath);
class ShellNotifyFileRenamedEventParams {
public:
  const QByteArray &PIDL();

  const QString &Path();

  const QByteArray &NewPIDL();

  const QString &NewPath();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void FileRenamed(ShellNotifyFileRenamedEventParams *e);
// Or, subclass ShellNotify and override this emitter function. virtual int FireFileRenamed(ShellNotifyFileRenamedEventParams *e) {...}

Remarks

This event fires upon renaming, when the Windows Shell has registered file renaming in one or more Windows Shell items.

PIDL contains a byte array that represents an previous item in the Windows Shell namespace. Please see PIDL for more information.

Path contains the full previous path of the item. This parameter is only applicable when the item is part of a filesystem with a path.

NewPIDL contains the new PIDL.

NewPath contains the new path. This parameter is only applicable when the item is part of a filesystem with a path.

Note: The events are triggered in the same thread that the Windows Shell used for a notification. Performing time-consuming operations within this event will prevent other events firing in a timely manner and may affect overall performance.

FolderCreated Event (ShellNotify Class)

This event fires when a folder is created.

Syntax

ANSI (Cross Platform)
virtual int FireFolderCreated(ShellNotifyFolderCreatedEventParams *e);
typedef struct {
const char *PIDL; int lenPIDL;
const char *Path; int reserved; } ShellNotifyFolderCreatedEventParams;
Unicode (Windows) virtual INT FireFolderCreated(ShellNotifyFolderCreatedEventParams *e);
typedef struct {
LPCSTR PIDL; INT lenPIDL;
LPCWSTR Path; INT reserved; } ShellNotifyFolderCreatedEventParams;
#define EID_SHELLNOTIFY_FOLDERCREATED 5

virtual INT CBFSSHELL_CALL FireFolderCreated(LPSTR &lpPIDL, INT &lenPIDL, LPWSTR &lpszPath);
class ShellNotifyFolderCreatedEventParams {
public:
  const QByteArray &PIDL();

  const QString &Path();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void FolderCreated(ShellNotifyFolderCreatedEventParams *e);
// Or, subclass ShellNotify and override this emitter function. virtual int FireFolderCreated(ShellNotifyFolderCreatedEventParams *e) {...}

Remarks

This event fires upon folder creation, when the Windows Shell has registered a folder is created.

PIDL contains a byte array that represents an item in the Windows Shell namespace. Please see PIDL for more information.

Path contains the full path of the item. This parameter is only applicable when the item is part of a filesystem with a path.

Note: The events are triggered in the same thread that the Windows Shell used for a notification. Performing time-consuming operations within this event will prevent other events firing in a timely manner and may affect overall performance.

FolderDeleted Event (ShellNotify Class)

This event fires when a folder is deleted.

Syntax

ANSI (Cross Platform)
virtual int FireFolderDeleted(ShellNotifyFolderDeletedEventParams *e);
typedef struct {
const char *PIDL; int lenPIDL;
const char *Path; int reserved; } ShellNotifyFolderDeletedEventParams;
Unicode (Windows) virtual INT FireFolderDeleted(ShellNotifyFolderDeletedEventParams *e);
typedef struct {
LPCSTR PIDL; INT lenPIDL;
LPCWSTR Path; INT reserved; } ShellNotifyFolderDeletedEventParams;
#define EID_SHELLNOTIFY_FOLDERDELETED 6

virtual INT CBFSSHELL_CALL FireFolderDeleted(LPSTR &lpPIDL, INT &lenPIDL, LPWSTR &lpszPath);
class ShellNotifyFolderDeletedEventParams {
public:
  const QByteArray &PIDL();

  const QString &Path();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void FolderDeleted(ShellNotifyFolderDeletedEventParams *e);
// Or, subclass ShellNotify and override this emitter function. virtual int FireFolderDeleted(ShellNotifyFolderDeletedEventParams *e) {...}

Remarks

This event fires upon folder deletion, when the Windows Shell has registered a folder has been deleted.

PIDL contains a byte array that represents an item in the Windows Shell namespace. Please see PIDL for more information.

Path contains the full path of the item. This parameter is only applicable when the item is part of a filesystem with a path.

Note: The events are triggered in the same thread that the Windows Shell used for a notification. Performing time-consuming operations within this event will prevent other events firing in a timely manner and may affect overall performance.

FolderRenamed Event (ShellNotify Class)

This event fires when a folder is renamed.

Syntax

ANSI (Cross Platform)
virtual int FireFolderRenamed(ShellNotifyFolderRenamedEventParams *e);
typedef struct {
const char *PIDL; int lenPIDL;
const char *Path;
const char *NewPIDL; int lenNewPIDL;
const char *NewPath; int reserved; } ShellNotifyFolderRenamedEventParams;
Unicode (Windows) virtual INT FireFolderRenamed(ShellNotifyFolderRenamedEventParams *e);
typedef struct {
LPCSTR PIDL; INT lenPIDL;
LPCWSTR Path;
LPCSTR NewPIDL; INT lenNewPIDL;
LPCWSTR NewPath; INT reserved; } ShellNotifyFolderRenamedEventParams;
#define EID_SHELLNOTIFY_FOLDERRENAMED 7

virtual INT CBFSSHELL_CALL FireFolderRenamed(LPSTR &lpPIDL, INT &lenPIDL, LPWSTR &lpszPath, LPSTR &lpNewPIDL, INT &lenNewPIDL, LPWSTR &lpszNewPath);
class ShellNotifyFolderRenamedEventParams {
public:
  const QByteArray &PIDL();

  const QString &Path();

  const QByteArray &NewPIDL();

  const QString &NewPath();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void FolderRenamed(ShellNotifyFolderRenamedEventParams *e);
// Or, subclass ShellNotify and override this emitter function. virtual int FireFolderRenamed(ShellNotifyFolderRenamedEventParams *e) {...}

Remarks

This event fires upon folder renaming, when the Windows Shell has registered renaming in one or more Windows Shell items.

PIDL contains a byte array that represents an previous item in the Windows Shell namespace. Please see PIDL for more information.

Path contains the full previous path of the item. This parameter is only applicable when the item is part of a filesystem with a path.

NewPIDL contains a new PIDL.

NewPath contains a new path. This parameter is only applicable when the item is part of a filesystem with a path.

Note: The events are triggered in the same thread that the Windows Shell used for a notification. Performing time-consuming operations within this event will prevent other events firing in a timely manner and may affect overall performance.

ItemChanged Event (ShellNotify Class)

This event fires when any item is changed.

Syntax

ANSI (Cross Platform)
virtual int FireItemChanged(ShellNotifyItemChangedEventParams *e);
typedef struct {
const char *PIDL; int lenPIDL;
const char *Path;
const char *NewPIDL; int lenNewPIDL;
const char *NewPath;
int Changes; int reserved; } ShellNotifyItemChangedEventParams;
Unicode (Windows) virtual INT FireItemChanged(ShellNotifyItemChangedEventParams *e);
typedef struct {
LPCSTR PIDL; INT lenPIDL;
LPCWSTR Path;
LPCSTR NewPIDL; INT lenNewPIDL;
LPCWSTR NewPath;
INT Changes; INT reserved; } ShellNotifyItemChangedEventParams;
#define EID_SHELLNOTIFY_ITEMCHANGED 8

virtual INT CBFSSHELL_CALL FireItemChanged(LPSTR &lpPIDL, INT &lenPIDL, LPWSTR &lpszPath, LPSTR &lpNewPIDL, INT &lenNewPIDL, LPWSTR &lpszNewPath, INT &iChanges);
class ShellNotifyItemChangedEventParams {
public:
  const QByteArray &PIDL();

  const QString &Path();

  const QByteArray &NewPIDL();

  const QString &NewPath();

  int Changes();

  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void ItemChanged(ShellNotifyItemChangedEventParams *e);
// Or, subclass ShellNotify and override this emitter function. virtual int FireItemChanged(ShellNotifyItemChangedEventParams *e) {...}

Remarks

This event fires upon any change, when the Windows Shell has registered a creation, deletion, renaming, or updates in one or more Windows Shell items. The types of updates can include changes to size, attributes, security settings, last write, and last access time.

PIDL contains a byte array that represents an item in the Windows Shell namespace. If the set of changes includes renaming, this parameter contains the previous PIDL. Please see PIDL for more information.

Path contains the full path of the item. This parameter is only applicable when the item is part of a filesystem with a path. If the set of changes includes renaming, this parameter contains the previous Path.

NewPIDL contains a new PIDL. This parameter is only used when the set of changes includes renaming.

NewPath contains a new path. This parameter is only used when the set of changes includes renaming.

Changes specifies the type of change. The value can be one of the following:

CHANGE_NOTIFY_RENAME0x00000001The 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_CREATE0x00000002A 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_DELETE0x00000004A 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_FOLDER0x00000008A folder has been created.

Either PIDL, Path, or both parameters are valid.

CHANGE_NOTIFY_DELETE_FOLDER0x00000010A folder has been removed.

Either PIDL, Path, or both parameters are valid.

CHANGE_NOTIFY_ATTRIBUTES0x00000800The attributes of an item or folder have changed

Either PIDL, Path, or both parameters are valid.

CHANGE_NOTIFY_UPDATE_FOLDER0x00001000The 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_UPDATE0x00002000An 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_FOLDER0x00020000The name of a folder has changed.

Both PIDL/Path and NewPIDL/NewPath parameters are valid.

CHANGE_NOTIFY_DEFAULT0x0002001FThe default value of the Notifications property

Note: The events are triggered in the same thread that the Windows Shell used for a notification. Performing time-consuming operations within this event will prevent other events firing in a timely manner and may affect overall performance.

Config Settings (ShellNotify Class)

The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a class is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).

Trappable Errors (ShellNotify Class)

Error Handling (C++)

Call the GetLastErrorCode() method to obtain the last called method's result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. Known error codes are listed below. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

ShellNotify Errors

2    An item with given ID cannot be found. The CBFSSHELL_ERR_FILE_NOT_FOUND constant is provided for convenience and may be used in place of the numeric value.
20    Cannot load native proxy DLL. The CBFSSHELL_ERR_CANT_LOAD_PROXY constant is provided for convenience and may be used in place of the numeric value.
28    The major version of the proxy DLL doesn't match the major version of the .NET assembly. The CBFSSHELL_ERR_PROXY_VERSION_MISMATCH constant is provided for convenience and may be used in place of the numeric value.
38    End of data stream has been reached and no data could be read. The CBFSSHELL_ERR_STREAM_EOF constant is provided for convenience and may be used in place of the numeric value.
55    Proxy DLL not installed properly. The CBFSSHELL_ERR_NOT_INSTALLED constant is provided for convenience and may be used in place of the numeric value.
56    Installation of the native proxy DLL failed. The CBFSSHELL_ERR_INSTALL_FAILED constant is provided for convenience and may be used in place of the numeric value.
57    Uninstallation of the native proxy DLL failed. The CBFSSHELL_ERR_UNINSTALL_FAILED constant is provided for convenience and may be used in place of the numeric value.
58    Initialization of the native proxy DLL failed. The CBFSSHELL_ERR_INIT_FAILED constant is provided for convenience and may be used in place of the numeric value.
59    The current license and the ID in the native proxy DLL name don't match. The CBFSSHELL_ERR_PROXY_NAME_MISMATCH constant is provided for convenience and may be used in place of the numeric value.
60    Writing to the Windows registry failed. The CBFSSHELL_ERR_CANT_WRITE_TO_REGISTRY constant is provided for convenience and may be used in place of the numeric value.
61    This Menu instance has already been started. The CBFSSHELL_ERR_ALREADY_STARTED constant is provided for convenience and may be used in place of the numeric value.
62    A menu item with the same verb is already registered. The CBFSSHELL_ERR_MENU_ITEM_ALREADY_REG constant is provided for convenience and may be used in place of the numeric value.
63    No menu items have been registered. The CBFSSHELL_ERR_MENU_ITEM_NOT_REG constant is provided for convenience and may be used in place of the numeric value.
87    The passed parameter was not valid. The CBFSSHELL_ERR_INVALID_PARAMETER constant is provided for convenience and may be used in place of the numeric value.
122    The provided buffer is too small to accommodate all the data that must be placed in it. The CBFSSHELL_ERR_INSUFFICIENT_BUFFER constant is provided for convenience and may be used in place of the numeric value.