HMENU GetSystemMenu(hwnd, fRevert) | |||||
HWND hwnd; | /* handle of window to own System menu | */ | |||
BOOL fRevert; | /* reset flag | */ |
The GetSystemMenu function allows the application to access the System menu for copying and modification.
hwnd
Identifies the window that will own a copy of the System menu.
fRevert
Specifies the action to be taken. If this parameter is FALSE, the GetSystemMenu function returns the handle of the copy of the System menu currently in use. This copy is initially identical to the System menu, but it can be modified.
If this parameter is TRUE, GetSystemMenu resets the System menu back to the Windows default state. The previous System menu, if any, is destroyed.
If fRevert is FALSE, the return value is the handle of a copy of the System menu. If fRevert is TRUE, the return value is NULL.
Any window that does not use the GetSystemMenu function to make its own copy of the System menu receives the standard System menu.
The handle returned by the GetSystemMenu function can be used with the AppendMenu, InsertMenu, or ModifyMenu functions to change the System menu.
The System menu initially contains items with various identifier values such as SC_CLOSE, SC_MOVE, and SC_SIZE.
Menu items on the System menu send WM_SYSCOMMAND messages.
All predefined System-menu items have identifier numbers greater than 0xF000. If an application adds commands to the System menu, it should use ID numbers less than F000.
Windows automatically grays items on the standard System menu, depending on the situation. The application can carry out its own checking or graying by responding to the WM_INITMENU message, which is sent before any menu is displayed.
AppendMenu, GetMenu, InsertMenu, ModifyMenu