dembowskis
asked on
Disabling close button on CMDIChildWnd
I am writing a MDI application that has multiple document templates. On start up, there is one document type that I want to open and not let the user close/destroy. I want to disable the close button (X) in the corner of the CMDIChildWnd. I have seen how to use PreCreateWindow to change the style for the minimize and maximize controls; but I haven't figured out how to disable the close.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Your response would ignore the SC_CLOSE, but my question was how do I -DISABLE- the close button. Researching the information on WM_SYSCOMMAND and SC_CLOSE got me on the GetSysMenu method and the following solution, which I placed in the OnActivateMdiFrame:
CMenu *lwSysMenu = GetSystemMenu( FALSE );
lwSysMenu->EnableMenuItem(
Thank you!!