Whenever the user chooses a command from a menu, Windows sends a menu-input message to the window function for that window.
There are two types of menu-input messages:
WM_SYSCOMMAND, which indicates that the user has selected a command from the System menu.
WM_COMMAND, which indicates that the user has selected a command from the application's menu.
Since menu input is often the primary source of input for an application, its processing can be complex. For more information on menus and menu input, see Chapter 19, “Menus.”