This commit is contained in:
Mike Griese
2025-07-08 09:24:39 -05:00
parent a748f653ac
commit cfcaafca03
2 changed files with 3 additions and 8 deletions

View File

@@ -308,12 +308,13 @@ public sealed partial class MainWindow : WindowEx,
// Then hide our HWND, to make sure that the OS gives the FG / focus back to another app
// (there's no way for us to guess what the right hwnd might be, only the OS can do it right)
this.Hide();
PInvoke.ShowWindow(_hwnd, SHOW_WINDOW_CMD.SW_HIDE);
// TRICKY: show our HWND again. This will trick XAML into painting our
// HWND again, so that we avoid the "flicker" caused by a WinUI3 app
// window being first shown
this.Show();
// SW_SHOWNA will prevent us for trying to fight the focus back
PInvoke.ShowWindow(_hwnd, SHOW_WINDOW_CMD.SW_SHOWNA);
// Intentionally leave the window cloaked. So our window is "visible",
// but also cloaked, so you can't see it.

View File

@@ -43,9 +43,3 @@ MessageBox
DwmGetWindowAttribute
DwmSetWindowAttribute
DWM_CLOAKED_APP
EnumWindows
IsWindowVisible
GetClientRect
GetWindowLong
WINDOW_EX_STYLE