Cant seem to change the owner of my dialog
Jeff Lindholm -- JeffL@inter-intelli.com Friday, December 20, 1996 Environment: VC++ 4.2b, Win 95, NT 4.0 I am creating a dialog in its constructor. I am passing NULL as the parent in both the CDialog constructor and the Create call. The dialog has no parent, but is still 'owned' by my main window. This is a pain since I want to be able to bring the owner's window on top of the child window. The styles are Popup and Sizable frame. I have tried Overlapped Window, but to no avail. If anyone has any insights I would appreciate them. Thanks Jeff
Mike Blaszczak -- mikeblas@nwlink.com Saturday, December 21, 1996 [Mini-digest: 2 responses] At 10:54 12/20/96 -0500, Lindholm, Jeff wrote: >Environment: VC++ 4.2b, Win 95, NT 4.0 >I am creating a dialog in its constructor. I am passing NULL as the >parent in both the CDialog constructor and the Create call. The dialog >has no parent, but is still 'owned' by my main window. This is a pain >since I want to be able to bring the owner's window on top of the child >window. The styles are Popup and Sizable frame. I have tried Overlapped >Window, but to no avail. If anyone has any insights I would appreciate >them. As the documentation states, NULL means that you want the dialog to be parented to your application's main window. If you want it to have no parent at all, you can do so (effectively) by parenting it to the desktop window. See the CWnd::GetDesktopWindow() function. .B ekiM http://www.nwlink.com/~mikeblas/ I'm afraid I've become some sort of speed freak. These words are my own. I do not speak on behalf of Microsoft. -----From: Marty FriedAt 10:54 AM 12/20/96 -0500, Lindholm, Jeff wrote: >Environment: VC++ 4.2b, Win 95, NT 4.0 > >I am creating a dialog in its constructor. I am passing NULL as the >parent in both the CDialog constructor and the Create call. The dialog >has no parent, but is still 'owned' by my main window. This is a pain >since I want to be able to bring the owner's window on top of the child >window. The styles are Popup and Sizable frame. I have tried Overlapped >Window, but to no avail. If anyone has any insights I would appreciate >them. With MFC, passing NULL as the parent automatically makes the main window the parent. The only way I know to accomplish what you want is to pass the desktop window as the parent (use GetDesktopWindow function). You will have to do a little extra work to make sure the window gets destroyed correctly, since only descendants of the main window get destroyed automatically. ________________________________ Marty Fried (mfried@linex.com) Marin County, California
| Вернуться в корень Архива |