MDI Child Frame with no system exit button

I have a MDI application in which I have multiple views.  However upon loading the application a default view is displayed and I don't want the user to be able to close this view.  Is it possible to remove the "x" exit button from the frame?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You might better override the OnClose() method (perhaps in the CMDIChildWnd derived class) and check to see if the current view is the one you want, and if so, do not allow the close processing to continue (don't call the base class OnClose() )...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Yes change the Child View
Style to WM_NOCLOSE.

May be by overloading PreCreateWindow

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    // Create a window without min/max buttons or sizable border = WS_OVERLAPPED | WS_SYSMENU | WS_BORDER | WM_NOCLOSE;

    // Size the window to 1/3 screen size and center it = ::GetSystemMetrics(SM_CYSCREEN) / 3; = ::GetSystemMetrics(SM_CXSCREEN) / 3;
    cs.y = (( * 3) - / 2;
    cs.x = (( * 3) - / 2;

    // Call the base-class version
    return CFrameWnd::PreCreateWindow(cs);

leigh2Author Commented:
This method was a good idea but unfortunately did not work.  Thanks for your help anyways.  You cannot create a child with ~WM_CLOSE.

                    Regards, Leigh
leigh2Author Commented:
Thanks this looks like it will work fine.  Do you know how I could tell what window not to close?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.