summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw/src/groupmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_mw/src/groupmenu.cpp')
-rw-r--r--plugins/Clist_mw/src/groupmenu.cpp63
1 files changed, 10 insertions, 53 deletions
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;