From 4179f9f4ece319cb87a57a27fb869b84f041f835 Mon Sep 17 00:00:00 2001 From: Philipp Sumi Date: Sun, 17 Nov 2013 14:54:06 +0000 Subject: [PATCH] FIX Interop using Unicode in order to support for long strings / asian languages. (NTFY-11) git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@182 9f600761-6f11-4665-b6dc-0185e9171623 --- Source/NotifyIconWpf/Interop/NotifyIconData.cs | 4 ++-- Source/NotifyIconWpf/Interop/WinApi.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/NotifyIconWpf/Interop/NotifyIconData.cs b/Source/NotifyIconWpf/Interop/NotifyIconData.cs index 81cf0a6..b169b8e 100644 --- a/Source/NotifyIconWpf/Interop/NotifyIconData.cs +++ b/Source/NotifyIconWpf/Interop/NotifyIconData.cs @@ -10,7 +10,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop /// values of the /// that were defined. /// - [StructLayout(LayoutKind.Sequential)] + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct NotifyIconData { /// @@ -134,7 +134,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop { //we need to set another size on xp/2003- otherwise certain //features (e.g. balloon tooltips) don't work. - data.cbSize = 504; + data.cbSize = 952; // NOTIFYICONDATAW_V3_SIZE //set to fixed timeout data.VersionOrTimeout = 10; diff --git a/Source/NotifyIconWpf/Interop/WinApi.cs b/Source/NotifyIconWpf/Interop/WinApi.cs index 2cb96ea..38e7d6a 100644 --- a/Source/NotifyIconWpf/Interop/WinApi.cs +++ b/Source/NotifyIconWpf/Interop/WinApi.cs @@ -11,7 +11,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop /// /// Creates, updates or deletes the taskbar icon. /// - [DllImport("shell32.Dll")] + [DllImport("shell32.Dll", CharSet = CharSet.Unicode)] public static extern bool Shell_NotifyIcon(NotifyCommand cmd, [In]ref NotifyIconData data);