summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/hdr/modern_cluiframes.h6
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonprototypes.h2
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp27
-rw-r--r--plugins/Clist_modern/src/modern_cluiframes.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_framesmenu.cpp70
-rw-r--r--plugins/Clist_modern/src/modern_groupmenu.cpp63
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp11
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.h9
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp98
-rw-r--r--plugins/Clist_mw/src/clisttray.cpp28
-rw-r--r--plugins/Clist_mw/src/groupmenu.cpp63
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp17
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.h6
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp93
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp64
-rw-r--r--plugins/MirOTR/MirOTR/src/mirotrmenu.cpp28
16 files changed, 90 insertions, 503 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_cluiframes.h b/plugins/Clist_modern/src/hdr/modern_cluiframes.h
index f4cc677610..75bf89a8bd 100644
--- a/plugins/Clist_modern/src/hdr/modern_cluiframes.h
+++ b/plugins/Clist_modern/src/hdr/modern_cluiframes.h
@@ -136,12 +136,6 @@ struct FRAMEWND
#define CLUIFrameTitleBarClassName _T("CLUIFrameTitleBar")
#define CLUIFrameModule "CLUIFrames"
-//integrated menu module
-#define MS_INT_MENUMEASUREITEM "CLUIFrames/IntMenuMeasureItem"
-#define MS_INT_MENUDRAWITEM "CLUIFrames/IntMenuDrawItem"
-#define MS_INT_MENUPROCESSCOMMAND "CLUIFrames/IntMenuProcessCommand"
-#define MS_INT_MODIFYMENUITEM "CLUIFrames/IntModifyMenuItem"
-
#endif
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
index 785c9a7160..328552b6ce 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
@@ -227,9 +227,7 @@ int LoadStatusBarData(); //mo
int MenuModulesLoaded(WPARAM wParam,LPARAM lParam); //clistmenu.c
int MenuModulesShutdown(WPARAM wParam,LPARAM lParam); //clistmenu.c
int MenuProcessCommand(WPARAM wParam,LPARAM lParam); //clistmenu.c
-int ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam); //framesmenu.c
int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam); //cluiframes.c
-int ProcessCommandProxy(WPARAM wParam,LPARAM lParam); //framesmenu.c
int QueueAllFramesUpdating (BYTE); //cluiframes.c
int RecursiveDeleteMenu(HMENU hMenu); //clistmenus.c
int ModernSkinButtonRedrawAll(HDC hdc); //modern_button.c
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index b221df94ca..a5ff7ee804 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -506,28 +506,11 @@ void InitTrayMenus(void)
CreateServiceFunction(MS_CLIST_REMOVETRAYMENUITEM,RemoveTrayMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDTRAY,BuildTrayMenu);
- //Tray menu
- TMenuParam tmp = { sizeof(tmp) };
- tmp.CheckService = NULL;
- tmp.ExecService = "CLISTMENUSTRAY/ExecService";
- tmp.name = "TrayMenu";
- hTrayMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&tmp);
-
- OptParam op;
- op.Handle = hTrayMenuObject;
- op.Setting = OPT_USERDEFINEDITEMS;
- op.Value = TRUE;
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
-
- op.Handle = hTrayMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSTRAY/FreeOwnerDataTrayMenu";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
-
- op.Handle = hTrayMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSTRAY/TrayMenuonAddService";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
+ // Tray menu
+ hTrayMenuObject = MO_CreateMenuObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService");
+ MO_SetMenuObjectParam(hTrayMenuObject, OPT_USERDEFINEDITEMS, TRUE);
+ MO_SetMenuObjectParam(hTrayMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSTRAY/FreeOwnerDataTrayMenu");
+ MO_SetMenuObjectParam(hTrayMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSTRAY/TrayMenuonAddService");
//add exit command to menu
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp
index b265a0afee..d034d3aa89 100644
--- a/plugins/Clist_modern/src/modern_cluiframes.cpp
+++ b/plugins/Clist_modern/src/modern_cluiframes.cpp
@@ -982,7 +982,7 @@ static int ModifyMItem(WPARAM wParam,LPARAM lParam)
{
if ((int)wParam == -1 ) return 0; // FIXME
- return ModifyMenuItemProxy(wParam,lParam);
+ return CallService(MS_CLIST_MODIFYMENUITEM, wParam, lParam);
};
@@ -2959,11 +2959,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
return 1;
case WM_COMMAND:
- if ( ServiceExists(MO_CREATENEWMENUOBJECT)) {
- if ( ProcessCommandProxy(MAKEWPARAM(LOWORD(wParam),0), (LPARAM)Frameid))
- break;
- }
- else if ( CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),MPCF_CONTEXTFRAMEMENU),(LPARAM)Frameid))
+ if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam),0), Frameid))
break;
if (HIWORD(wParam) == 0) {//mouse events for self created menu
diff --git a/plugins/Clist_modern/src/modern_framesmenu.cpp b/plugins/Clist_modern/src/modern_framesmenu.cpp
index bb46b58083..cdd132569d 100644
--- a/plugins/Clist_modern/src/modern_framesmenu.cpp
+++ b/plugins/Clist_modern/src/modern_framesmenu.cpp
@@ -102,71 +102,19 @@ static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam)
}
//========================== Frames end
-bool InternalGenMenuModule = FALSE;
-
-int MeasureItemProxy(WPARAM wParam, LPARAM lParam)
-{
- if (InternalGenMenuModule) {
- int val = CallService(MS_INT_MENUMEASUREITEM, wParam, lParam);
- if (val)
- return val;
- }
- return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
-}
-
-int DrawItemProxy(WPARAM wParam, LPARAM lParam)
-{
- if (InternalGenMenuModule) {
- int val = CallService(MS_INT_MENUDRAWITEM, wParam, lParam);
- if (val)
- return val;
- }
- return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
-}
-
-int ProcessCommandProxy(WPARAM wParam, LPARAM lParam)
-{
- if (InternalGenMenuModule) {
- int val = CallService(MS_INT_MENUPROCESSCOMMAND, wParam, lParam);
- if (val)
- return val;
- }
- return CallService(MS_CLIST_MENUPROCESSCOMMAND,wParam,lParam);
-}
-
-int ModifyMenuItemProxy(WPARAM wParam, LPARAM lParam)
-{
- if (InternalGenMenuModule) {
- int val = CallService(MS_INT_MODIFYMENUITEM, wParam, lParam);
- if (val)
- return val;
- }
- return CallService(MS_CLIST_MODIFYMENUITEM,wParam,lParam);
-}
int InitFramesMenus(void)
{
- if ( !ServiceExists(MO_REMOVEMENUOBJECT)) {
- InitCustomMenus();
- InternalGenMenuModule = TRUE;
- }
+ CreateServiceFunction("FrameMenuExecService",FrameMenuExecService);
+ CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
- if ( ServiceExists(MO_REMOVEMENUOBJECT)) {
- CreateServiceFunction("FrameMenuExecService",FrameMenuExecService);
- CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
-
- CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
- CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
- CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
-
- //frame menu object
- TMenuParam tmp = { sizeof(tmp) };
- tmp.CheckService = "FrameMenuCheckService";
- tmp.ExecService = "FrameMenuExecService";
- tmp.name = "FrameMenu";
- hFrameMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&tmp);
- }
+ CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
+ CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
+ CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
+
+ // frame menu object
+ hFrameMenuObject = MO_CreateMenuObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp
index 27c797bcc8..4f0741b5c9 100644
--- a/plugins/Clist_modern/src/modern_groupmenu.cpp
+++ b/plugins/Clist_modern/src/modern_groupmenu.cpp
@@ -265,28 +265,11 @@ void GroupMenus_Init(void)
InitSubGroupMenus();
- //Group menu
- TMenuParam tmp = { sizeof(tmp) };
- tmp.CheckService = NULL;
- tmp.ExecService = "CLISTMENUSGroup/ExecService";
- tmp.name = LPGEN("GroupMenu");
- hGroupMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&tmp);
-
- OptParam op;
- op.Handle = hGroupMenuObject;
- op.Setting = OPT_USERDEFINEDITEMS;
- op.Value = TRUE;
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
-
- op.Handle = hGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSGroup/FreeOwnerDataGroupMenu";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
-
- op.Handle = hGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSGroup/GroupMenuonAddService";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
+ // Group menu
+ hGroupMenuObject = MO_CreateMenuObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_USERDEFINEDITEMS, TRUE);
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
//add exit command to menu
GroupMenuParam gmp;
@@ -536,8 +519,6 @@ INT_PTR GroupMenuExecProxy(WPARAM wParam,LPARAM lParam)
void InitSubGroupMenus(void)
{
- OptParam op;
-
CreateServiceFunction("CLISTMENUSSubGroup/ExecService",SubGroupMenuExecService);
CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu",FreeOwnerDataSubGroupMenu);
CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService",SubGroupMenuonAddService);
@@ -550,34 +531,14 @@ void InitSubGroupMenus(void)
HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
- //SubGroup menu
- TMenuParam tmp = { sizeof(tmp) };
- tmp.CheckService = NULL;
- tmp.ExecService = "CLISTMENUSSubGroup/ExecService";
- tmp.name = LPGEN("SubGroupMenu");
- hSubGroupMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&tmp);
-
- op.Handle = hSubGroupMenuObject;
- op.Setting = OPT_USERDEFINEDITEMS;
- op.Value = TRUE;
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
-
- op.Handle = hSubGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
-
- op.Handle = hSubGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuonAddService";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
-
- op.Handle = hSubGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_CHECK_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuCheckService";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&op);
+ // SubGroup menu
+ hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_USERDEFINEDITEMS, TRUE);
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuonAddService");
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_MENUOBJECT_SET_CHECK_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuCheckService");
- //add exit command to menu
+ // add exit command to menu
GroupMenuParam gmp;
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
index 5374b67ae1..a624ec563f 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
@@ -36,11 +36,9 @@ extern HINSTANCE g_hInst;
#define frame_menu_visible 2
#define frame_menu_showtitlebar 3
#define frame_menu_floating 4
-extern int ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam);
static int UpdateTBToolTip(int framepos);
INT_PTR CLUIFrameSetFloat(WPARAM wParam,LPARAM lParam);
int CLUIFrameResizeFloatingFrame(int framepos);
-extern int ProcessCommandProxy(WPARAM wParam,LPARAM lParam);
extern int InitFramesMenus(void);
int GapBetweenTitlebar;
@@ -796,7 +794,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*
INT_PTR ModifyMItem(WPARAM wParam,LPARAM lParam)
{
- return ModifyMenuItemProxy(wParam,lParam);
+ return CallService(MS_CLIST_MODIFYMENUITEM, wParam, lParam);
}
static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
@@ -2168,13 +2166,10 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return 0;
case WM_COMMAND:
- if ( ServiceExists(MO_CREATENEWMENUOBJECT)) {
- if (ProcessCommandProxy(MAKEWPARAM(LOWORD(wParam),0),(LPARAM)Frameid)) break;
- }
- else if ( CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),MPCF_CONTEXTFRAMEMENU),(LPARAM)Frameid))
+ if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam),0), Frameid))
break;
- if (HIWORD(wParam) == 0) {//mouse events for self created menu
+ if (HIWORD(wParam) == 0) { //mouse events for self created menu
int framepos = id2pos(Frameid);
if (framepos == -1)
break;
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.h b/plugins/Clist_mw/src/CLUIFrames/cluiframes.h
index 6430c6655d..d36dff07da 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.h
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.h
@@ -33,12 +33,3 @@ typedef struct tagProtocolData {
#define CLUIFrameTitleBarClassName _T("CLUIFrameTitleBar")
#define CLUIFrameModule "CLUIFrames"
-
-//integrated menu module
-#define MS_INT_MENUMEASUREITEM "CLUIFrames/IntMenuMeasureItem"
-#define MS_INT_MENUDRAWITEM "CLUIFrames/IntMenuDrawItem"
-#define MS_INT_MENUPROCESSCOMMAND "CLUIFrames/IntMenuProcessCommand"
-#define MS_INT_MODIFYMENUITEM "CLUIFrames/IntModifyMenuItem"
-
-
-
diff --git a/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp
index f850143c20..4e94c8b75f 100644
--- a/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp
@@ -127,93 +127,21 @@ static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam)
}
// == == == == == == == == == == == == == Frames end
-boolean InternalGenMenuModule = FALSE;
-
-int MeasureItemProxy(WPARAM wParam,LPARAM lParam)
-{
- int val;
- if (InternalGenMenuModule)
- {
- val = CallService(MS_INT_MENUMEASUREITEM,wParam,lParam);
- if (val) return(val);
- }
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
-}
-
-int DrawItemProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MENUDRAWITEM,wParam,lParam);
- if (val) return(val);
- }
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
-}
-
-int ProcessCommandProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MENUPROCESSCOMMAND,wParam,lParam);
- if (val) return(val);
- }
-
- return CallService(MS_CLIST_MENUPROCESSCOMMAND,wParam,lParam);
-
-}
-
-int ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MODIFYMENUITEM,wParam,lParam);
- if (val) return(val);
- }
-
- return CallService(MS_CLIST_MODIFYMENUITEM,wParam,lParam);
-}
int InitFramesMenus(void)
{
- TMenuParam tmp;
-
- if ( !ServiceExists(MO_REMOVEMENUOBJECT))
- {
-
- InitCustomMenus();
- InternalGenMenuModule = TRUE;
- }
-
- if (ServiceExists(MO_REMOVEMENUOBJECT))
- {
- CreateServiceFunction("FrameMenuExecService",FrameMenuExecService);
- CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
- CreateServiceFunction("FrameMenuFreeService",FreeOwnerDataFrameMenu);
-
-
- CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
- CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
- CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
- hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
-
- //frame menu object
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize = sizeof(tmp);
- tmp.CheckService = "FrameMenuCheckService";
- tmp.ExecService = "FrameMenuExecService";
- tmp.name = "FrameMenu";
- hFrameMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
- {
- OptParam op;
- op.Handle = hFrameMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value = (INT_PTR)"FrameMenuFreeService";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
- }
- }
+ CreateServiceFunction("FrameMenuExecService", FrameMenuExecService);
+ CreateServiceFunction("FrameMenuCheckService", FrameMenuCheckService);
+ CreateServiceFunction("FrameMenuFreeService", FreeOwnerDataFrameMenu);
+
+ CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, RemoveContextFrameMenuItem);
+ CreateServiceFunction("CList/AddContextFrameMenuItem", AddContextFrameMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT, BuildContextFrameMenu);
+ CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY, ContextFrameMenuNotify);
+ hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
+
+ // frame menu object
+ hFrameMenuObject = MO_CreateMenuObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
+ MO_SetMenuObjectParam(hFrameMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "FrameMenuFreeService");
return 0;
}
diff --git a/plugins/Clist_mw/src/clisttray.cpp b/plugins/Clist_mw/src/clisttray.cpp
index de61524292..ddfcb22811 100644
--- a/plugins/Clist_mw/src/clisttray.cpp
+++ b/plugins/Clist_mw/src/clisttray.cpp
@@ -192,16 +192,11 @@ INT_PTR FreeOwnerDataTrayMenu (WPARAM wParam,LPARAM lParam)
void InitTrayMenus(void)
{
- TMenuParam tmp;
- OptParam op;
-
//Tray menu
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize = sizeof(tmp);
- tmp.CheckService = NULL;
- tmp.ExecService = "CLISTMENUSTRAY/ExecService";
- tmp.name = "TrayMenu";
- hTrayMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
+ hTrayMenuObject = MO_CreateMenuObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService");
+ MO_SetMenuObjectParam(hTrayMenuObject, OPT_USERDEFINEDITEMS, TRUE);
+ MO_SetMenuObjectParam(hTrayMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSTRAY/FreeOwnerDataTrayMenu");
+ MO_SetMenuObjectParam(hTrayMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSTRAY/TrayMenuonAddService");
CreateServiceFunction("CLISTMENUSTRAY/ExecService",TrayMenuExecService);
CreateServiceFunction("CLISTMENUSTRAY/FreeOwnerDataTrayMenu",FreeOwnerDataTrayMenu);
@@ -212,21 +207,6 @@ void InitTrayMenus(void)
CreateServiceFunction(MS_CLIST_MENUBUILDTRAY,BuildTrayMenu);
hPreBuildTrayMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU);
- op.Handle = hTrayMenuObject;
- op.Setting = OPT_USERDEFINEDITEMS;
- op.Value = TRUE;
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle = hTrayMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSTRAY/FreeOwnerDataTrayMenu";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle = hTrayMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSTRAY/TrayMenuonAddService";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
//add exit command to menu
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 900000;
diff --git a/plugins/Clist_mw/src/groupmenu.cpp b/plugins/Clist_mw/src/groupmenu.cpp
index 7d57aae318..ba13c66479 100644
--- a/plugins/Clist_mw/src/groupmenu.cpp
+++ b/plugins/Clist_mw/src/groupmenu.cpp
@@ -235,10 +235,7 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
void InitGroupMenus(void)
{
- TMenuParam tmp;
- OptParam op;
- HICON hicon;
- hicon = LoadIconFromExternalFile("clisticons.dll",2,TRUE,TRUE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,0);
+ HICON hicon = LoadIconFromExternalFile("clisticons.dll",2,TRUE,TRUE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,0);
NewGroupIconidx = ImageList_AddIcon(hCListImages,hicon );
CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
@@ -256,30 +253,11 @@ void InitGroupMenus(void)
InitSubGroupMenus();
- //Group menu
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize = sizeof(tmp);
- tmp.CheckService = NULL;
- tmp.ExecService = "CLISTMENUSGroup/ExecService";
- tmp.name = "Group Menu";
- hGroupMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
-
-
- op.Handle = hGroupMenuObject;
- op.Setting = OPT_USERDEFINEDITEMS;
- op.Value = TRUE;
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle = hGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSGroup/FreeOwnerDataGroupMenu";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle = hGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSGroup/GroupMenuonAddService";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
+ // Group menu
+ hGroupMenuObject = MO_CreateMenuObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_USERDEFINEDITEMS, TRUE);
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
{
//add exit command to menu
GroupMenuParam gmp;
@@ -530,9 +508,6 @@ INT_PTR GroupMenuExecProxy(WPARAM wParam,LPARAM lParam)
void InitSubGroupMenus(void)
{
- TMenuParam tmp;
- OptParam op;
-
CreateServiceFunction("CLISTMENUSSubGroup/ExecService",SubGroupMenuExecService);
CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu",FreeOwnerDataSubGroupMenu);
CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService",SubGroupMenuonAddService);
@@ -545,28 +520,10 @@ void InitSubGroupMenus(void)
HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
//SubGroup menu
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize = sizeof(tmp);
- tmp.CheckService = NULL;
- tmp.ExecService = "CLISTMENUSSubGroup/ExecService";
- tmp.name = "SubGroupMenu";
- hSubGroupMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
-
-
- op.Handle = hSubGroupMenuObject;
- op.Setting = OPT_USERDEFINEDITEMS;
- op.Value = TRUE;
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle = hSubGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle = hSubGroupMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value = (INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuonAddService";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
+ hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_USERDEFINEDITEMS, TRUE);
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuonAddService");
//add exit command to menu
GroupMenuParam gmp;
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index b0acb8a6e8..d4fe172364 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -54,11 +54,9 @@ extern HINSTANCE g_hInst;
#define frame_menu_floating 4
#define frame_menu_skinned 5
-extern INT_PTR ModifyMenuItemProxy(WPARAM wParam, LPARAM lParam);
static int UpdateTBToolTip(int framepos);
INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam);
int CLUIFrameResizeFloatingFrame(int framepos);
-extern int ProcessCommandProxy(WPARAM wParam, LPARAM lParam);
extern int InitFramesMenus(void);
extern int UnitFramesMenu();
static int CLUIFramesReSort();
@@ -793,9 +791,8 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU
int ModifyMItem(WPARAM wParam, LPARAM lParam)
{
- return ModifyMenuItemProxy(wParam, lParam);
-};
-
+ return CallService(MS_CLIST_MODIFYMENUITEM, wParam, lParam);
+}
static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM lParam)
{
@@ -2568,14 +2565,8 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return 0;
case WM_COMMAND:
- if (ServiceExists(MO_CREATENEWMENUOBJECT)) {
- if (ProcessCommandProxy(MAKEWPARAM(LOWORD(wParam), 0), (LPARAM)Frameid))
- break;
- }
- else {
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTEXTFRAMEMENU), (LPARAM)Frameid))
- break;
- }
+ if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), 0), Frameid))
+ break;
if (HIWORD(wParam) == 0) {//mouse events for self created menu
framepos = id2pos(Frameid);
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
index 60caca8ab8..2c2375a351 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
@@ -36,12 +36,6 @@ typedef struct tagProtocolData {
#define CLUIFrameTitleBarClassName _T("CLUIFrameTitleBar")
#define CLUIFrameModule "CLUIFrames"
-//integrated menu module
-#define MS_INT_MENUMEASUREITEM "CLUIFrames/IntMenuMeasureItem"
-#define MS_INT_MENUDRAWITEM "CLUIFrames/IntMenuDrawItem"
-#define MS_INT_MENUPROCESSCOMMAND "CLUIFrames/IntMenuProcessCommand"
-#define MS_INT_MODIFYMENUITEM "CLUIFrames/IntModifyMenuItem"
-
typedef struct _DockOpt {
HWND hwndLeft;
HWND hwndRight;
diff --git a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp
index 0d8161739c..79c00914fe 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp
@@ -136,89 +136,22 @@ static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam)
}
//==========================Frames end
-boolean InternalGenMenuModule=FALSE;
-
-INT_PTR MeasureItemProxy(WPARAM wParam,LPARAM lParam)
-{
- int val;
- if (InternalGenMenuModule)
- {
- val=CallService(MS_INT_MENUMEASUREITEM,wParam,lParam);
- if (val) return(val);
- }
-
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
-}
-
-INT_PTR DrawItemProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule)
- {
- int val;
- val=CallService(MS_INT_MENUDRAWITEM,wParam,lParam);
- if (val) return(val);
- }
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
-}
-
-int ProcessCommandProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule) {
- int val;
- val=CallService(MS_INT_MENUPROCESSCOMMAND,wParam,lParam);
- if (val)
- return(val);
- }
- return CallService(MS_CLIST_MENUPROCESSCOMMAND,wParam,lParam);
-}
-
-INT_PTR ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule)
- {
- int val;
- val=CallService(MS_INT_MODIFYMENUITEM,wParam,lParam);
- if (val) return(val);
- }
-
- return CallService(MS_CLIST_MODIFYMENUITEM,wParam,lParam);
-}
int InitFramesMenus(void)
{
- TMenuParam tmp;
-
- if ( !ServiceExists(MO_REMOVEMENUOBJECT))
- InternalGenMenuModule=TRUE;
-
- if (ServiceExists(MO_REMOVEMENUOBJECT))
- {
- CreateServiceFunction("FrameMenuExecService",FrameMenuExecService);
- CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
- CreateServiceFunction("FrameMenuFreeService",FreeOwnerDataFrameMenu);
-
-
- CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
- CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
- CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
- hPreBuildFrameMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
-
- //frame menu object
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService="FrameMenuCheckService";
- tmp.ExecService="FrameMenuExecService";
- tmp.name="Frames_Menu";
- hFrameMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
- {
- OptParam op;
- op.Handle=hFrameMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value=(INT_PTR)"FrameMenuFreeService";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
- }
- }
+ CreateServiceFunction("FrameMenuExecService",FrameMenuExecService);
+ CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
+ CreateServiceFunction("FrameMenuFreeService",FreeOwnerDataFrameMenu);
+
+ CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
+ CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
+ CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
+ hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
+
+ //frame menu object
+ hFrameMenuObject = MO_CreateMenuObject("Frames_Menu", LPGEN("Frames menu"), "FrameMenuCheckService", "FrameMenuExecService");
+ MO_SetMenuObjectParam(hFrameMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "FrameMenuFreeService");
return 0;
}
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
index 080c7b8077..7059a5563d 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
@@ -251,11 +251,6 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
void InitGroupMenus(void)
{
- TMenuParam tmp;
- OptParam op;
- //hicon=LoadIconFromExternalFile("clisticons.dll",2,TRUE,TRUE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2);
- //NewGroupIconidx=ImageList_AddIcon(hCListImages,hicon );
-
CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu",FreeOwnerDataGroupMenu);
CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService",GroupMenuonAddService);
@@ -272,29 +267,10 @@ void InitGroupMenus(void)
InitSubGroupMenus();
//Group menu
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService=NULL;
- tmp.ExecService="CLISTMENUSGroup/ExecService";
- tmp.name="GroupMenu";
- hGroupMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
-
-
- op.Handle=hGroupMenuObject;
- op.Setting=OPT_USERDEFINEDITEMS;
- op.Value=TRUE;
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle=hGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSGroup/FreeOwnerDataGroupMenu";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle=hGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSGroup/GroupMenuonAddService";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
+ hGroupMenuObject = MO_CreateMenuObject("GroupMenu", LPGEN("Groups menu"), 0, "CLISTMENUSGroup/ExecService");
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_USERDEFINEDITEMS, TRUE);
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
+ MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
{
//add exit command to menu
GroupMenuParam gmp;
@@ -562,9 +538,6 @@ INT_PTR GroupMenuExecProxy(WPARAM wParam,LPARAM lParam)
void InitSubGroupMenus(void)
{
- TMenuParam tmp;
- OptParam op;
-
CreateServiceFunction("CLISTMENUSSubGroup/ExecService",SubGroupMenuExecService);
CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu",FreeOwnerDataSubGroupMenu);
CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService",SubGroupMenuonAddService);
@@ -580,30 +553,11 @@ void InitSubGroupMenus(void)
hPreBuildSubGroupMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
-
- //SubGroup menu
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService=NULL;
- tmp.ExecService="CLISTMENUSSubGroup/ExecService";
- tmp.name="SubGroupMenu";
- hSubGroupMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
-
-
- op.Handle=hSubGroupMenuObject;
- op.Setting=OPT_USERDEFINEDITEMS;
- op.Value=TRUE;
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle=hSubGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
-
- op.Handle=hSubGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuonAddService";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
+ // SubGroup menu
+ hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_USERDEFINEDITEMS, TRUE);
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
+ MO_SetMenuObjectParam(hSubGroupMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuonAddService");
{
//add exit command to menu
diff --git a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
index dfd28d741f..f886cd14e6 100644
--- a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
+++ b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
@@ -200,36 +200,20 @@ void InitMirOTRMenu(void)
CreateServiceFunction("MirOTRMenuExecService",MirOTRMenuExecService);
CreateServiceFunction("MirOTRMenuCheckService",MirOTRMenuCheckService);
- //free services
+ // menu object
CreateServiceFunction("MIROTRMENUS/FreeOwnerDataMirOTRMenu",FreeOwnerDataMirOTRMenu);
CreateServiceFunction("MIROTRMENUS/OnAddMenuItemMirOTRMenu",OnAddMenuItemMirOTRMenu);
CreateServiceFunction(MS_MIROTR_ADDMIROTRMENUITEM,AddMirOTRMenuItem);
CreateServiceFunction(MS_MIROTR_MENUBUILDMIROTR,BuildMirOTRMenu);
CreateServiceFunction(MS_MIROTR_REMOVEMIROTRMENUITEM,RemoveMirOTRMenuItem);
- {
- TMenuParam tmp = { 0 };
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService="MirOTRMenuCheckService";
- tmp.ExecService="MirOTRMenuExecService";
- tmp.name="MirOTRMenu";
- hMirOTRMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
- }
-
- OptParam params;
- params.Handle = hMirOTRMenuObject;
- params.Setting = OPT_USERDEFINEDITEMS;
- params.Value = FALSE;
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&params);
-
- params.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- params.Value = (INT_PTR)"MIROTRMENUS/FreeOwnerDataMirOTRMenu";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&params);
- params.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
- params.Value = (INT_PTR)"MIROTRMENUS/OnAddMenuItemMirOTRMenu";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&params);
+ hMirOTRMenuObject = MO_CreateMenuObject("MirOTRMenu", LPGEN("MirOTR menu"), "MirOTRMenuCheckService", "MirOTRMenuExecService");
+ MO_SetMenuObjectParam(hMirOTRMenuObject, OPT_USERDEFINEDITEMS, FALSE);
+ MO_SetMenuObjectParam(hMirOTRMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "MIROTRMENUS/FreeOwnerDataMirOTRMenu");
+ MO_SetMenuObjectParam(hMirOTRMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "MIROTRMENUS/OnAddMenuItemMirOTRMenu");
+ // menu items
MIROTRMENUITEM mi = {0};
mi.cbSize = sizeof(mi);