예제 #1
0
        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 });
        }
예제 #2
0
        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 });
        }