System Commands

An application that has a window menu can change the size and position of that window by sending system commands. System commands are generated when the user chooses commands from the window menu. An application can emulate the user action by sending a WM_SYSCOMMAND message to the window. The following system commands affect the size and position of a window.

Command Description
SC_CLOSE Closes the window. This command sends a WM_CLOSE message to the window. The window carries out any steps needed to clean up and destroy itself.
SC_MAXIMIZE Maximizes the window.
SC_MINIMIZE Minimizes the window.
SC_MOVE Moves the window.
SC_RESTORE Restores a minimized or maximized window to its previous size and position.
SC_SIZE Starts a size command. To change the size of the window, use the mouse or keyboard.