Skip to content

Latest commit

 

History

History
60 lines (43 loc) · 1.71 KB

InsertMenuItem.md

File metadata and controls

60 lines (43 loc) · 1.71 KB

Home

Function name : InsertMenuItem

Group: Menu - Library: user32


The InsertMenuItem function inserts a new menu item at the specified position in a menu.


Code examples:

Attaching menu to a top-level form
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Shortcut Menu Class
Adding user-defined items to the Control Menu of VFP form (requires VFP9)

Declaration:

BOOL InsertMenuItem(
  HMENU hMenu,           // handle to menu
  UINT uItem,            // identifier or position
  BOOL fByPosition,      // meaning of uItem
  LPCMENUITEMINFO lpmii  // menu item information
);  

FoxPro declaration:

DECLARE INTEGER InsertMenuItem IN user32;
	INTEGER   hMenu,;
	INTEGER   uItem,;
	INTEGER   fByPosition,;
	STRING  @ lpmii
  

Parameters:

hMenu [in] Handle to the menu in which the new menu item is inserted.

uItem [in] Identifier or position of the menu item before which to insert the new item. The meaning of this parameter depends on the value of fByPosition.

fByPosition [in] Value specifying the meaning of uItem. If this parameter is FALSE, uItem is a menu item identifier. Otherwise, it is a menu item position.

lpmii [in] Pointer to a MENUITEMINFO structure that contains information about the new menu item.


Return value:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.