Skip to content

Commit 55b8a3a

Browse files
authored
Merge pull request #119 from cairoshell/misc-tasks-fixes
Misc tasks fixes
2 parents f8c769c + e3eeb75 commit 55b8a3a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ManagedShell.WindowsTasks/ApplicationWindow.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ private bool getShowInTaskbar()
376376
StringBuilder cName = new StringBuilder(256);
377377
NativeMethods.GetClassName(Handle, cName, cName.Capacity);
378378
string className = cName.ToString();
379-
if (className == "ApplicationFrameWindow" || className == "Windows.UI.Core.CoreWindow")
379+
if (className == "ApplicationFrameWindow" || className == "Windows.UI.Core.CoreWindow" || className == "StartMenuSizingFrame")
380380
{
381381
if ((ExtendedWindowStyles & (int)NativeMethods.ExtendedWindowStyles.WS_EX_WINDOWEDGE) == 0)
382382
{
@@ -587,7 +587,12 @@ public void BringToFront()
587587
}
588588
else
589589
{
590-
NativeMethods.ShowWindow(Handle, NativeMethods.WindowShowStyle.Show);
590+
// If the window is maximized, use ShowMaximize so that it doesn't un-maximize
591+
if (GetWindowShowStyle(Handle) != NativeMethods.WindowShowStyle.ShowMaximized ||
592+
!NativeMethods.ShowWindow(Handle, NativeMethods.WindowShowStyle.ShowMaximized))
593+
{
594+
NativeMethods.ShowWindow(Handle, NativeMethods.WindowShowStyle.Show);
595+
}
591596
makeForeground();
592597

593598
if (State == WindowState.Flashing) State = WindowState.Active; // some stubborn windows (Outlook) start flashing while already active, this lets us stop

0 commit comments

Comments
 (0)