Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modeless dialog box

Status
Not open for further replies.

newbe

Vendor
Apr 23, 2000
7
US
Hello !
Can anyone give me an example or a link with some code with a dialog based application. From aplication must appear a modeless dialog box when i push a button , and the window from where i pushed the button must dissapear. (when i start my program , in fact , appears a window with 2 edit controls (username and password) and a button control.when i put the username and the password , i want to dissapear the first window and i want to appear another window.
)
Can anyone help me with some code or a link with something like that? Thanks a lot.
P.S.I'm very newbe with API
 
Hi.

First call ShowWindow(SW_HIDE) for the parent window.
Second do not use DoModal() for the modeless dialog, but something like this:

CMyDialog *pDlg;

pDlg = new CMyDialog;
if(pDlg->Create(strTitle, pPointerToParent))
{
pDlg->ShowWindow(SW_SHOW);
...
}

But be careful, because to show the main window again you must send a message to the parent window to, and in the handling funtion to call ShowWindow(SW_SHOW).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top