https://github.com/andreyrusyaev/shellnotifywatcher
Managed C# wrapper for Win32 SHChangeNotify and SHCNE_ events.
https://github.com/andreyrusyaev/shellnotifywatcher
shchangenotify shell windows
Last synced: about 1 year ago
JSON representation
Managed C# wrapper for Win32 SHChangeNotify and SHCNE_ events.
- Host: GitHub
- URL: https://github.com/andreyrusyaev/shellnotifywatcher
- Owner: AndreyRusyaev
- Created: 2021-09-05T17:10:09.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-31T06:29:16.000Z (over 1 year ago)
- Last Synced: 2025-04-18T06:51:20.207Z (about 1 year ago)
- Topics: shchangenotify, shell, windows
- Language: C#
- Homepage:
- Size: 62.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shell Notifications Watcher
Managed C# wrapper for SHChangeNotify and SHCNE_ events.
[](https://www.nuget.org/packages/shellnotifywatcher)
[](https://www.nuget.org/packages/shellnotifywatcher)
```cs
using ShellNotifyWatcher watcher = new ShellNotifyWatcher
{
Path = "C:\\",
Recursive = true,
EventFilters = ShellEventFilters.AllEvents
};
// Item/Folder events
watcher.ItemChanged += (obj, e) => Console.WriteLine("{0} {1} {2}", e.ChangeType, e.ItemType, e.Path);
watcher.ItemRenamed += (obj, e) => Console.WriteLine("{0} {1} {2} -> {3}", e.ChangeType, e.ItemType, e.OldPath, e.NewPath);
watcher.DriveChanged += (obj, e) => Console.WriteLine("{0} {1}", e.ChangeType, e.Path);
watcher.ShareChanged += (obj, e) => Console.WriteLine("ShareStatusChanged: {0} {1}", e.Status, e.Path);
// Global events
watcher.FreespaceChanged += (obj, e) => Console.WriteLine("FreespaceChanged Drives: {0}", string.Join(", ", e.Drives));
watcher.ServerDisconnected += (obj, e) => Console.WriteLine("ServerDisconnected");
watcher.FileTypeAssociationChanged += (obj, e) => Console.WriteLine("FileTypeAssociationChanged");
watcher.SystemImageListChanged += (obj, e) => Console.WriteLine("SystemImageListChanged ImageIndex: {0}", e.ImageIndex);
watcher.ExtendedEventOccurred += (obj, e) => Console.WriteLine("ExtendedEventOccurred EventId: {0}", e.EventId);
watcher.EnableRaisingEvents = true;
```