-
September 12th, 2007, 08:08 AM
#1
LoadFrame, but hidden
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?
-
September 12th, 2007, 08:43 AM
#2
Re: LoadFrame, but hidden
Try
if (pFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | ~WS_VISIBLE, NULL,
NULL))
{
if (bShow)
{ pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();
}
}
Move like a snake, think like a snake, be a snake !!!
-
September 12th, 2007, 09:37 AM
#3
Re: LoadFrame, but hidden
Thanks, but this didn't work either. I made a small new demo-project and found that LoadFrame doesn't show the frame by default. I guess somewhere in the code of the 3rd-party-application they are showing the window.
-
April 9th, 2011, 08:19 PM
#4
Re: LoadFrame, but hidden
Sorry to bring this ancient thread again but I have the very same problem and could not figure it out how to get rid of 'blinking' main frame window. Tried PreCreateWindow, ShowWinow(SW_HIDE) but the problem is still there. Any suggestion? Thanks for your time.
-
April 10th, 2011, 03:56 AM
#5
Re: LoadFrame, but hidden
Found it. Before LoadFrame() set m_nCmdShow=bShow?SW_SHOW:SW_HIDE;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|