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 }); }
public SystemWatcherWrapper(DirectoryInfoEx dir, bool includeSubDir) { MonitorDir = dir; _dirPIDL = dir.getPIDL(); 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 }); }