In CWinApp::InitInstance()
I have:
if (!ProcessShellCommand(cmdInfo))
return FALSE;
m_pMainWnd->ShowWindow(m_MinimizeOnStartup ? SW_SHOWMINIMIZED : SW_SHOWNORMAL);
m_pMainWnd->UpdateWindow();
But my ShowWindow call is not resulting in an OnSize()
or OnShowWindow()
callback? During the ProcessShellCommand()
those are called a few times as the first OnShowWindow()
restores the window size when last shutdown via SetWindowPlacement()
. That all works good, restoring to last state, but ProcessShellCommand()
afterwards calls ShowWindow
with SW_SHOW
which causes a my hidden when minimized window to show on the taskbar. Where is the proper place to either show the window or minimize it (to hide it). Basically what happens is the minimize comes in (on SetWindowPlacement()
, window is hidden, MFC
later calls SW_SHOW
which makes it minimized on the taskbar instead of hidden, my forced ShowWindow()
doesn't do anything.
TIA!!