From ae28d7d603bbdf72ef536f5fce3c545d5f39a96a Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Wed, 13 Mar 2019 19:53:18 +0800
Subject: [PATCH] update ExternDllHelper
---
HandyControl/Tools/Helper/ExternDllHelper.cs | 17 +++++++++++++++++
HandyControlDemo/HandyControlDemo.csproj | 1 +
2 files changed, 18 insertions(+)
diff --git a/HandyControl/Tools/Helper/ExternDllHelper.cs b/HandyControl/Tools/Helper/ExternDllHelper.cs
index 345abe7a..77a55d5f 100644
--- a/HandyControl/Tools/Helper/ExternDllHelper.cs
+++ b/HandyControl/Tools/Helper/ExternDllHelper.cs
@@ -19,6 +19,8 @@ namespace HandyControl.Tools
private const string Shell32 = "shell32.dll";
+ public delegate IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class NOTIFYICONDATA
{
@@ -40,6 +42,21 @@ namespace HandyControl.Tools
public int dwInfoFlags;
}
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ public class WNDCLASS_D
+ {
+ public int style;
+ public WndProc lpfnWndProc;
+ public int cbClsExtra = 0;
+ public int cbWndExtra = 0;
+ public IntPtr hInstance = IntPtr.Zero;
+ public IntPtr hIcon = IntPtr.Zero;
+ public IntPtr hCursor = IntPtr.Zero;
+ public IntPtr hbrBackground = IntPtr.Zero;
+ public string lpszMenuName = null;
+ public string lpszClassName = null;
+ }
+
[DllImport(Shell32, CharSet = CharSet.Auto)]
[ResourceExposure(ResourceScope.None)]
public static extern int Shell_NotifyIcon(int message, NOTIFYICONDATA pnid);
diff --git a/HandyControlDemo/HandyControlDemo.csproj b/HandyControlDemo/HandyControlDemo.csproj
index 9c659dd1..4231f0f6 100644
--- a/HandyControlDemo/HandyControlDemo.csproj
+++ b/HandyControlDemo/HandyControlDemo.csproj
@@ -189,6 +189,7 @@
NotifyIconDemoCtl.xaml
+
GravatarDemoCtl.xaml