HiWord (WPARAM): Select the flag. LPARAM: The menu handle containing the menu item. This message is a menu tracking message. The value of WPARAM's low word tells you that the current selection is the menu item (the menu item will be highlighted); the value of the WPARAM's high word is "Select Sign", which can be a combination of the following flags: MF_GRAYED, MF_DISABED , MF_CHECKED, MF_BITMAP, MF_POPUP, MF_HELP, MF_SYSMENU, and MF_MOUSESELECT. If you want to implement Office 2003 menu, you need to work in this message, such as redraw this menu item. (3) WM_INITMENUPOPUP menu message. When Windows is ready to display a pop-up menu, it will send this message to the application's window process. If you need to enable or disable some menu items before displaying the pop-up menu, we need to handle this message. This message has the following parameters: WPARAM: Pop-up menu handle. Loword (LPARAM): Pop-up menu index. HiWord (LPARAM): The system menu is 1, the other is 0. If you want to implement Office 2003 menu, you also need to do some processing when this message is generated, such as heavy-in pop-up menus, making it a menu of office 2003. (4) WM_COMMAND menu message. This menu message is the most important, which means that the user has selected (click) an enabled menu item. For menus items that are not enabled, Windows will not send the message to the window process. The WM_COMMAND message can also be generated by sub-window control, but they are different, the specific: Loword (WPARAM): If it is a menu, it is a menu ID; if the sub-window control is controlled, the control ID is controlled. HiWord (WPARAM): If it is a menu, it is 0; if it is a sub-window control, it is a notification code. LPARAM: If it is a menu, it is 0; if it is a sub-window control, the handle of the sub-window. (5) WM_SYSCOMMAND menu message. It is generated when the user is selected from the system menu (click) a menu item. This message has the following parameters: WPARAM: Menu ID. LPARAM: 0. If the WM_SYSCOMMAND message is generated by the mouse button, then Loword (LPARAM) and HiWord (LPARAM) will contain the screen coordinates X and Y in the location of the mouse pointer. Menu ID indicates which item in the system menu is selected (click). For the ID of the original menu item in the system menu, you should shield the low 4 bits by "and" operation through and 0xFFF0, so that the result value should be one of the following: sc_size, sc_move, sc_minimize, sc_maximize, sc_nextwindow, sc_prevwindow , Sc_close, sc_vscroll, sc_hscroll, sc_arrange, sc_restore, and sc_tasklist, which represent the specific system menu item. In addition, the value of WPARAM can also be SC_MOUSEMENU or SC_KEYMENU. If you add a custom menu item in the System menu, WPARD (WPARAM) is the ID of your custom system menu item. In order to avoid conflicts with the id of the original menu item in the system menu, the application should use the value of less than 0xF000 as a custom system menu item ID. (6) WM_MENUCHAR menu message.