Does anyone know how to disable the close x in the upper right corner? I havent found any information on this
thanks
Rich
Printable View
Does anyone know how to disable the close x in the upper right corner? I havent found any information on this
thanks
Rich
You could simply override OnCancel() to do nothing.
Howard
I guess I left something out... This is a modeless dialog and OnCancel doesnt seem to get called if you click on the X. I have a busy state where a thread has to be shut down before exiting.
Try trapping WM_CLOSE (OnClose).
Put in a handler for WM_CLOSE
and do not call the default base class handler.
All replies are good. But without gray the X button, the app won't look professional. The function DrawFrameControl() may help.
xiaolong wu
Put this into yoour dialogs OnInitDialog function...
CMenu* sysMenu = this->GetSystemMenu(FALSE);
sysMenu->EnableMenuItem(SC_CLOSE, MF_GRAYED);
How about disabling the Title bar check box on the dialog property...(system menu)... so all you would have is the dialogue without anything on top
Thanks, it works like a charm...