SHChangeNotifyUnregister() private method

private SHChangeNotifyUnregister ( uint hNotify ) : bool
hNotify uint
return bool
Example #1
0
        /*
         * public ulong RegisterChangeNotify(IntPtr hWnd, IListItemEx item, bool Recursively)
         * {
         *  IntPtr handle = IntPtr.Zero;
         *  handle = hWnd;
         *  if (notifyid != 0) return (0);
         *  var changeentry = new SHChangeNotifyEntry() { pIdl = item.PIDL, Recursively = Recursively, };
         *  var changenetrys = new SHChangeNotifyEntry[1] { changeentry };
         *  //changenetrys[0] = changeentry;
         *
         *  notifyid = SHChangeNotifyRegister(
         *      hWnd,
         * (SHCNRF)0x00FF | (SHCNRF)0x0000 | SHCNRF.NewDelivery,
         *      SHCNE.SHCNE_ALLEVENTS | SHCNE.SHCNE_INTERRUPT,
         *      WM_SHNOTIFY,
         *      1,
         *      changenetrys);
         *  return (notifyid);
         * }
         */

        /// <summary>
        /// Unregister the form
        /// </summary>
        /// <returns>True if successfull</returns>
        public Boolean UnregisterChangeNotify()
        {
            if (notifyid == 0)
            {
                return(false);
            }
            if (Shell32.SHChangeNotifyUnregister(notifyid))
            {
                notifyid = 0;
                return(true);
            }

            return(false);
        }