diff --git a/src/Shared/HandyControl_Shared/Controls/Growl/GrowlWindow.cs b/src/Shared/HandyControl_Shared/Controls/Growl/GrowlWindow.cs index 0e2646cb..035e6f9d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Growl/GrowlWindow.cs +++ b/src/Shared/HandyControl_Shared/Controls/Growl/GrowlWindow.cs @@ -1,5 +1,8 @@ -using System.Windows; +using System; +using System.Windows; using System.Windows.Controls; +using HandyControl.Tools; +using HandyControl.Tools.Interop; namespace HandyControl.Controls { @@ -33,5 +36,8 @@ namespace HandyControl.Controls Left = desktopWorkingArea.Right - Width; Top = 0; } + + protected override void OnSourceInitialized(EventArgs e) + => InteropMethods.IntDestroyMenu(this.GetHwndSource().CreateHandleRef()); } } diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs index aa70a0fb..41fcb946 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs @@ -97,6 +97,10 @@ namespace HandyControl.Tools.Interop [DllImport(InteropValues.ExternDll.User32)] internal static extern bool InsertMenu(IntPtr hMenu, int wPosition, int wFlags, int wIDNewItem, string lpNewItem); + [DllImport(InteropValues.ExternDll.User32, ExactSpelling = true, EntryPoint = "DestroyMenu", CharSet = CharSet.Auto)] + [ResourceExposure(ResourceScope.None)] + internal static extern bool IntDestroyMenu(HandleRef hMenu); + [SecurityCritical] [SuppressUnmanagedCodeSecurity] [DllImport(InteropValues.ExternDll.User32, SetLastError = true, ExactSpelling = true, EntryPoint = nameof(GetDC),