I want to remove the Move and Close commands from the system menu in a Windows dialog-based application without losing the functionality of those commands or removing the system menu. (I'm using MFC, but open to a pure c++ solution.)
The following will remove the Move command from the system menu:
CMenu* pSysMenu = GetSystemMenu(FALSE);
if(pSysMenu != NULL)
pSysMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);
But the window can no longer be dragged.
Similarly, this will remove the Close command.
pSysMenu->RemoveMenu(SC_CLOSE, MF_BYCOMMAND);
But it also disables the close button ("x") in the window's title bar.
Thanks!
(I know a few of you are tempted to tell me I shouldn't remove those commands. I hear you, but this is a unique situation. Thanks.)