diff options
-rw-r--r-- | bin10/lib/mir_app.lib | bin | 60914 -> 61138 bytes | |||
-rw-r--r-- | bin10/lib/mir_app64.lib | bin | 59250 -> 59450 bytes | |||
-rw-r--r-- | bin12/lib/mir_app.lib | bin | 60914 -> 61138 bytes | |||
-rw-r--r-- | bin12/lib/mir_app64.lib | bin | 59250 -> 59450 bytes | |||
-rw-r--r-- | include/m_genmenu.h | 8 | ||||
-rw-r--r-- | src/mir_app/src/genmenu.cpp | 24 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 |
8 files changed, 30 insertions, 4 deletions
diff --git a/bin10/lib/mir_app.lib b/bin10/lib/mir_app.lib Binary files differindex 69e2c28ccd..211cb51642 100644 --- a/bin10/lib/mir_app.lib +++ b/bin10/lib/mir_app.lib diff --git a/bin10/lib/mir_app64.lib b/bin10/lib/mir_app64.lib Binary files differindex cd9a03738f..7c056aa6a6 100644 --- a/bin10/lib/mir_app64.lib +++ b/bin10/lib/mir_app64.lib diff --git a/bin12/lib/mir_app.lib b/bin12/lib/mir_app.lib Binary files differindex 69e2c28ccd..211cb51642 100644 --- a/bin12/lib/mir_app.lib +++ b/bin12/lib/mir_app.lib diff --git a/bin12/lib/mir_app64.lib b/bin12/lib/mir_app64.lib Binary files differindex cd9a03738f..7c056aa6a6 100644 --- a/bin12/lib/mir_app64.lib +++ b/bin12/lib/mir_app64.lib diff --git a/include/m_genmenu.h b/include/m_genmenu.h index 1d97fa6dcf..3aa06a6544 100644 --- a/include/m_genmenu.h +++ b/include/m_genmenu.h @@ -70,11 +70,17 @@ EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessCommandById(int command, LPARAM lParam); /////////////////////////////////////////////////////////////////////////////////////////
// Adds a menu item to genmenu
-// Returns MenuItemHandle on success, or NULL on failure
+// Returns HGENMENU on success, or NULL on failure
EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddItem(HANDLE hMenuObject, TMO_MenuItem *pItem);
/////////////////////////////////////////////////////////////////////////////////////////
+// Adds new submenu
+// Returns HGENMENU on success, or NULL on failure
+
+EXTERN_C MIR_APP_DLL(HGENMENU) Menu_CreateRoot(HGENMENU hRoot, LPCTSTR ptszName, int position, HANDLE hIcoLib = NULL, int hLang = hLangpack);
+
+/////////////////////////////////////////////////////////////////////////////////////////
// process a WM_DRAWITEM message for user context menus v0.1.1.0+
// wParam, lParam, return value as for WM_MEASUREITEM
// See comments for clist/menumeasureitem
diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp index 7eac996704..ae4b414d15 100644 --- a/src/mir_app/src/genmenu.cpp +++ b/src/mir_app/src/genmenu.cpp @@ -651,9 +651,27 @@ static int GetNextObjectMenuItemId() }
/////////////////////////////////////////////////////////////////////////////////////////
-// wparam = MenuObjectHandle
-// lparam = PMO_MenuItem
-// return MenuItemHandle
+// Adds new submenu
+// Returns a handle to the newly created root item or NULL
+
+MIR_APP_DLL(HGENMENU) Menu_CreateRoot(HGENMENU hRoot, LPCTSTR ptszName, int position, HANDLE hIcoLib, int hLang)
+{
+ if (hRoot == NULL)
+ return NULL;
+
+ TMO_MenuItem tmi = { 0 };
+ tmi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
+ tmi.hIcolibItem = hIcoLib;
+ tmi.root = hRoot;
+ tmi.hLangpack = hLang;
+ tmi.name.t = (TCHAR*)ptszName;
+ tmi.position = position;
+ return Menu_AddItem(hRoot->owner, &tmi);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Adds new menu item
+// Returns a handle to the newly created item or NULL
MIR_APP_DLL(HGENMENU) Menu_AddItem(HANDLE hMenuObject, TMO_MenuItem *pmi)
{
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 4b2e9ec4fe..dd9455a4bc 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -220,3 +220,4 @@ Menu_DrawItem @217 Menu_MeasureItem @218
Menu_EnableItem @219
Menu_SetChecked @220
+Menu_CreateRoot @221
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index bb17f0e413..6f0ce211bd 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -220,3 +220,4 @@ Menu_DrawItem @217 Menu_MeasureItem @218
Menu_EnableItem @219
Menu_SetChecked @220
+Menu_CreateRoot @221
|