Explorer seems to always start my application with SW_MAXIMIZE
(STARTF_USESHOWWINDOW
is set in STARTUPINFO.dwFlags
). I know that ShowWindow
will use this value the first time you/Windows needs to display a window but it has the unfortunate consequence of maximizing a window that should never be maximized.
My window is created with CreateDialogIndirectParam
and has the following styles: WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPCHILDREN|DS_MODALFRAME|DS_CENTER|WS_VISIBLE
. Why does ShowWindow
not check if WS_MAXIMIZEBOX
is set before allowing STARTF_USESHOWWINDOW
to force SW_MAXIMIZE
? Is this a bug in Windows?
This happens on a HP Stream 7 with Windows 8.1. I'm not sure if Explorer does this because it is touch enabled or because of the small screen.
Is this Explorer behavior documented anywhere and is there a way to turn it off? What is the best way to stop Explorer (or any other parent process) from affecting my initial window mode? (I don't want to block people starting me with SW_*MINIMIZE*
)
WinVer.exe in system32 has the same problem: