Click to See Complete Forum and Search --> : MDI window question


Wayne Fuller
August 12th, 1999, 03:09 PM
In order to simualate a MDI application within a MDI application, I had to create the windows myself and keep track of them. No problem, works great, sort of. I am sure learning to appreciate what MFC does for the programmer.

Can anybody answer some or all of the following questions?

1) When I click on a child window, how to make it appear topmost? I have tried BringWindowToTop(), RedrawWindow().
2) How to activate the child window to redraw the caption bar the active color?
3) Any other question that could be asked to deal with multiple windows that I will have to take care of myself.

Any help would be very appreciated,

Wayne

Martin Speiser
August 13th, 1999, 01:45 AM
Hi Wayne,

sorry, but I can only help you with the second question. If you send a WM_NCACTIVATE message to the child window it should repaint his title bar.

Martin

Tomaso Tonelli
August 13th, 1999, 02:21 AM
If you want send the CMDIChildWnd at the topmost you can use

pFrame->MDIActivate();

where pFrame cane be recoverde using:

CMDIChildWnd* pFrame= (CMDIChildWnd*)pView->GetParent();

Wayne Fuller
August 13th, 1999, 05:38 AM
Thanks for the response. But they are not CMDIChildWnds they are just CWnd objects. I tried to use CMDIChildWnd but they have to reside inside CMDIFrameWnd, or MFC goes nuts.

Wayne Fuller
August 13th, 1999, 05:41 AM
Thanks for the response. After my initial post, I played around with a few window styles. I think I am now getting the results that I want.