Hello. I have a 3rd-party MFC-app. I thought this was a simple task: I want to run the app with the main-window hidden.

So I want to CTheApp::InitInstance() where the main-window is created:
Code:
if (pFrame->LoadFrame(IDR_MAINFRAME,
		WS_OVERLAPPEDWINDOW, NULL, 
		NULL))
	{
		if (bShow)
		{      pFrame->ShowWindow(SW_SHOW);
			pFrame->UpdateWindow();
		}
		else
			pFrame->ShowWindow(SW_HIDE);
	}
Depending on bShow, the window should be visible or hidden.

This works in general, but LoadFrame shows the window and ShowWindow(SW_HIDE) is hiding it again, so that the user sees the window for a short time. How is it possible to hide the window from the start?