PWB Extensions Help (ext.hlp) (Table of Contents; Topic list)
AddMenuItem
                                             Up Contents Index Back
─────PWB Extensions─────────────────────────────────────────────────────────
 
  Syntax:  int AddMenuItem( int idMenu,
                            char far *Name,  char far *Help,
                            char far *Topic, char far *Command );
 
  Returns: ID for the menu item if space is available, otherwise -1.
 
  See:     AddMenu, ChangeMenu, CheckPwbMenuItem, EnablePwbMenuItem,
           IdAddPwbMenuItem, IdFindPwbMenuItem, RecordPwbMenuItem,
           SetPwbMenuItemTitle, SetPwbMenuItemCommand
 
     This function is provided only for compatibility with PWB 1.x
     extensions. New PWB extensions should use IdAddPwbMenuItem and
     associated PwbMenu functions to create and modify menus and menu
     items.
 
     AddMenuItem adds a new menu item at the end of a menu.
 
     Argument   Description
 
     <idMenu>   The ID of a new menu as returned by AddMenu, or an ID
                returned by IdFindPwbMenuItem.
 
     <Name>     Name of the menu item. By default, the first letter of
                the name is the highlighted access character, but you
                can specify a different access character by preceding it
                with a tilde (~).
 
     <Help>     Text displayed on the status bar when the item is
                selected.
 
     <Topic>    Help lookup string for the item. This can be a Help
                topic in one of the Microsoft Help files or in a custom
                Help file.
                See: Creating Help Files with HELPMAKE
 
     <Command>  Name of the command that is executed when you choose the
                menu item. The name can be a predefined PWB editor
                function or macro, a function defined by an extension,
                or a macro.
 
     When <command> has one or more keys associated with it, one of the
     key names is right-aligned on the menu. For example, if the
     Lastselect function is assigned to ALT+L and you put it on a menu
     item called 'Last Selection', the item appears on the screen as:
 
          │ Last Selection    Alt+L │
 
     The actual appearance varies, depending on the lengths of other
     menu items.
 
     You can add a separator bar by specifying a dash character string
     (ASCII 45) as <name> and empty strings for the last three
     arguments. For example:
 
          AddMenuItem( hMenu, "-", "", "", "" );  // Separator bar
                                    -♦-