Microsoft Windows CE 3.0  

GetSystemMenu

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 function is implemented as a macro to maintain compatibility with existing code. Use the menu handle returned by this macro to disable the Closebutton. There is no other use for the return value.

HMENU GetSystemMenu(
HWND
hWnd
,
BOOL
bRevert
);

Parameters

hWnd
[in] Handle to the window that will own a copy of the window menu.
bRevert
[in] Boolean that specifies the action to be taken. If this parameter is FALSE, GetSystemMenureturns the handle to the copy of the window menu currently in use. The copy is initially identical to the window menu, but it can be modified.

If this parameter is TRUE, GetSystemMenuresets the window menu back to the default state. The previous window menu, if any, is destroyed.

Return Values

If the bRevertparameter is FALSE, the return value is the handle to a copy of the window menu. If the bRevertparameter is TRUE, the return value is NULL.

Remarks

Use the following code to disable the Closebutton:

EnableMenuItem (GetSystemMenu(hwnd, FALSE),
SC_CLOSE,MF_BYCOMMAND | MF_GRAYED);

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h   Menu.lib
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.