Menu operations
[Window creating/destroying]

Data Structures

Typedefs

Functions


Typedef Documentation

typedef struct _MENUITEMINFO MENUITEMINFO

Structure defines a menu item


Function Documentation

int GUIAPI CheckMenuRadioItem ( HMENU  hmnu,
int  first,
int  last,
int  checkitem,
UINT  flag 
)

Checks a specified menu item and makes it a radio item.

This function checks a specified menu item and makes it a radio item. At the same time, the function unchecks all other menu items in the associated group and clears the radio-item type flag for those items.

Parameters:
hmnu The handle to the menu.
first The position of the first item in the group.
last The position of the last item in the group.
checkitem The position of the menu item to check.
flag Indicates the position base, can be one of the following values:

  • MF_BYCOMMAND
    The position value item is based on the command identifier.
  • MF_BYPOSITION
    The position value item is based on the position in the menu.
Returns:
The function returns 0 for success, non-zero for failure.
See also:
SetMenuItemInfo, MENUITEMINFO
HMENU GUIAPI CreateMenu ( void   ) 

Creates an empty menu.

This function creates a menu. The menu is initially empty, but it can be filled with menu items by using the InsertMenuItem functions.

Returns:
The handle to the menu, zero when error.
See also:
InsertMenuItem
HMENU GUIAPI CreatePopupMenu ( PMENUITEMINFO  pmii  ) 

Creates a drop-down menu or submenu.

This function creates a drop-down menu or submenu. The menu is initially empty. You can insert or append menu items by using the InsertMenuItem function.

Parameters:
pmii Menu item information used to create the popup menu.
Returns:
The handle to the popup menu.
See also:
InsertMenuItem, MENUITEMINFO
HMENU GUIAPI CreateSystemMenu ( HWND  hwnd,
DWORD  dwStyle 
)

Creates a system menu.

This function creates a system menu for the main window specified by hwnd.

Parameters:
hwnd The handle to the main window.
dwStyle The style of the main window.
Returns:
The handle to the system menu.
See also:
CreateMenu, CreatePopupMenu
int GUIAPI DeleteMenu ( HMENU  hmnu,
int  item,
UINT  flag 
)

Deletes an item from the specified menu.

This function deletes an item from the specified menu hmnu. Either the item is a normal menu item or a submenu, this function will delete the item.

Parameters:
hmnu The handle to the menu.
item The position of the menu item or submenu.
flag Indicates the position base, can be one of the following values:

  • MF_BYCOMMAND
    The position value item is based on the command identifier.
  • MF_BYPOSITION
    The position value item is based on the position in the menu.
Returns:
The function returns 0 for success, non-zero for failure.
Return values:
ERR_INVALID_HANDLE hmnu is not a handle to menu.
ERR_INVALID_HMENU hmnu is an invalid menu.
See also:
InsertMenuItem, RemoveMenu
int GUIAPI DestroyMenu ( HMENU  hmnu  ) 

Destroys the specified menu and frees any memory that the menu occupies.

This function destroys the specified menu hmnu and frees any memory that the menu occupies.

Parameters:
hmnu The handle to the menu.
Returns:
The function returns 0 for success, non-zero for failure.
Return values:
ERR_INVALID_HANDLE hmnu is not a handle to menu.
See also:
RemoveMenu, DeleteMenu
void GUIAPI DrawMenuBar ( HWND  hwnd  ) 

Redraws the menu bar of the specified main window.

This function redraws the menu bar of the specified main window. If the menu bar changes after the system has created the window, this function must be called to draw the changed menu bar.

Parameters:
hwnd The handle to the main window.
See also:
TrackMenuBar
UINT GUIAPI EnableMenuItem ( HMENU  hmnu,
int  item,
UINT  flag 
)

Enables, disables, or grays the specified menu item.

This function enables, disables, or grays the specified menu item.

Parameters:
hmnu [in] Handle to the menu.
item [in] Specifies the menu item or submenu to be enabled, disabled, or grayed, as determined by the flag parameter. This parameter specifies an item in a menu bar, menu or submenu.
flag [in] Controls the interpretation of the item parameter and indicates whether the menu item is enabled, disabled, or grayed. This parameter must be a combination of either MF_BYPOSITION or MF_BYCOMMAND.
Returns:
The return value specifies the previous state of the menu item. If the menu item does not exist, the return value is -1.
See also:
GetMenuItemInfo
HMENU GUIAPI GetMenu ( HWND  hwnd  ) 

Retrieves the handle to the menu assigned to the given main window.

This function retrives the handle to the menu assigned to the given main window hwnd.

Parameters:
hwnd The handle to the main window.
Returns:
The handle to the menu of the window.
See also:
SetMenu
HMENU GUIAPI GetMenuBarItemRect ( HWND  hwnd,
int  pos,
RECT prc 
)

Retrieves the rect of a menu bar item.

This function retrieves the rect of the menu bar item specified by the parameter pos.

Parameters:
hwnd The handle to the main window.
pos The position of the item. The position value of the first item is 0.
prc The pointer to a RECT object, which will receive the rectangle.
Returns:
The function returns the handle to the menu bar if success, otherwise returns 0.
See also:
TrackMenuBar
int GUIAPI GetMenuItemCount ( HMENU  hmnu  ) 

Determines the number of items in a menu.

This function determines the number of items in the specified menu hmnu.

Parameters:
hmnu The handle to the menu.
Returns:
The number of the items in the menu.
See also:
GetMenuItemInfo
int GUIAPI GetMenuItemID ( HMENU  hmnu,
int  pos 
)

Retrieves the menu item identifier of a menu item at specified position in a menu.

This function retrieves the menu item identifier of a menu item at the specified position pos in the specified menu hmnu.

Parameters:
hmnu The handle to the menu.
pos The position of the menu item. The position value of the first item is 0.
Returns:
The identifier of the items in the menu.
See also:
GetMenuItemInfo
int GUIAPI GetMenuItemInfo ( HMENU  hmnu,
int  item,
UINT  flag,
PMENUITEMINFO  pmii 
)

Retrieves information about a menu item.

This function retrieves information about a menu item, and returns the information via pmii.

Parameters:
hmnu [in] Handle to the menu that contains the menu item.
item The position of the menu item or submenu.
flag Indicates the position base, can be one of the following values:

  • MF_BYCOMMAND
    The position value item is based on the command identifier.
  • MF_BYPOSITION
    The position value item is based on the position in the menu.
pmii [in, out] Pointer to a MENUITEMINFO structure that specifies the information to retrieve and receive information about the menu item.
Returns:
The function returns 0 for success, non-zero for failure.
See also:
SetMenuItemInfo, MENUITEMINFO
HMENU GUIAPI GetPopupSubMenu ( HMENU  hpppmnu  ) 

Retrieves the submenu of the specified popup menu.

This function retrieves the submenu of the specified popup menu.

Parameters:
hpppmnu The handle to the popup menu.
Returns:
The handle to the submenu of the popup menu.
See also:
CreatePopupMenu
HMENU GUIAPI GetSubMenu ( HMENU  hmnu,
int  pos 
)

Retrieves the handle to the submenu activated by the specified menu item.

This function retrieves the handle to the drop-down menu or submenu activated by the specified menu item.

Parameters:
hmnu The handle to the menu.
pos The position of the menu item. The position value of the first item is 0.
Returns:
The handle to the submenu; 0 if the menu item can not activate a submenu.
See also:
GetPopupSubMenu
HMENU GUIAPI GetSystemMenu ( HWND  hwnd,
BOOL  flag 
)

Allows the application to access the window menu (also known as the system menu) for copying and modifying.

This function returns the handle to the system menu of the main window. This allows the application to access the window menu (also known as the system menu) for copying and modifying.

Parameters:
hwnd The handle to the main window.
flag Ignored currently; reserved for future use.
Returns:
The handle to the system menu; 0 if the main window has not a system menu.
See also:
GetMenu, SetMenu
BOOL GUIAPI HiliteMenuBarItem ( HWND  hwnd,
int  pos,
UINT  flag 
)

Draws the specified menubar item with 3D effect.

This function draws the specified menubar item with 3D effect.

Parameters:
hwnd The handle to the main window.
pos The position of the item. The position value of the first item is 0.
flag The drawing flag, can be one of the following values:

  • LFRDR_MENU_STATE_HILITE
    hilite item.
  • LFRDR_MENU_STATE_NORMAL
    normal item.
  • LFRDR_MENU_STATE_DISABLED
    disabled item.
Returns:
TRUE on success, otherwise FALSE.
See also:
TrackMenuBar
int GUIAPI InsertMenuItem ( HMENU  hmnu,
int  item,
UINT  flag,
PMENUITEMINFO  pmii 
)

Inserts a new menu item at the specified position in a menu.

This function inserts a new menu item specified by pmmi at the specified position (determined by item and flag) in the menu hmnu.

Parameters:
hmnu The handle to the menu.
item The insertion position.
flag Indicates the position base, can be one of the following values:

  • MF_BYCOMMAND
    The position value item is based on the command identifier. The new menu item will insert bellow the item whose id is item.
  • MF_BYPOSITION
    The position value item is based on the position in the menu.
pmii Menu item information used to create the popup menu.
Returns:
The function returns 0 for success, non-zero for failure.
Return values:
ERR_INVALID_HANDLE hmnu is not a handle to menu.
ERR_RES_ALLOCATION Can not allocate new menu item.
ERR_INVALID_HMENU hmnu is an invalid menu.
See also:
RemoveMenu, MENUITEMINFO
int GUIAPI IsMenu ( HMENU  hmnu  ) 

Determines whether a handle is a menu handle.

This function determines whether the handle specified by hmnu is a menu handle.

Parameters:
hmnu The handle to a menu.
Returns:
The function returns 0 for none menu handle, otherwise the type of the menu.
See also:
CreateMenu
int GUIAPI RemoveMenu ( HMENU  hmnu,
int  item,
UINT  flag 
)

Deletes a menu item or detaches a submenu from the specified menu.

This function deletes a menu item or detaches a submenu from the specified menu hmnu. If the item is a normal menu item, the function will delete the item. If the item is a submenu, the function will detache the submenu for the menu, but not delete the submenu.

Parameters:
hmnu The handle to the menu.
item The position of the menu item or submenu.
flag Indicates the position base, can be one of the following values:

  • MF_BYCOMMAND
    The position value item is based on the command identifier.
  • MF_BYPOSITION
    The position value item is based on the position in the menu.
Returns:
The function returns 0 for success, non-zero for failure.
Return values:
ERR_INVALID_HANDLE hmnu is not a handle to menu.
ERR_INVALID_HMENU hmnu is an invalid menu.
See also:
InsertMenuItem, DeleteMenu
HMENU GUIAPI SetMenu ( HWND  hwnd,
HMENU  hmnu 
)

Assigns a new menu to the specified main window.

This functionn assigns the specified menu hmnu to the main window specified by hwnd.

Parameters:
hwnd The handle to the main window.
hmnu The handle to the new menu.
Returns:
The handle to the old menu of the window.
See also:
GetMenu
int GUIAPI SetMenuItemBitmaps ( HMENU  hmnu,
int  item,
UINT  flag,
PBITMAP  hBmpUnchecked,
PBITMAP  hBmpChecked 
)

Associates the specified bitmap with a menu item.

This function associates the specified bitmap with a menu item. Whether the menu item is checked or unchecked, the system displays the appropriate bitmap next to the menu item.

Parameters:
hmnu The handle to the menu.
item The position of the menu item.
flag Indicates the position base, can be one of the following values:

  • MF_BYCOMMAND
    The position value item is based on the command identifier.
  • MF_BYPOSITION
    The position value item is based on the position in the menu.
hBmpUnchecked The pointer to the unchecked BITMAP object.
hBmpChecked The pointer to the checked BITMAP object.
Returns:
The function returns 0 for success, non-zero for failure.
See also:
SetMenuItemInfo, MENUITEMINFO
int GUIAPI SetMenuItemInfo ( HMENU  hmnu,
int  item,
UINT  flag,
PMENUITEMINFO  pmii 
)

Changes information about a menu item.

This function changes information about the specified menu item.

Parameters:
hmnu [in] Handle to the menu that contains the menu item.
item [in] Specifies the identifier or position of the menu item to change. The meaning of this parameter depends on the value of flag.
flag Indicates the position base, can be one of the following values:

  • MF_BYCOMMAND
    The position value item is based on the command identifier.
  • MF_BYPOSITION
    The position value item is based on the position in the menu.
pmii The pointer to a MENUITEMINFO structure contains the information.
Returns:
The function returns 0 for success, non-zero for failure.
See also:
GetMenuItemInfo, MENUITEMINFO
HMENU GUIAPI StripPopupHead ( HMENU  hpppmnu  ) 

Strips the title of the popup menu.

This function strips the title of the popup menu hpppmnu.

Parameters:
hpppmnu The handle to the popup menu.
Returns:
The handle to the submenu whose title has been stripped.
See also:
GetPopupSubMenu
int GUIAPI TrackMenuBar ( HWND  hwnd,
int  pos 
)

Displays the specified submenu.

This function displays the specified submenu in the menu bar of the specified main window hwnd.

Parameters:
hwnd The handle to the main window.
pos The position of the submenu. The position value of the first submenu is 0.
Returns:
The function returns 0 for success, non-zero for failure.
See also:
TrackPopupMenu, CreateMenu
int GUIAPI TrackPopupMenu ( HMENU  hmnu,
UINT  uFlags,
int  x,
int  y,
HWND  hwnd 
)

Displays and tracks a popup menu.

This function displays a shortcut menu at the specified location and tracks the selection of items on the menu. The shortcut menu can appear anywhere on the screen.

Parameters:
hmnu The handle to the popup menu.
uFlags The tracking flags, can be OR'ed value of the following values:

  • TPM_LEFTALIGN
    Horz alignement is left.
  • TPM_CENTERALIGN
    Horz alignement is center.
  • TPM_RIGHTALIGN
    Horz alignement is right.
  • TPM_TOPALIGN
    Vert alignement is top.
  • TPM_VCENTERALIGN
    Vert alignement is center.
  • TPM_BOTTOMALIGN
    Vert alignement is bottom.
  • TPM_DESTROY
    Destroys the popup menu after finishing tracking.
  • TPM_SYSCMD
    Sends an MSG_SYSCOMMAND message to the window when the use select a menu item.
x The x coordinate of the position of the popup menu.
y The y coordinate of the position of the popup menu.
hwnd The handle to the window which will receive the MSG_COMMAND or MSG_SYSCOMMAND message.
Returns:
The function returns 0 for success, non-zero for failure.
See also:
TrackMenuBar, CreatePopupMenu
Generated on Thu Apr 7 16:01:51 2011 for MiniGUI V3.0.12 API Reference by  doxygen 1.6.3