LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   regarding vc++ (https://www.linuxquestions.org/questions/programming-9/regarding-vc-26129/)

edreddy 07-19-2002 06:01 AM

regarding vc++
 
how to make modal dialog invisible in vc++

Mik 07-19-2002 08:00 AM

Sorry if I totally got your question wrong. But could you elaborate on what you mean by making it invisible? If I remember correctly modal dialogs where dialogs that require a user to interact with it before they dissapear.

Aren't you the one who controls the creation of such a dialog in your source code. Then why do you want to make it invisible? Isn't the dialog all about interaction with the user? Wouldn't the user need to see the dialog to interact with it?

edreddy 07-19-2002 08:30 AM

EVC++ doubts
 
Thanks Mik,

I am using an application, which demands for
for the invisibility for the Modal dialog.

To be more specific, before making the dialog
visible I am creating a thread which starts listen
on one port. Now My application demands when I start the
application, the modal dialog should not be visible.

I hope This will make u understand
mik! better if you give reply immediately, being it is urgent for me.

Thanks

Mik 07-19-2002 08:55 AM

Well this is what I did in another application to make it's window dissapear. As far as I remember a dialog should be able to handle the same messages. Haven't worked with dialogs in windows in ages.

Anyway this is the command that I used to hide the window:
ShowWindow(hWnd, SW_HIDE);

And this is the command I used to make it reappear:
ShowWindow(hWnd, SW_SHOW);
SetForegroundWindow(hWnd);

The second command is only necessary if you want it to popup to the foreground.

Hope that helps.

concoran 07-31-2002 06:43 PM

Ramakrishna:
Do one thing..
Create an MFC dialog based app. Add msg handler for WM_TIMER.
and see the following code,

/* insert this line in OnInitDialog()
SetTimer(100, 1000, NULL);
*/


bool truth = FALSE;


void CJunkdlgDlg::OnTimer(UINT nIDEvent)
{
if( truth)
{
truth = FALSE;
ShowWindow(SW_HIDE);
}
else
{
truth = TRUE;
ShowWindow(SW_SHOW);
}

CDialog::OnTimer(nIDEvent);
}


All times are GMT -5. The time now is 08:15 AM.