⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 group__menu__fns.htm

📁 MINIGUI1.6开发API
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>MiniGUI V1.6.10 API Reference: Menu operations</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.2 --><div class="qindex"><a class="qindex" href="index.htm">Main&nbsp;Page</a> | <a class="qindex" href="modules.htm">Modules</a> | <a class="qindex" href="classes.htm">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.htm">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.htm">Directories</a> | <a class="qindex" href="files.htm">File&nbsp;List</a> | <a class="qindex" href="functions.htm">Data&nbsp;Fields</a> | <a class="qindex" href="globals.htm">Globals</a> | <a class="qindex" href="pages.htm">Related&nbsp;Pages</a></div><h1>Menu operations<br><small>[<a class="el" href="group__window__create__fns.htm">Window creating/destroying</a>]</small></h1><h2>Data Structures</h2><ul><li>struct <a class="el" href="struct__MENUITEMINFO.htm">_MENUITEMINFO</a></ul><h2>Typedefs</h2><ul><li>typedef <a class="el" href="struct__MENUITEMINFO.htm">_MENUITEMINFO</a> <a class="el" href="group__menu__fns.htm#ga0">MENUITEMINFO</a></ul><h2>Functions</h2><ul><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga2">CreateMenu</a> (void)<dl class="el"><dd class="mdescRight">Creates an empty menu.  <a href="#ga2"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga3">CreatePopupMenu</a> (<a class="el" href="struct__MENUITEMINFO.htm">PMENUITEMINFO</a> pmii)<dl class="el"><dd class="mdescRight">Creates a drop-down menu or submenu.  <a href="#ga3"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga4">CreateSystemMenu</a> (<a class="el" href="group__handles.htm#ga1">HWND</a> hwnd, <a class="el" href="group__win32__types.htm#ga4">DWORD</a> dwStyle)<dl class="el"><dd class="mdescRight">Creates a system menu.  <a href="#ga4"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga5">InsertMenuItem</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int item, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag, <a class="el" href="struct__MENUITEMINFO.htm">PMENUITEMINFO</a> pmii)<dl class="el"><dd class="mdescRight">Inserts a new menu item at the specified position in a menu.  <a href="#ga5"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga6">RemoveMenu</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int item, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag)<dl class="el"><dd class="mdescRight">Deletes a menu item or detaches a submenu from the specified menu.  <a href="#ga6"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga7">DeleteMenu</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int item, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag)<dl class="el"><dd class="mdescRight">Deletes an item from the specified menu.  <a href="#ga7"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga8">DestroyMenu</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu)<dl class="el"><dd class="mdescRight">Destroys the specified menu and frees any memory that the menu occupies.  <a href="#ga8"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga9">IsMenu</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu)<dl class="el"><dd class="mdescRight">Determines whether a handle is a menu handle.  <a href="#ga9"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga10">SetMenu</a> (<a class="el" href="group__handles.htm#ga1">HWND</a> hwnd, <a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu)<dl class="el"><dd class="mdescRight">Assigns a new menu to the specified main window.  <a href="#ga10"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga11">GetMenu</a> (<a class="el" href="group__handles.htm#ga1">HWND</a> hwnd)<dl class="el"><dd class="mdescRight">Retrieves the handle to the menu assigned to the given main window.  <a href="#ga11"></a><br></dl><li>MG_EXPORT void GUIAPI <a class="el" href="group__menu__fns.htm#ga12">DrawMenuBar</a> (<a class="el" href="group__handles.htm#ga1">HWND</a> hwnd)<dl class="el"><dd class="mdescRight">Redraws the menu bar of the specified main window.  <a href="#ga12"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga13">TrackMenuBar</a> (<a class="el" href="group__handles.htm#ga1">HWND</a> hwnd, int pos)<dl class="el"><dd class="mdescRight">Displays the specified submenu.  <a href="#ga13"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga14">TrackPopupMenu</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, <a class="el" href="group__win32__types.htm#ga6">UINT</a> uFlags, int x, int y, <a class="el" href="group__handles.htm#ga1">HWND</a> hwnd)<dl class="el"><dd class="mdescRight">Displays and tracks a popup menu.  <a href="#ga14"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga15">GetMenuBarItemRect</a> (<a class="el" href="group__handles.htm#ga1">HWND</a> hwnd, int pos, <a class="el" href="struct__RECT.htm">RECT</a> *prc)<dl class="el"><dd class="mdescRight">Retrieves the rect of a menu bar item.  <a href="#ga15"></a><br></dl><li>MG_EXPORT <a class="el" href="group__simple__types.htm#ga0">BOOL</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga16">HiliteMenuBarItem</a> (<a class="el" href="group__handles.htm#ga1">HWND</a> hwnd, int pos, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag)<dl class="el"><dd class="mdescRight">Draws the specified menubar item with 3D effect.  <a href="#ga16"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga17">GetMenuItemCount</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu)<dl class="el"><dd class="mdescRight">Determines the number of items in a menu.  <a href="#ga17"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga18">GetMenuItemID</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int pos)<dl class="el"><dd class="mdescRight">Retrieves the menu item identifier of a menu item at specified position in a menu.  <a href="#ga18"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga19">GetMenuItemInfo</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int item, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag, <a class="el" href="struct__MENUITEMINFO.htm">PMENUITEMINFO</a> pmii)<dl class="el"><dd class="mdescRight">Retrieves information about a menu item.  <a href="#ga19"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga21">GetPopupSubMenu</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hpppmnu)<dl class="el"><dd class="mdescRight">Retrieves the submenu of the specified popup menu.  <a href="#ga21"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga22">StripPopupHead</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hpppmnu)<dl class="el"><dd class="mdescRight">Strips the title of the popup menu.  <a href="#ga22"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga23">GetSubMenu</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int pos)<dl class="el"><dd class="mdescRight">Retrieves the handle to the submenu activated by the specified menu item.  <a href="#ga23"></a><br></dl><li>MG_EXPORT <a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga24">GetSystemMenu</a> (<a class="el" href="group__handles.htm#ga1">HWND</a> hwnd, <a class="el" href="group__simple__types.htm#ga0">BOOL</a> flag)<dl class="el"><dd class="mdescRight">Allows the application to access the window menu (also known as the system menu) for copying and modifying.  <a href="#ga24"></a><br></dl><li>MG_EXPORT <a class="el" href="group__win32__types.htm#ga6">UINT</a> GUIAPI <a class="el" href="group__menu__fns.htm#ga25">EnableMenuItem</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int item, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag)<dl class="el"><dd class="mdescRight">Enables, disables, or grays the specified menu item.  <a href="#ga25"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga26">CheckMenuRadioItem</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int first, int last, int checkitem, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag)<dl class="el"><dd class="mdescRight">Checks a specified menu item and makes it a radio item.  <a href="#ga26"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga27">SetMenuItemBitmaps</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int item, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag, <a class="el" href="struct__BITMAP.htm">PBITMAP</a> hBmpUnchecked, <a class="el" href="struct__BITMAP.htm">PBITMAP</a> hBmpChecked)<dl class="el"><dd class="mdescRight">Associates the specified bitmap with a menu item.  <a href="#ga27"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__menu__fns.htm#ga28">SetMenuItemInfo</a> (<a class="el" href="group__handles.htm#ga6">HMENU</a> hmnu, int item, <a class="el" href="group__win32__types.htm#ga6">UINT</a> flag, <a class="el" href="struct__MENUITEMINFO.htm">PMENUITEMINFO</a> pmii)<dl class="el"><dd class="mdescRight">Changes information about a menu item.  <a href="#ga28"></a><br></dl></ul><hr><h2>Typedef Documentation</h2><a class="anchor" name="ga0" doxytag="window.h::MENUITEMINFO"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">typedef struct <a class="el" href="struct__MENUITEMINFO.htm">_MENUITEMINFO</a>  <a class="el" href="struct__MENUITEMINFO.htm">MENUITEMINFO</a>          </td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Structure defines a menu item     </td>  </tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="ga26" doxytag="window.h::CheckMenuRadioItem"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">int GUIAPI CheckMenuRadioItem           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga6">HMENU</a>&nbsp;</td>          <td class="mdname" nowrap> <em>hmnu</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>int&nbsp;</td>          <td class="mdname" nowrap> <em>first</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>int&nbsp;</td>          <td class="mdname" nowrap> <em>last</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>int&nbsp;</td>          <td class="mdname" nowrap> <em>checkitem</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap><a class="el" href="group__win32__types.htm#ga6">UINT</a>&nbsp;</td>          <td class="mdname" nowrap> <em>flag</em></td>        </tr>        <tr>          <td class="md"></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Checks a specified menu item and makes it a radio item. <p>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.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>hmnu</em>&nbsp;</td><td>The handle to the menu. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>first</em>&nbsp;</td><td>The position of the first item in the group. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>last</em>&nbsp;</td><td>The position of the last item in the group. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>checkitem</em>&nbsp;</td><td>The position of the menu item to check. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>flag</em>&nbsp;</td><td>Indicates the position base, can be one of the following values:<ul><li>MF_BYCOMMAND<br> The position value <em>item</em> is based on the command identifier.</li><li>MF_BYPOSITION<br> The position value <em>item</em> is based on the position in the menu.</li></ul></td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The function returns 0 for success, non-zero for failure.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__menu__fns.htm#ga28">SetMenuItemInfo</a>, <a class="el" href="group__menu__fns.htm#ga0">MENUITEMINFO</a> </dd></dl>    </td>  </tr></table><a class="anchor" name="ga2" doxytag="window.h::CreateMenu"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI CreateMenu           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Creates an empty menu. <p>This function creates a menu. The menu is initially empty, but it can be filled with menu items by using the <em>InsertMenuItem</em> functions.<p><dl compact><dt><b>Returns:</b></dt><dd>The handle to the menu, zero when error.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__menu__fns.htm#ga5">InsertMenuItem</a> </dd></dl>    </td>  </tr></table><a class="anchor" name="ga3" doxytag="window.h::CreatePopupMenu"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI CreatePopupMenu           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="struct__MENUITEMINFO.htm">PMENUITEMINFO</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>pmii</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Creates a drop-down menu or submenu. <p>This function creates a drop-down menu or submenu. The menu is initially empty. You can insert or append menu items by using the <em>InsertMenuItem</em> function.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>pmii</em>&nbsp;</td><td>Menu item information used to create the popup menu.</td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The handle to the popup menu.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__menu__fns.htm#ga5">InsertMenuItem</a>, <a class="el" href="group__menu__fns.htm#ga0">MENUITEMINFO</a> </dd></dl>    </td>  </tr></table><a class="anchor" name="ga4" doxytag="window.h::CreateSystemMenu"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga6">HMENU</a> GUIAPI CreateSystemMenu           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga1">HWND</a>&nbsp;</td>          <td class="mdname" nowrap> <em>hwnd</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap><a class="el" href="group__win32__types.htm#ga4">DWORD</a>&nbsp;</td>          <td class="mdname" nowrap> <em>dwStyle</em></td>        </tr>        <tr>          <td class="md"></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Creates a system menu. <p>This function creates a system menu for the main window specified by <em>hwnd</em>.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>hwnd</em>&nbsp;</td><td>The handle to the main window. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>dwStyle</em>&nbsp;</td><td>The style of the main window.</td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The handle to the system menu.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__menu__fns.htm#ga2">CreateMenu</a>, <a class="el" href="group__menu__fns.htm#ga3">CreatePopupMenu</a> </dd></dl>    </td>  </tr></table><a class="anchor" name="ga7" doxytag="window.h::DeleteMenu"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">int GUIAPI DeleteMenu           </td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -