[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  GetSystemMenu( hwnd, lReset )->hSysMenu
------------------------------------------------------------------------------


 PARAMETER:

  <hwnd>       handle that identifies the window to own the system menu

  <lReset>     If this parameter is FALSE, the GetSystemMenu function
               returns a handle of a copy of the System menu currently in
               use. This copy is initially identical to the System menu,
               but can be modified. 
               If the parameter is TRUE, GetSystemMenu resets the System
               menu back to the Windows default state. The previous System
               menu, if any, is destroyed.  The return value is undefined
               in this case. 

 RETURNS:

  <hSysMenu> is the handle of a copy of the System menu, if <lReset> 
  is FALSE or undefined.


 DESCRIPTION:

  The GetSystemMenu function allows the application to access the System
  menu of a window for copying and modification. 
  Any window that does not use GetSystemMenu() to make its own copy of
  the System menu receives the standard System menu. 

  The handle that GetSystemMenu() returns can be used with  AppendMenu or
  InsertMenu to change the System menu. The System menu initially contains
  items identified by 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 identifier numbers less than 0xF000. 

  Windows automatically grays (dims) 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. 


 EXAMPLE:


    +--------------------------------------------------------------+
    |  /* Append an ABOUT Box to the system menu */                |
    |  hmenu := GetSystemMenu( oWnd:hwnd, .F. )                    |
    |  AppendMenu( hmenu, MF_SEPARATOR,0)                          |
    |  AppendMenu( hmenu, MF_STRING, IDM_ABOUT, "About...")        |
    +--------------------------------------------------------------+



 SOURCE:  

  SOURCE\WINAPI\MENUS.C



See Also: AppendMenu InsertMenu
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson