In the system menu (topleft of titlebar), I can add my own menu items.
I can also delete e.g.DeleteMenu(SysMenu, SC_MINIMIZE, MF_BYCOMMAND) ;
However if I delete the standard ones [restore,minimize,maximize,size,close] their functionality is lost (i.e. maximize button no longer works)
Is there a way to hide these menuitems or move them off the first rank of the system menu? a) make them not visible b) move to a submenu c) delete but still get button messages
The API has no concept of a hidden/invisible menu item.
You can move (or rather delete and add) items to a submenu without effecting functionality.
E.g. move "minimize" to a submenu:
Destroy the submenu before restoring the system menu:
If you delete, f.i., the "minimize" item, the system does not send
WM_SYSCOMMAND
messages for the minimize command to the window. So there won't be any command to respond to.You can still listen for button messages, f.i. a left button down. But a button down/up message is not actually the same thing with a button click. A button click consists of three actions, mouse down, capture and up again on the button. If you want to do it anyway an example can be: