Modelss independance

This is a discussion on Modelss independance within the Windows Programming forums, part of the Platform Specific Boards category; How can I make a modeless dialog box in MFC that isn't so tied into the parent? I more or ...

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

    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,789

    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,230
    Ah, thanks a lot, Fordo - works great! ::smoooooch::

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21