mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix #1771
This commit is contained in:
@@ -23,6 +23,7 @@ internal sealed class NotifyIconXamlHostWindow : Window, IWindowNeedEraseBackgro
|
||||
Content = new Border();
|
||||
|
||||
this.SetLayered();
|
||||
this.SetToolWindow();
|
||||
|
||||
AppWindow.Title = "SnapHutaoNotifyIconXamlHost";
|
||||
AppWindow.IsShownInSwitchers = false;
|
||||
|
||||
@@ -97,6 +97,14 @@ internal static class WindowExtension
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetToolWindow(this Window window)
|
||||
{
|
||||
HWND hwnd = (HWND)WindowNative.GetWindowHandle(window);
|
||||
nint style = GetWindowLongPtrW(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE);
|
||||
style |= (nint)WINDOW_EX_STYLE.WS_EX_TOOLWINDOW;
|
||||
SetWindowLongPtrW(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, style);
|
||||
}
|
||||
|
||||
public static unsafe void BringToForeground(this Window window)
|
||||
{
|
||||
HWND fgHwnd = GetForegroundWindow();
|
||||
|
||||
Reference in New Issue
Block a user