diff options
Diffstat (limited to 'plugins')
29 files changed, 107 insertions, 172 deletions
diff --git a/plugins/Actman/ua/i_uaplaces.inc b/plugins/Actman/ua/i_uaplaces.inc index 0b7856f909..9b7dac8cf1 100644 --- a/plugins/Actman/ua/i_uaplaces.inc +++ b/plugins/Actman/ua/i_uaplaces.inc @@ -278,7 +278,7 @@ begin with ActionItem.UAMenuItem[mtype] do
begin
if hMenuItem=0 then exit;
- CallService(MO_REMOVEMENUITEM,hMenuItem,0);
+ Menu_RemoveItem(hMenuItem);
hMenuItem:=0;
end;
@@ -302,7 +302,7 @@ begin break;
end;
end;
- CallService(MO_REMOVEMENUITEM,hMenuRoot,0);
+ Menu_RemoveItem(hMenuRoot);
ActionItem.UAMenuItem[mtype].hMenuRoot:=0;
end;
end;
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 4b63376b7e..96fcff53bf 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -18,12 +18,14 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+
#include "stdafx.h"
CLIST_INTERFACE *pcli;
HINSTANCE hInst;
int hLangpack;
-static HANDLE hMainMenuItem = 0, hToolBarItem = 0;
+static HANDLE hToolBarItem = 0;
+static HGENMENU hMainMenuItem = 0;
HWND hAddDlg;
static IconItem icon = { LPGEN("Add contact"), ICON_ADD, IDI_ADDCONTACT };
@@ -102,7 +104,7 @@ static int OnAccListChanged(WPARAM, LPARAM) if (!hMainMenuItem)
return 0;
- CallService(MO_REMOVEMENUITEM, (WPARAM)hMainMenuItem, 0);
+ Menu_RemoveItem(hMainMenuItem);
CallService(MS_TTB_REMOVEBUTTON, (WPARAM)hToolBarItem, 0);
hMainMenuItem = 0;
}
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 029d0af01d..f8194f3394 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -66,7 +66,7 @@ static void __inline ShutdownAndStopWatcher(void) static TCHAR* GetMessageText(BYTE **ppBlob,DWORD *pcbBlob)
{
(*ppBlob)[*pcbBlob]=0;
- DWORD cb = mir_strlen((char*)*ppBlob);
+ size_t cb = mir_strlen((char*)*ppBlob);
/* use Unicode data if present */
if (*pcbBlob>(cb+3)) {
(*ppBlob)[*pcbBlob-1]=0;
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 27081d9c64..2770a91569 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -543,7 +543,7 @@ void BossKeyMenuItemInit(void) // Add menu item void BossKeyMenuItemUnInit(void) // Remove menu item
{
- CallService(MO_REMOVEMENUITEM, (WPARAM)g_hMenuItem, 0);
+ Menu_RemoveItem(g_hMenuItem);
g_hMenuItem = 0;
}
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp index f087d307b9..7f8f7269e1 100644 --- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp @@ -1544,7 +1544,7 @@ static int CLUIFramesLoadMainMenu() return -1;
if (_hmiRoot != HGENMENU_ROOT) {
- CallService(MO_REMOVEMENUITEM, (WPARAM)_hmiRoot, 0);
+ Menu_RemoveItem(_hmiRoot);
_hmiRoot = HGENMENU_ROOT;
}
@@ -3493,29 +3493,29 @@ int CLUIFrameOnModulesUnload(WPARAM, LPARAM) if (!_hmiVisible)
return 0;
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiVisible, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiTBVisible, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiLock, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiColl, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiFloating, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignTop, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignClient, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignBottom, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiBorder, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignRoot, 0);
-
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiPosUp, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiPosDown, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiPosRoot, 0);
-
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiVisible, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiTBVisible, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiLock, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiColl, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiFloating, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiBorder, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiAlignRoot, 0);
- CallService(MO_REMOVEMENUITEM, (LPARAM)_hmiPosRoot, 0);
+ Menu_RemoveItem(_hmiVisible);
+ Menu_RemoveItem(_hmiTBVisible);
+ Menu_RemoveItem(_hmiLock);
+ Menu_RemoveItem(_hmiColl);
+ Menu_RemoveItem(_hmiFloating);
+ Menu_RemoveItem(_hmiAlignTop);
+ Menu_RemoveItem(_hmiAlignClient);
+ Menu_RemoveItem(_hmiAlignBottom);
+ Menu_RemoveItem(_hmiBorder);
+ Menu_RemoveItem(_hmiAlignRoot);
+
+ Menu_RemoveItem(_hmiPosUp);
+ Menu_RemoveItem(_hmiPosDown);
+ Menu_RemoveItem(_hmiPosRoot);
+
+ Menu_RemoveItem(_hmiVisible);
+ Menu_RemoveItem(_hmiTBVisible);
+ Menu_RemoveItem(_hmiLock);
+ Menu_RemoveItem(_hmiColl);
+ Menu_RemoveItem(_hmiFloating);
+ Menu_RemoveItem(_hmiBorder);
+ Menu_RemoveItem(_hmiAlignRoot);
+ Menu_RemoveItem(_hmiPosRoot);
_hmiVisible = 0;
_AniAva_OnModulesUnload();
@@ -3576,7 +3576,7 @@ static INT_PTR UnloadMainMenu() {
CLUIFrameOnModulesUnload(0, 0);
if (_hmiRoot != HGENMENU_ROOT) {
- CallService(MO_REMOVEMENUITEM, (WPARAM)_hmiRoot, 0);
+ Menu_RemoveItem(_hmiRoot);
_hmiRoot = HGENMENU_ROOT;
}
diff --git a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp index a8d4a70d58..35e6b95a7f 100644 --- a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp @@ -41,8 +41,7 @@ static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam) fmep->Frameid = mi->popupPosition;
fmep->param1 = (INT_PTR)mi->pszContactOwner;
tmi.ownerdata = fmep;
-
- return CallService(MO_ADDNEWMENUITEM, (WPARAM)hFrameMenuObject, (LPARAM)&tmi);
+ return (INT_PTR)Menu_AddItem(hFrameMenuObject, &tmi);
}
//called with:
@@ -61,7 +60,7 @@ INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam) //true - ok,false ignore
INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM)
{
- PCheckProcParam pcpp = (PCheckProcParam)wParam;
+ TCheckProcParam *pcpp = (TCheckProcParam*)wParam;
if (pcpp == NULL)
return FALSE;
@@ -85,14 +84,9 @@ static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam) static INT_PTR BuildContextFrameMenu(WPARAM wParam, LPARAM lParam)
{
- ListParam param = { 0 };
- param.MenuObjectHandle = hFrameMenuObject;
- param.wParam = wParam;
- param.lParam = lParam;
-
HMENU hMenu = CreatePopupMenu();
ContextFrameMenuNotify(wParam, -1);
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
+ Menu_Build(hMenu, hFrameMenuObject, wParam, lParam);
return (INT_PTR)hMenu;
}
@@ -110,7 +104,7 @@ int InitFramesMenus(void) hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
// frame menu object
- hFrameMenuObject = MO_CreateMenuObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
+ hFrameMenuObject = Menu_AddObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
Menu_ConfigureObject(hFrameMenuObject, MCO_OPT_FREE_SERVICE, "FrameMenuFreeService");
return 0;
}
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp index 188639ecf0..eedeba5e7d 100644 --- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp @@ -56,10 +56,7 @@ INT_PTR BuildGroupMenu(WPARAM, LPARAM) NotifyEventHooks(g_CluiData.hEventPreBuildGroupMenu, 0, 0);
HMENU hMenu = CreatePopupMenu();
-
- ListParam param = { 0 };
- param.MenuObjectHandle = hGroupMenuObject;
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
+ Menu_Build(hMenu, hGroupMenuObject);
return (INT_PTR)hMenu;
}
@@ -84,7 +81,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam) }
tmi.ownerdata = mmep;
- HGENMENU hNewItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi);
+ HGENMENU hNewItem = Menu_AddItem(hGroupMenuObject, &tmi);
char buf[1024];
mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
@@ -224,7 +221,7 @@ void GroupMenus_Init(void) InitSubGroupMenus();
// Group menu
- hGroupMenuObject = MO_CreateMenuObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
+ hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
@@ -355,13 +352,8 @@ INT_PTR BuildSubGroupMenu(WPARAM wParam, LPARAM lParam) {
NotifyEventHooks(g_CluiData.hEventPreBuildSubGroupMenu, wParam, 0);
- ListParam param = { 0 };
- param.MenuObjectHandle = hSubGroupMenuObject;
- param.wParam = wParam;
- param.lParam = lParam;
-
HMENU hMenu = CreatePopupMenu();
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
+ Menu_Build(hMenu, hSubGroupMenuObject, wParam, lParam);
return (INT_PTR)hMenu;
}
@@ -391,7 +383,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam) }
tmi.ownerdata = mmep;
- HGENMENU hNewItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi);
+ HGENMENU hNewItem = Menu_AddItem(hSubGroupMenuObject, &tmi);
char buf[1024];
mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
@@ -469,7 +461,7 @@ void InitSubGroupMenus(void) HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
// SubGroup menu
- hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
+ hSubGroupMenuObject = Menu_AddObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuonAddService");
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 3618cf2d9b..5ee7d52875 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -374,7 +374,7 @@ static LRESULT clcOnCommand(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM } if (contact->type == CLCIT_GROUP) - if (CallService(MO_PROCESSCOMMANDBYMENUIDENT, LOWORD(wParam), (LPARAM)hwnd)) + if (Menu_ProcessCommandById(wParam, (LPARAM)hwnd)) return 0; return 0; diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 22bc5e14ab..77de5d473f 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -189,9 +189,6 @@ int UnloadFavoriteContactMenu() free(hFavoriteContactMenuItems);
hFavoriteContactMenuItems = NULL;
- if (hFavoriteContactMenu)
- CallService(MO_REMOVEMENUITEM, (WPARAM)hFavoriteContactMenu, 0);
- hFavoriteContactMenu = NULL;
-
+ Menu_RemoveItem(hFavoriteContactMenu); hFavoriteContactMenu = NULL;
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 7854a6abfa..93ad8f1b2a 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -163,11 +163,8 @@ static INT_PTR BuildTrayMenu(WPARAM, LPARAM) {
NotifyEventHooks(g_CluiData.hEventPreBuildTrayMenu, 0, 0);
- ListParam param = { 0 };
- param.MenuObjectHandle = hTrayMenuObject;
-
HMENU hMenu = CreatePopupMenu();
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
+ Menu_Build(hMenu, hTrayMenuObject);
return (INT_PTR)hMenu;
}
@@ -181,7 +178,7 @@ static INT_PTR AddTrayMenuItem(WPARAM, LPARAM lParam) tmi.ownerdata = mir_strdup(mi->pszService);
- HGENMENU hNewItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hTrayMenuObject, (LPARAM)&tmi);
+ HGENMENU hNewItem = Menu_AddItem(hTrayMenuObject, &tmi);
Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, mi->pszService);
return (INT_PTR)hNewItem;
}
@@ -311,7 +308,7 @@ void InitTrayMenus(void) CreateServiceFunction(MS_CLIST_MENUBUILDTRAY, BuildTrayMenu);
// Tray menu
- hTrayMenuObject = MO_CreateMenuObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService");
+ hTrayMenuObject = Menu_AddObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService");
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSTRAY/FreeOwnerDataTrayMenu");
Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSTRAY/TrayMenuonAddService");
@@ -366,10 +363,8 @@ void InitTrayMenus(void) void UninitTrayMenu()
{
- if (hTrayMenuObject) {
- CallService(MO_REMOVEMENUOBJECT, (WPARAM)hTrayMenuObject, 0);
- hTrayMenuObject = NULL;
- }
+ Menu_RemoveObject(hTrayMenuObject);
+ hTrayMenuObject = NULL;
}
VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index 7f30fff6d2..4dcb13a226 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -1381,7 +1381,7 @@ static int CLUIFramesLoadMainMenu() return -1; if (MainMIRoot != (HANDLE)-1) { - CallService(MO_REMOVEMENUITEM, (WPARAM)MainMIRoot, 0); + Menu_RemoveItem(MainMIRoot); MainMIRoot = (HGENMENU)-1; } @@ -3012,17 +3012,17 @@ static int CLUIFrameOnModulesUnload(WPARAM, LPARAM) WaitForSingleObject(hThreadMFUpdate, 2000); CloseHandle(g_hEventThread); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMIVisible, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMITitle, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMITBVisible, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMILock, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMIColl, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMIFloating, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMIAlignRoot, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMIAlignTop, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMIAlignClient, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMIAlignBottom, 0); - CallService(MO_REMOVEMENUITEM, (LPARAM)contMIBorder, 0); + Menu_RemoveItem(contMIVisible); + Menu_RemoveItem(contMITitle); + Menu_RemoveItem(contMITBVisible); + Menu_RemoveItem(contMILock); + Menu_RemoveItem(contMIColl); + Menu_RemoveItem(contMIFloating); + Menu_RemoveItem(contMIAlignRoot); + Menu_RemoveItem(contMIAlignTop); + Menu_RemoveItem(contMIAlignClient); + Menu_RemoveItem(contMIAlignBottom); + Menu_RemoveItem(contMIBorder); return 0; } diff --git a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp index 858c65dcf7..d013caefd9 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp @@ -41,8 +41,7 @@ static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam) fmep->Frameid = mi->popupPosition;
fmep->param1 = (INT_PTR)mi->pszContactOwner;
tmi.ownerdata = fmep;
-
- return CallService(MO_ADDNEWMENUITEM, (WPARAM)hFrameMenuObject, (LPARAM)&tmi);
+ return (INT_PTR)Menu_AddItem(hFrameMenuObject, &tmi);
}
//called with:
@@ -62,7 +61,7 @@ INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam) //true - ok,false ignore
INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM)
{
- PCheckProcParam pcpp = (PCheckProcParam)wParam;
+ TCheckProcParam *pcpp = (TCheckProcParam*)wParam;
if (pcpp == NULL)
return FALSE;
@@ -86,14 +85,10 @@ static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam) static INT_PTR BuildContextFrameMenu(WPARAM wParam, LPARAM lParam)
{
- ListParam param = {0};
- param.MenuObjectHandle = hFrameMenuObject;
- param.wParam = wParam;
- param.lParam = lParam;
+ ContextFrameMenuNotify(wParam, -1);
HMENU hMenu = CreatePopupMenu();
- ContextFrameMenuNotify(wParam, -1);
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
+ Menu_Build(hMenu, hFrameMenuObject, wParam, lParam);
return (INT_PTR)hMenu;
}
@@ -111,7 +106,7 @@ int InitFramesMenus(void) hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
// frame menu object
- hFrameMenuObject = MO_CreateMenuObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
+ hFrameMenuObject = Menu_AddObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
Menu_ConfigureObject(hFrameMenuObject, MCO_OPT_FREE_SERVICE, "FrameMenuFreeService");
return 0;
}
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index d203d954c9..dd77bc9232 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -53,21 +53,10 @@ typedef struct { static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
{
- int tick;
- HMENU hMenu;
- ListParam param = {0};
- param.MenuObjectHandle = hGroupMenuObject;
-
- //hMenu = hMainMenu;
- hMenu = CreatePopupMenu();
- //hMenu = wParam;
- tick = GetTickCount();
-
NotifyEventHooks(hPreBuildGroupMenuEvent, 0, 0);
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
- //DrawMenuBar((HWND)CallService("CLUI/GetHwnd",0,0));
- tick = GetTickCount() - tick;
+ HMENU hMenu = CreatePopupMenu();
+ Menu_Build(hMenu, hGroupMenuObject);
return (INT_PTR)hMenu;
}
@@ -92,7 +81,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam) }
tmi.ownerdata = mmep;
- HGENMENU hNewItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi);
+ HGENMENU hNewItem = Menu_AddItem(hGroupMenuObject, &tmi);
char buf[1024];
mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
@@ -241,7 +230,7 @@ void InitGroupMenus(void) InitSubGroupMenus();
//Group menu
- hGroupMenuObject = MO_CreateMenuObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
+ hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
@@ -369,16 +358,10 @@ static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM) static INT_PTR BuildSubGroupMenu(WPARAM wParam, LPARAM)
{
- ListParam param = {0};
- param.MenuObjectHandle = hSubGroupMenuObject;
- param.wParam = wParam;
-
- HMENU hMenu = CreatePopupMenu();
- int tick = GetTickCount();
NotifyEventHooks(hPreBuildSubGroupMenuEvent, wParam, 0);
- CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
- tick = GetTickCount() - tick;
+ HMENU hMenu = CreatePopupMenu();
+ Menu_Build(hMenu, hSubGroupMenuObject, wParam);
return (INT_PTR)hMenu;
}
@@ -402,8 +385,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam) mmep->Param2 = gmp->lParam;
}
tmi.ownerdata = mmep;
-
- HGENMENU hNewItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi);
+ HGENMENU hNewItem = Menu_AddItem(hSubGroupMenuObject, &tmi);
char buf[1024];
mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
@@ -489,7 +471,7 @@ void InitSubGroupMenus(void) HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
// SubGroup menu
- hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
+ hSubGroupMenuObject = Menu_AddObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuonAddService");
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index c45188b971..9b62cb0633 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -185,7 +185,7 @@ void RebuildMenu() ProtocolInfo *info = &proto_items[i];
if (info->hMenu != NULL)
- CallService(MO_REMOVEMENUITEM, (WPARAM) info->hMenu, 0);
+ Menu_RemoveItem(info->hMenu);
TCHAR text[512];
mir_sntprintf(text, TranslateT("Send to %s"), info->account);
@@ -245,7 +245,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam) }
else if (wParam == PRAC_REMOVED || (wParam == PRAC_CHECKED && !proto->bIsEnabled))
{
- CallService(MO_REMOVEMENUITEM, (WPARAM) info->hMenu, 0);
+ Menu_RemoveItem(info->hMenu);
for(std::vector<ProtocolInfo>::iterator it = proto_items.begin(); it != proto_items.end(); ++it)
{
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 08f86255bf..2631515ecb 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -745,7 +745,7 @@ static HGENMENU AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD fl return Menu_AddContactMenuItem(&mi);
}
-static void ModifySubmenuItem(HGENMENU hItem, TCHAR *name, int checked, int hidden)
+static void ModifySubmenuItem(HGENMENU hItem, int checked, int hidden)
{
int flags = 0;
if (checked)
@@ -789,13 +789,13 @@ int BuildMenu(WPARAM wparam, LPARAM) if (check)
all++;
- ModifySubmenuItem(hIgnoreItem[i], ii[i].name, check, 0);
+ ModifySubmenuItem(hIgnoreItem[i], check, 0);
if (all == _countof(ii) - 1) // ignor all
check = 1;
else
check = 0;
- ModifySubmenuItem(hIgnoreItem[0], ii[i].name, check, 0);
+ ModifySubmenuItem(hIgnoreItem[0], check, 0);
}
}
@@ -809,7 +809,7 @@ int BuildMenu(WPARAM wparam, LPARAM) }
int check = Proto_IsProtoOnContact(wparam, accs[i]->szModuleName);
- ModifySubmenuItem(hProtoItem[i], accs[i]->tszAccountName, check, hide);
+ ModifySubmenuItem(hProtoItem[i], check, hide);
}
Menu_ShowItem(hmenuProto, j > 1);
}
@@ -864,7 +864,7 @@ int EnumProtoSubmenu(WPARAM, LPARAM) {
if (hProtoItem[i])
{
- CallService(MO_REMOVEMENUITEM, (WPARAM)hProtoItem[i], 0);
+ Menu_RemoveItem(hProtoItem[i]);
hProtoItem[i] = 0;
}
}
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index 433620d7cb..3d5a041c4b 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -110,7 +110,7 @@ static int lua_RemoveMenuItem(lua_State *L) {
HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1);
- INT_PTR res = ::CallService(MO_REMOVEMENUITEM, (WPARAM)hMenuItem, 0);
+ INT_PTR res = ::Menu_RemoveItem(hMenuItem);
lua_pushinteger(L, res);
return 1;
diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index 55dad23416..f00c228042 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -15,9 +15,10 @@ MirOTRMenuExecParam,*lpMirOTRMenuExecParam; //////////////////////////////////////////// // MirOTR MENU /////////////////////////////////////////// + static INT_PTR RemoveMirOTRMenuItem(WPARAM wParam, LPARAM) { - CallService(MO_REMOVEMENUITEM,wParam,0); + Menu_RemoveItem((HGENMENU)wParam); return 0; } @@ -39,20 +40,13 @@ static INT_PTR AddMirOTRMenuItem(WPARAM, LPARAM lParam) lpMirOTRMenuExecParam cmep = ( lpMirOTRMenuExecParam )mir_calloc(sizeof(MirOTRMenuExecParam)); cmep->szServiceName = mir_strdup( mi->pszService ); tmi.ownerdata = cmep; - - INT_PTR menuHandle = CallService(MO_ADDNEWMENUITEM, (WPARAM) hMirOTRMenuObject, (LPARAM)&tmi ); - - return menuHandle; + return (INT_PTR)Menu_AddItem(hMirOTRMenuObject, &tmi); } static INT_PTR BuildMirOTRMenu(WPARAM hContact, LPARAM) { - ListParam param = { 0 }; - param.MenuObjectHandle = hMirOTRMenuObject; - param.wParam = hContact; HMENU hMenu = CreatePopupMenu(); - CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m); - + Menu_Build(hMenu, hMirOTRMenuObject, hContact); return (INT_PTR)hMenu; } @@ -72,9 +66,7 @@ INT_PTR MirOTRMenuExecService(WPARAM wParam,LPARAM lParam) // true - ok,false ignore INT_PTR MirOTRMenuCheckService(WPARAM wParam, LPARAM) { - PCheckProcParam pcpp = (PCheckProcParam)wParam; - TMO_MenuItem mi; - + TCheckProcParam *pcpp = (TCheckProcParam*)wParam; if (pcpp == NULL) return FALSE; @@ -89,6 +81,7 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam, LPARAM) ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact); TrustLevel level = (TrustLevel)otr_context_get_trust(context); + TMO_MenuItem mi; if (CallService(MO_GETMENUITEM, (WPARAM)pcpp->MenuItemHandle, (LPARAM)&mi) == 0) { if (mi.flags & CMIF_HIDDEN) return FALSE; if (mi.flags & CMIF_NOTPRIVATE && level == TRUST_PRIVATE) return FALSE; @@ -162,7 +155,8 @@ LRESULT CALLBACK PopupMenuWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM if (CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam)) return TRUE; break; case WM_COMMAND: - if (CallService(MO_PROCESSCOMMANDBYMENUIDENT, wParam, GetWindowLongPtr(hwnd, GWLP_USERDATA))) return TRUE; + if (Menu_ProcessCommandById(wParam, GetWindowLongPtr(hwnd, GWLP_USERDATA))) + return TRUE; break; } return DefWindowProc(hwnd, message, wParam, lParam); @@ -196,7 +190,7 @@ void InitMirOTRMenu(void) CreateServiceFunction(MS_MIROTR_MENUBUILDMIROTR, BuildMirOTRMenu); CreateServiceFunction(MS_MIROTR_REMOVEMIROTRMENUITEM, RemoveMirOTRMenuItem); - hMirOTRMenuObject = MO_CreateMenuObject("MirOTRMenu", LPGEN("MirOTR menu"), "MirOTRMenuCheckService", "MirOTRMenuExecService"); + hMirOTRMenuObject = Menu_AddObject("MirOTRMenu", LPGEN("MirOTR menu"), "MirOTRMenuCheckService", "MirOTRMenuExecService"); Menu_ConfigureObject(hMirOTRMenuObject, MCO_OPT_FREE_SERVICE, "MIROTRMENUS/FreeOwnerDataMirOTRMenu"); Menu_ConfigureObject(hMirOTRMenuObject, MCO_OPT_ONADD_SERVICE, "MIROTRMENUS/OnAddMenuItemMirOTRMenu"); @@ -248,7 +242,9 @@ void UninitMirOTRMenu(void) { DestroyWindow(hDummyPaintWin); hDummyPaintWin = 0; + UnregisterClass(_T("MirOTRPopupMenuProcessor"), hInst); - if (hMirOTRMenuObject) CallService(MO_REMOVEMENUOBJECT, (WPARAM)hMirOTRMenuObject, 0); + + Menu_RemoveObject(hMirOTRMenuObject); hMirOTRMenuObject = 0; } diff --git a/plugins/QuickSearch/sr_global.pas b/plugins/QuickSearch/sr_global.pas index d667d282c7..c7a160d990 100644 --- a/plugins/QuickSearch/sr_global.pas +++ b/plugins/QuickSearch/sr_global.pas @@ -244,21 +244,9 @@ begin ZeroMemory(@cmi,sizeof(cmi));
cmi.szName.a :=qs_name;
cmi.position :=500050000;
-// cmi.pszPopupName:=nil;
-// cmi.flags :=0;
cmi.pszService :=QS_SHOWSERVICE;
cmi.hIcon :=IcoLib_GetIcon(QS_QS,0);
MainMenuItem :=Menu_AddMainMenuItem(@cmi);
-
- begin
-{
- if (MainMenuItem<>0) then
- begin
- CallService(MO_REMOVEMENUITEM,MainMenuItem,0);
- MainMenuItem:=0;
- end;
-}
- end;
end;
// -------- column functions ---------
diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index ef57002e26..265bfbbfa1 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -1893,7 +1893,7 @@ begin case hMessage of
WM_DESTROY: begin
if srvhandle<>0 then DestroyServiceFunction(srvhandle);
- if mnuhandle<>0 then CallService(MO_REMOVEMENUITEM,mnuhandle,0);
+ if mnuhandle<>0 then Menu_RemoveItem(mnuhandle);
UnhookEvent(hAdd);
UnhookEvent(hDelete);
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index c51d077bb7..23c9b5b191 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -357,12 +357,6 @@ namespace {
return UnhookEvent(h);
}
-
- inline int Quotes_RemoveMenuItem(HGENMENU h)
- {
- return CallService(MO_REMOVEMENUITEM, reinterpret_cast<WPARAM>(h), 0);
- }
-
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 16e483c17b..5dd9c3bf07 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -262,7 +262,7 @@ INT_PTR CustomCatMenu(WPARAM hContact, LPARAM lParam) }
for (int i=0; i < menuHandleArray.getCount(); i++)
- CallService(MO_REMOVEMENUITEM, (WPARAM)menuHandleArray[i], 0);
+ Menu_RemoveItem((HGENMENU)menuHandleArray[i]);
menuHandleArray.destroy();
return TRUE;
@@ -285,7 +285,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) Menu_ShowItem(hContactMenuItem, haveMenu);
for (int i=0; i < menuHandleArray.getCount(); i++)
- CallService(MO_REMOVEMENUITEM, (WPARAM)menuHandleArray[i], 0);
+ Menu_RemoveItem((HGENMENU)menuHandleArray[i]);
menuHandleArray.destroy();
if (haveMenu) {
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 5f3a0b551f..e464d888c2 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -158,7 +158,7 @@ int TrafficCounterShutdown(WPARAM wParam, LPARAM lParam) // Удаляем пункт главного меню.
if (hTrafficMainMenuItem)
{
- CallService(MO_REMOVEMENUITEM, (WPARAM)hTrafficMainMenuItem, 0);
+ Menu_RemoveItem(hTrafficMainMenuItem);
hTrafficMainMenuItem = NULL;
}
// Удаляем контекстное меню.
diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index f3a74a2dcd..8765a4adca 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -324,7 +324,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, // Если отключается показ пункта главного меню, то удаляем его.
if (!unOptions.ShowMainMenuItem && hTrafficMainMenuItem)
{
- CallService(MO_REMOVEMENUITEM, (WPARAM)hTrafficMainMenuItem, 0);
+ Menu_RemoveItem(hTrafficMainMenuItem);
hTrafficMainMenuItem = NULL;
}
// Если включается, то создаём.
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 50a5e46a8a..9d44263735 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -47,7 +47,7 @@ INT_PTR RemoveMenuItems(HGENMENU *pItems, int Count) }
while (Count--) {
if (pItems[Count]) {
- CallService(MO_REMOVEMENUITEM, (WPARAM)pItems[Count], 0);
+ Menu_RemoveItem(pItems[Count]);
pItems[Count] = NULL;
}
}
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 1b8ee4a1bc..5ad7c0935f 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -196,7 +196,7 @@ void SvcEMailRebuildMenu() UnhookEvent(ME_CLIST_PREBUILDCONTACTMENU), hPrebuildMenuHook = NULL;
if (ghMenuItem) {
- CallService(MO_REMOVEMENUITEM, (WPARAM)ghMenuItem, NULL);
+ Menu_RemoveItem(ghMenuItem);
ghMenuItem = NULL;
}
}
diff --git a/plugins/Watrack/lastfm/lastfm.pas b/plugins/Watrack/lastfm/lastfm.pas index b814359974..12a144a8a7 100644 --- a/plugins/Watrack/lastfm/lastfm.pas +++ b/plugins/Watrack/lastfm/lastfm.pas @@ -234,7 +234,7 @@ begin else
DestroyServiceFunction(slastinf);
- CallService(MO_REMOVEMENUITEM,hMenuLast,0);
+ Menu_RemoveItem(hMenuLast);
hMenuLast:=0;
DestroyServiceFunction(slast);
diff --git a/plugins/Watrack/popup/popups.pas b/plugins/Watrack/popup/popups.pas index cf149f0adf..d714facb52 100644 --- a/plugins/Watrack/popup/popups.pas +++ b/plugins/Watrack/popup/popups.pas @@ -524,7 +524,7 @@ begin if aSetDisable then
SetModStatus(0);
- CallService(MO_REMOVEMENUITEM,hMenuInfo,0);
+ Menu_RemoveItem(hMenuInfo);
UnhookEvent(plStatusHook);
DestroyServiceFunction(ssmi);
diff --git a/plugins/Watrack/stat/statlog.pas b/plugins/Watrack/stat/statlog.pas index 38a8f01af8..c1a9fe0a76 100644 --- a/plugins/Watrack/stat/statlog.pas +++ b/plugins/Watrack/stat/statlog.pas @@ -596,7 +596,7 @@ begin if aSetDisable then
SetModStatus(0);
- CallService(MO_REMOVEMENUITEM,hMenuReport,0);
+ Menu_RemoveItem(hMenuReport);
DestroyServiceFunction(hPackLog);
DestroyServiceFunction(hMakeReport);
DestroyServiceFunction(hAddToLog);
diff --git a/plugins/mRadio/i_tray.inc b/plugins/mRadio/i_tray.inc index 7ed794c1a7..4a32675903 100644 --- a/plugins/mRadio/i_tray.inc +++ b/plugins/mRadio/i_tray.inc @@ -82,7 +82,7 @@ begin begin
mFreeMem(tmp.name);
DestroyServiceFunction(tmp.service);
- CallService(MO_REMOVEMENUITEM,tmp.menuitem,0);
+ Menu_RemoveItem(tmp.menuitem);
mFreeMem(tmp);
List_Remove(@trayStations,i);
end;
@@ -281,5 +281,5 @@ begin DestroyServiceFunction(srvtrayplaypause);
DestroyServiceFunction(srvtraystop);
- CallService(MO_REMOVEMENUITEM,trayradioparent,0);
+ Menu_RemoveItem(trayradioparent);
end;
|