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!!
WM_SIZEmessage even if I setSW_SHOWMINIMIZEDviaShowWindowfunction after the window create like this:ShowWindow(hWnd, SW_SHOWMINIMIZED);But you can't receive correspondingOnSizecall of MFC, is this your issue right? - Rita Hanm_nCmdShow=SW_HIDEin theCAppWndand then later I would do theSetWindowPlacement()and let it do its thing. However, that function sends aSIZE_RESTOREDprior toSIZE_MINIMIZEDwhen usingwp->showCmd=SW_SHOWMINIMIZED;so you get a flash of the window before it goes away (since my OnSize willShowWindow(SW_SHOW)onSIZE_RESTOREDif hidden). Not sure if a trick to get around that? - df234987ShowWindow(SW_SHOW)onSIZE_RESTOREDwhen not visible and it still ended up showing the window and now without the flash. So I'm good now! - df234987