Microsoft Windows CE 3.0  

WM_SYSCOMMAND

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This message is sent to a window when the user chooses a command from the windowmenu, formerly known as the system or control menu, or when the user chooses the maximize button or the minimize button.

WM_SYSCOMMAND
uCmdType= 
wParam; 
xPos= 
LOWORD(
lParam); 
yPos= 
HIWORD(
lParam);

Parameters

uCmdType
Specifies the type of system command requested. It is one of the following values.
Value Description
SC_CLOSE Closes the window.
SC_KEYMENU Retrieves the windowmenu as a result of a keystroke.
xPos
Specifies the horizontal position of the cursor, in screen coordinates, if a windowmenu command is chosen with the mouse. Otherwise, the xPosparameter is not used.
yPos
Specifies the vertical position of the cursor, in screen coordinates, if a windowmenu command is chosen with the mouse. This parameter is –1 if the command is chosen using a system accelerator, or zero if using a mnemonic.

Return Values

An application should return zero if it processes this message.

Remarks

The DefWindowProcfunction carries out the windowmenu request for the predefined actions specified in the previous table.

In WM_SYSCOMMAND messages, the four low-order bits of the uCmdTypeparameter are used internally by the system. To obtain the correct result when testing the value of uCmdType, an application must combine the value 0xFFF0 with the uCmdTypevalue by using the bitwise ANDoperator.

The menu items in a windowmenu can be modified by using the GetSystemMenu, AppendMenu, InsertMenu, InsertMenuItem, and SetMenuItemfunctions. Applications that modify the windowmenu must process WM_SYSCOMMAND messages.

An application can carry out any system command at any time by passing a WM_SYSCOMMAND message to DefWindowProc. Any WM_SYSCOMMAND messages not handled by the application must be passed to DefWindowProc. Any command values added by an application must be processed by the application and cannot be passed to DefWindowProc.

Accelerator keys that are defined to choose items from the windowmenu are translated into WM_SYSCOMMAND messages; all other accelerator keystrokes are translated into WM_COMMANDmessages.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

AppendMenu, DefWindowProc, GetSystemMenu, InsertMenu, WM_COMMAND