此文记录的是修改操作后的系统提醒操作类。
/*** 修改已完成系统提醒类 Austin Liu 刘恒辉 Project Manager and Software Designer E-Mail: [email protected] Blog: http://lzhdim.cnblogs.com Date: 2024-01-15 15:18:00 使用方法: NotifyUtil.NotifySHChange(); 说明: 当更改资源管理中的目录图标,然后运行此类代码。 ***/ namespace Lzhdim.LPF.Utility { using System; using System.Runtime.InteropServices; /// <summary> /// 系统通知操作类 /// </summary> public class NotifyUtil { private const uint SHCNE_ASSOCCHANGED = 0x8000000; private const uint SHCNF_FLUSH = 0x8000; private const uint SHCNF_FLUSHNOWAIT = 0x1000; private const int SHCNF_PATH = 0x0005; /// <summary> /// 通知系统图标已更改 /// </summary> public static void NotifySHChange() { // 通知系统图标已更改 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSHNOWAIT, IntPtr.Zero, IntPtr.Zero); SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_PATH, IntPtr.Zero, IntPtr.Zero); } [DllImport("shell32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern void SHChangeNotify(uint wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2); } }
标签:IntPtr,const,函数,C#,private,修改,Zero,uint,SHCNF From: https://www.cnblogs.com/lzhdim/p/18340709