重构Win32Natives
This commit is contained in:
28
Win32Natives/Shell32.cs
Normal file
28
Win32Natives/Shell32.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace Win32Natives
|
||||
{
|
||||
/// <summary>
|
||||
/// shell32.dll 包装类
|
||||
/// </summary>
|
||||
public static class Shell32
|
||||
{
|
||||
private const uint SHCNE_ASSOCCHANGED = 0x08000000;
|
||||
private const uint SHCNF_IDLIST = 0x0000;
|
||||
|
||||
[DllImport("shell32.dll")]
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user