MiniGUI API Reference (MiniGUI-Standalone)
v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
Data Structures | |
struct | _MENUITEMINFO |
Typedefs | |
typedef struct _MENUITEMINFO | MENUITEMINFO |
Functions | |
MG_EXPORT HMENU GUIAPI | CreateMenu (void) |
Creates an empty menu. More... | |
MG_EXPORT HMENU GUIAPI | CreatePopupMenu (PMENUITEMINFO pmii) |
Creates a drop-down menu or submenu. More... | |
MG_EXPORT HMENU GUIAPI | CreateSystemMenu (HWND hwnd, DWORD dwStyle) |
Creates a system menu. More... | |
MG_EXPORT int GUIAPI | InsertMenuItem (HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii) |
Inserts a new menu item at the specified position in a menu. More... | |
MG_EXPORT int GUIAPI | RemoveMenu (HMENU hmnu, LINT item, UINT flag) |
Deletes a menu item or detaches a submenu from the specified menu. More... | |
MG_EXPORT int GUIAPI | DeleteMenu (HMENU hmnu, LINT item, UINT flag) |
Deletes an item from the specified menu. More... | |
MG_EXPORT int GUIAPI | DestroyMenu (HMENU hmnu) |
Destroys the specified menu and frees any memory that the menu occupies. More... | |
MG_EXPORT int GUIAPI | IsMenu (HMENU hmnu) |
Determines whether a handle is a menu handle. More... | |
MG_EXPORT HMENU GUIAPI | SetMenu (HWND hwnd, HMENU hmnu) |
Assigns a new menu to the specified main window. More... | |
MG_EXPORT HMENU GUIAPI | GetMenu (HWND hwnd) |
Retrieves the handle to the menu assigned to the given main window. More... | |
MG_EXPORT void GUIAPI | DrawMenuBar (HWND hwnd) |
Redraws the menu bar of the specified main window. More... | |
MG_EXPORT int GUIAPI | TrackMenuBar (HWND hwnd, int pos) |
Displays the specified submenu. More... | |
MG_EXPORT int GUIAPI | TrackPopupMenu (HMENU hmnu, UINT uFlags, int x, int y, HWND hwnd) |
Displays and tracks a popup menu. More... | |
MG_EXPORT HMENU GUIAPI | GetMenuBarItemRect (HWND hwnd, int pos, RECT *prc) |
Retrieves the rect of a menu bar item. More... | |
MG_EXPORT BOOL GUIAPI | HiliteMenuBarItem (HWND hwnd, int pos, UINT flag) |
Draws the specified menubar item with 3D effect. More... | |
MG_EXPORT int GUIAPI | GetMenuItemCount (HMENU hmnu) |
Determines the number of items in a menu. More... | |
MG_EXPORT LINT GUIAPI | GetMenuItemID (HMENU hmnu, int pos) |
Retrieves the menu item identifier of a menu item at specified position in a menu. More... | |
MG_EXPORT int GUIAPI | GetMenuItemInfo (HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii) |
Retrieves information about a menu item. More... | |
MG_EXPORT HMENU GUIAPI | GetPopupSubMenu (HMENU hpppmnu) |
Retrieves the submenu of the specified popup menu. More... | |
MG_EXPORT HMENU GUIAPI | StripPopupHead (HMENU hpppmnu) |
Strips the title of the popup menu. More... | |
MG_EXPORT HMENU GUIAPI | GetSubMenu (HMENU hmnu, int pos) |
Retrieves the handle to the submenu activated by the specified menu item. More... | |
MG_EXPORT 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. More... | |
MG_EXPORT UINT GUIAPI | EnableMenuItem (HMENU hmnu, LINT item, UINT flag) |
Enables, disables, or grays the specified menu item. More... | |
MG_EXPORT int GUIAPI | CheckMenuRadioItem (HMENU hmnu, LINT first, LINT last, LINT checkitem, UINT flag) |
Checks a specified menu item and makes it a radio item. More... | |
MG_EXPORT int GUIAPI | SetMenuItemBitmaps (HMENU hmnu, LINT item, UINT flag, PBITMAP hBmpUnchecked, PBITMAP hBmpChecked) |
Associates the specified bitmap with a menu item. More... | |
MG_EXPORT int GUIAPI | SetMenuItemInfo (HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii) |
Changes information about a menu item. More... | |
typedef struct _MENUITEMINFO MENUITEMINFO |
Structure defines a menu item
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.
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:
|
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.
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.
pmii | Menu item information used to create the popup menu. |
Creates a system menu.
This function creates a system menu for the main window specified by hwnd.
hwnd | The handle to the main window. |
dwStyle | The style of the main window. |
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.
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:
|
ERR_INVALID_HANDLE | hmnu is not a handle to menu. |
ERR_INVALID_HMENU | hmnu is an invalid menu. |
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.
hmnu | The handle to the menu. |
ERR_INVALID_HANDLE | hmnu is not a handle to menu. |
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.
hwnd | The handle to the main window. |
Enables, disables, or grays the specified menu item.
This function enables, disables, or grays the specified menu item.
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. |
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.
hwnd | The handle to the main window. |
Retrieves the rect of a menu bar item.
This function retrieves the rect of the menu bar item specified by the parameter pos.
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. |
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.
hmnu | The handle to the menu. |
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.
hmnu | The handle to the menu. |
pos | The position of the menu item. The position value of the first item is 0. |
int GUIAPI GetMenuItemInfo | ( | HMENU | hmnu, |
LINT | 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.
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:
|
pmii | [in, out] Pointer to a MENUITEMINFO structure that specifies the information to retrieve and receive information about the menu item. |
Retrieves the submenu of the specified popup menu.
This function retrieves the submenu of the specified popup menu.
hpppmnu | The handle to the popup menu. |
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.
hmnu | The handle to the menu. |
pos | The position of the menu item. The position value of the first item is 0. |
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.
hwnd | The handle to the main window. |
flag | Ignored currently; reserved for future use. |
Draws the specified menubar item with 3D effect.
This function draws the specified menubar item with 3D effect.
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:
|
int GUIAPI InsertMenuItem | ( | HMENU | hmnu, |
LINT | 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.
hmnu | The handle to the menu. |
item | The insertion position. |
flag | Indicates the position base, can be one of the following values:
|
pmii | Menu item information used to create the popup menu. |
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. |
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.
hmnu | The handle to a menu. |
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.
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:
|
ERR_INVALID_HANDLE | hmnu is not a handle to menu. |
ERR_INVALID_HMENU | hmnu is an invalid menu. |
Assigns a new menu to the specified main window.
This functionn assigns the specified menu hmnu to the main window specified by hwnd.
hwnd | The handle to the main window. |
hmnu | The handle to the new menu. |
int GUIAPI SetMenuItemBitmaps | ( | HMENU | hmnu, |
LINT | 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.
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:
|
hBmpUnchecked | The pointer to the unchecked BITMAP object. |
hBmpChecked | The pointer to the checked BITMAP object. |
int GUIAPI SetMenuItemInfo | ( | HMENU | hmnu, |
LINT | item, | ||
UINT | flag, | ||
PMENUITEMINFO | pmii | ||
) |
Changes information about a menu item.
This function changes information about the specified menu item.
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:
|
pmii | The pointer to a MENUITEMINFO structure contains the information. |
Strips the title of the popup menu.
This function strips the title of the popup menu hpppmnu.
hpppmnu | The handle to the popup menu. |
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.
hwnd | The handle to the main window. |
pos | The position of the submenu. The position value of the first submenu is 0. |
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.
hmnu | The handle to the popup menu. |
uFlags | The tracking flags, can be OR'ed value of the following values:
|
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. |