Partager via


GetSystemMenu

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function is implemented as a macro to maintain compatibility with existing code. Use the menu handle returned by this macro to disable the Close button. There is no other use for the return value.

Syntax

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 value of TRUE if GetSystemMenu is to reset the window menu to the default state and destroy the previous window menu, if any. If this parameter is FALSE, GetSystemMenu returns the handle to the copy of the window menu currently in use. The copy is initially identical to the windowmenu, but it can be modified.

Return Value

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

Remarks

Use the following code to disable the Close button.

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

Requirements

Header winuser.h
Library Menu.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Menus Functions