|
-
April 16th, 1999, 04:23 PM
#4
Re: Starting a dialog minimized or hidden: how can I do it?
I don't know exactly how I did it, but I had the same problem, and after some queries I got some answers that basically helped me.
In my dialog based application I've got a function called DisplayWindow and a function called OnWindowPosChanging.
These functions look like
void MyDialog: isplayWindow(BOOL bShow)
{
if (bShow) {
m_bVisible = TRUE;
ShowWindow(SW_SHOWNORMAL);
}
else {
m_bVisible = FALSE
ShowWindow(SW_HIDE);
}
}
void MyDialog::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{
if (!m_bVisible) lpwndpos->flags &= ~SWP_SHOWWINDOW;
CDialog::OnWindowPosChanging(lpwndpos)
}
In my OnInitDialog member function I simply call DisplayWindow(FALSE) to hide the dialog upon startup.
Obviously, you have to declare m_bVisible as a variable of your MyDialog class.
Hope this helps,
Regards,
Rob
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
|