Add/Remove Commands to/from the Window Menu

A window’s system menu (now called simply window menu) features by default commands like Move, Size or Close. (When the user selects one of these commands a WM_SYSCOMMAND message is sent to the window.) What if you want to remove and add these commands on the fly? Here is how you can do it.

This is how a default Window menu looks for a dialog window.

To remove the Move command:

To add the Move command, you can do something like this (you can also insert it at a specific position, other than 0):

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.