Click to See Complete Forum and Search --> : Hide a modal Dialog


DiDi
May 6th, 1999, 01:56 AM
I tried to Hide a Modal-Dialog in his OnInitDialog-Function (with ShowDialog(SW_HIDE) but it didnt work. I tried some other things like setting the Size to 0,0,0,0 or clearing the visible flag in his Properties but the Dialog ignored it. Why ???
Is there a possibility to hide the Dialog at the Moment of creating without using a Timer or so ?

shridhar rao
May 6th, 1999, 03:52 AM
Use ShowWindow(SW_HIDE) in the OnPaint. If you want to activate it later then have a condition in the OnPaint so that the ShowWindow is not called everytime
CMyDialog::OnPaint()
{
if(bCanShow == FALSE)
{
ShowWindow(SW_HIDE);
}
}
I hope this helps
regs
Rao

DiDi
May 6th, 1999, 04:46 AM
Thanks for your Answer!!!

But what is the reason that it dont work in the OnInitDialog ??

reg DiDi