File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/ManagedShell.WindowsTasks Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments