Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I want to hide CDialog when application is started and show that in my other thread when some conditions meet.

I tried the following ways, but didn't work.

- Call ShowWindow(SW_HIDE) at the end of OnInitDialog
- Call m_pMainWnd->ShowWindow(SW_HIDE) in CMyApp::InitInstance() before calling dlg.doModal().

Thanks.
Paul.
Posted

Maybe this [^] link will help.
 
Share this answer
 
There are a couple of approaches to this. I just saw Solution 1 which has a link I was just about to post along with the ones below.

Hide / Minimize a Dialog on Startup[^]
http://bobmoore.mvps.org/Win32/w32tip26.htm[^]

Soren Madsen
 
Share this answer
 
You just should call the function in 'OnPaint'.Like this:

C++
if (bHide) //Initialize 'bHide' as TRUE in constructor
{
    ShowWindow(SW_HIDE);
}
else
{
    ShowWindow(SW_SHOW);
}


In your thread,you can do this:

C++
bHide = FALSE;
Invalidate();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900