1. There are two methods to close the button in the disallow dialog box.
The first method is implemented by using the number of ModiftMenu () Han:
CMenu * pMenu = this-> GetSystemMenu (FALSE );
PMenu-> ModifyMenu (SC _CLOSE, MF_BYCOMMAND | MF_GRAYED );
The second method is implemented using the EnableMenuItem () Han Number:
CMenu * pMenu = this-> GetSystemMenu (FALSE );
PMenu-> EnableMenuItem (SC _CLOSE, MF_BYCOMMAND | MF_GRAYED );
2. disable the system menu on the floating toolbar.
Create a CToolBar derived class CxxToolBar, and double-click the left button in the new class (CxxToolBar: OnLButtonDblClk (...)) and left-click (CxxToolBar: OnLButtonDown (...)) add the following code to the culvert:
If (IsFloating ())File: // jobThe device is floating
{
CWnd * pMiniFrame;
CWnd * pDockBar;
PDockBar = GetParent ();
PMiniFrame = pDockBar-> GetParent ();
File: // goIn addition to the System Menu
PMiniFrame-> ModifyStyle (WS_SYSMENU, NULL );
File: // heavyPaint Toolbar
PMiniFrame-> ShowWindow (SW_HIDE );
PMiniFrame-> ShowWindow (SW_SHOW );
}
3. Disable window maximization button
Remove the WS_MAXIMIZEBOX style display in the PreCreateWindow () Han number.
BOOL CxxFrameWnd: PreCreateWindow (CREATESTRUCT & cs)
{
Cs. style & = ~ WS_MAXIMIZEBOX;
Return CFrameWnd: PreCreateWindow (cs );
}