refactor
This commit is contained in:
@@ -14,10 +14,15 @@ namespace SpineViewer.Natives
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Shell32
|
public static class Shell32
|
||||||
{
|
{
|
||||||
public const uint SHCNE_ASSOCCHANGED = 0x08000000;
|
private const uint SHCNE_ASSOCCHANGED = 0x08000000;
|
||||||
public const uint SHCNF_IDLIST = 0x0000;
|
private const uint SHCNF_IDLIST = 0x0000;
|
||||||
|
|
||||||
[DllImport("shell32.dll")]
|
[DllImport("shell32.dll")]
|
||||||
public static extern void SHChangeNotify(uint wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2);
|
private static extern void SHChangeNotify(uint wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2);
|
||||||
|
|
||||||
|
public static void NotifyAssociationChanged()
|
||||||
|
{
|
||||||
|
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
Registry.CurrentUser.DeleteSubKeyTree($@"Software\Classes\{App.ProgId}", false);
|
Registry.CurrentUser.DeleteSubKeyTree($@"Software\Classes\{App.ProgId}", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Shell32.SHChangeNotify(Shell32.SHCNE_ASSOCCHANGED, Shell32.SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);
|
Shell32.NotifyAssociationChanged();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user