BrendanGrant.Helpers.FileAssociation.ShellNotification.NotifyOfChange C# (CSharp) Method

NotifyOfChange() public static method

Notify shell of change of file associations.
public static NotifyOfChange ( ) : void
return void
        public static void NotifyOfChange()
        {
            SHChangeNotify(
                (uint)ShellChangeNotificationEvents.SHCNE_ASSOCCHANGED,
                (uint)(ShellChangeNotificationFlags.SHCNF_IDLIST | ShellChangeNotificationFlags.SHCNF_FLUSHNOWAIT),
                IntPtr.Zero,
                IntPtr.Zero);
        }

Usage Example

Example #1
0
        /// <summary>
        /// Sets a value that indicates the filter component that is used to search for text within documents of this type.
        /// </summary>
        /// <param name="file"><see cref="FileAssociationInfo"/> that provides specifics of the extension to be changed.</param>
        /// <param name="persistentHandler">Guid of filter component.</param>
        protected void SetPersistentHandler(FileAssociationInfo file, Guid persistentHandler)
        {
            if (!file.Exists)
            {
                throw new Exception("Extension does not exist");
            }

            if (persistentHandler == Guid.Empty)
            {
                return;
            }

            this.registryWrapper.Write(file.extension + "\\" + PersistentHandler, string.Empty, persistentHandler);

            ShellNotification.NotifyOfChange();
        }
All Usage Examples Of BrendanGrant.Helpers.FileAssociation.ShellNotification::NotifyOfChange