An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# Shell Notifications Watcher

Managed C# wrapper for SHChangeNotify and SHCNE_ events.

[![NuGet Downloads](https://img.shields.io/nuget/dt/shellnotifywatcher)](https://www.nuget.org/packages/shellnotifywatcher)
[![NuGet Version](https://img.shields.io/nuget/v/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;
```