重构Win32Natives

This commit is contained in:
ww-rm
2025-11-08 19:17:09 +08:00
parent fb319e09d8
commit 8e771fbaa4
19 changed files with 91 additions and 60 deletions

28
Win32Natives/Shell32.cs Normal file
View 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);
}
}
}