public static uint RegisterShellNotify(IntPtr handle) { ShellAPI.SHChangeNotifyEntry entry = new ShellAPI.SHChangeNotifyEntry(); entry.pIdl = ShellBrowser.GetDesctopPidl(); entry.Recursively = true; return RegisterShellNotify(handle, entry); }
public ShellBrowserUpdater(ShellBrowser br) { this.br = br; CreateHandle(new CreateParams()); ShellAPI.SHChangeNotifyEntry entry = new ShellAPI.SHChangeNotifyEntry(); entry.pIdl = br.DesktopItem.PIDLRel.Ptr; entry.Recursively = true; notifyId = RegisterShellNotify(this.Handle, entry); }
public ShellBrowserUpdater(ShellBrowser br) { this.br = br; CreateHandle(new CreateParams()); ShellAPI.SHChangeNotifyEntry entry = new ShellAPI.SHChangeNotifyEntry(); entry.pIdl = br.DesktopItem.PIDLRel.Ptr; entry.Recursively = true; notifyId = ShellAPI.SHChangeNotifyRegister( this.Handle, ShellAPI.SHCNRF.InterruptLevel | ShellAPI.SHCNRF.ShellLevel, ShellAPI.SHCNE.ALLEVENTS | ShellAPI.SHCNE.INTERRUPT, ShellAPI.WM.SH_NOTIFY, 1, new ShellAPI.SHChangeNotifyEntry[] { entry }); }
private void RegisterShellNotify() { ShellAPI.SHChangeNotifyEntry entry = new ShellAPI.SHChangeNotifyEntry(); entry.pIdl = ShellFolder.GetPathPIDL(this.Path); ; entry.Recursively = this.IncludeSubdirectories; this.notifyId = ShellAPI.SHChangeNotifyRegister( this.Handle, ShellAPI.SHCNRF.NewDelivery | ShellAPI.SHCNRF.InterruptLevel | ShellAPI.SHCNRF.ShellLevel, ShellAPI.SHCNE.ALLEVENTS, ShellAPI.WM.SH_NOTIFY, 1, new ShellAPI.SHChangeNotifyEntry[] { entry }); }
public SystemWatcherWrapper(DirectoryInfoEx dir, bool includeSubDir) { MonitorDir = dir; _dirPIDL = dir.PIDL; IncludeSubDirectories = includeSubDir; this.CreateHandle(new CreateParams()); ShellAPI.SHChangeNotifyEntry entry = new ShellAPI.SHChangeNotifyEntry(); entry.pIdl = _dirPIDL.Ptr; entry.Recursively = includeSubDir; _notifyID = ShellAPI.SHChangeNotifyRegister(this.Handle, ShellAPI.SHCNRF.InterruptLevel | ShellAPI.SHCNRF.ShellLevel, ShellAPI.SHCNE.ALLEVENTS | ShellAPI.SHCNE.INTERRUPT, ShellAPI.WM.SH_NOTIFY, 1, new ShellAPI.SHChangeNotifyEntry[] { entry }); }