Thread: Modelss independance

  1. #1
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227

    Modelss independance

    How can I make a modeless dialog box in MFC that isn't so tied into the parent? I more or less want the dialog to be completely independant of its parent (although it'd send messages back still). Right now I'm using

    note = new Note();
    note->Create(IDD_NOTE_DIALOG);
    note->ShowWindow(SW_SHOW);

    but when you minimize the original dialog, the new one goes too.


    Any thoughts?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,792

    Re: Modelss independance

    Originally posted by -KEN-
    How can I make a modeless dialog box in MFC that isn't so tied into the parent? I more or less want the dialog to be completely independant of its parent (although it'd send messages back still). Right now I'm using

    note = new Note();
    note->Create(IDD_NOTE_DIALOG);
    note->ShowWindow(SW_SHOW);

    but when you minimize the original dialog, the new one goes too.


    Any thoughts?
    Add a handler on the child dialog for WM_SHOWWINDOW....and do this

    Code:
    void Note::OnShowWindow(BOOL bShow, UINT nStatus) 
    {
    	
    	if(nStatus != SW_PARENTCLOSING)
    		CDialog::OnShowWindow(bShow, nStatus);	
    }

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Ah, thanks a lot, Fordo - works great! ::smoooooch::

Popular pages Recent additions subscribe to a feed