From e58823d961a630eb62e60d2ccb443761ba5f1704 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Jun 2012 15:51:34 +0000 Subject: - all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs. - massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SmileyAdd/main.cpp | 5 ++--- plugins/SmileyAdd/services.cpp | 14 ++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'plugins/SmileyAdd') diff --git a/plugins/SmileyAdd/main.cpp b/plugins/SmileyAdd/main.cpp index 2515c6c076..e0965d8655 100644 --- a/plugins/SmileyAdd/main.cpp +++ b/plugins/SmileyAdd/main.cpp @@ -30,7 +30,7 @@ along with this program. If not, see . //globals HINSTANCE g_hInst; HANDLE hEvent1, hContactMenuItem; -extern LIST menuHandleArray; +extern LIST menuHandleArray; char* metaProtoName; @@ -105,7 +105,7 @@ static int ModulesLoaded(WPARAM, LPARAM) mi.icolibItem = hSkinIcon; mi.pszPopupName = (char*)-1; mi.pszName = "Assign Smiley Category"; - hContactMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi); + hContactMenuItem = Menu_AddContactMenuItem(&mi); DownloadInit(); @@ -124,7 +124,6 @@ static int MirandaShutdown(WPARAM, LPARAM) return 0; } - extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) { pluginLink = link; diff --git a/plugins/SmileyAdd/services.cpp b/plugins/SmileyAdd/services.cpp index 71b43145dc..1993e7e733 100644 --- a/plugins/SmileyAdd/services.cpp +++ b/plugins/SmileyAdd/services.cpp @@ -27,8 +27,7 @@ along with this program. If not, see . //globals, defined int main.cpp extern HANDLE hEvent1, hContactMenuItem; -LIST menuHandleArray(5); - +LIST menuHandleArray(5); //implementation of service functions @@ -444,7 +443,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) mi.pszService = MS_SMILEYADD_CUSTOMCATMENU; bool nonecheck = true; - HANDLE* hMenu; + HGENMENU hMenu; for (i = 0; i < smc.getCount(); i++) { @@ -462,7 +461,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) nonecheck = false; } - hMenu = (HANDLE*)CallService(MS_CLIST_ADDCONTACTMENUITEM, ind, (LPARAM)&mi); + hMenu = Menu_AddContactMenuItem(&mi); menuHandleArray.insert(hMenu); mi.flags &= ~CMIF_CHECKED; } @@ -470,13 +469,12 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) mi.position = 1; mi.popupPosition = 1; mi.ptszName = _T(""); - if (cat == _T("")) - { + if (cat == _T("")) { mi.flags |= CMIF_CHECKED; nonecheck = false; } - hMenu = (HANDLE*)CallService(MS_CLIST_ADDCONTACTMENUITEM, 1, (LPARAM)&mi); + hMenu = Menu_AddContactMenuItem(&mi); menuHandleArray.insert(hMenu); mi.position = 2; @@ -484,7 +482,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) mi.ptszName = _T("Protocol specific"); if (nonecheck) mi.flags |= CMIF_CHECKED; else mi.flags &= ~CMIF_CHECKED; - hMenu = (HANDLE*)CallService(MS_CLIST_ADDCONTACTMENUITEM, 2, (LPARAM)&mi); + hMenu = Menu_AddContactMenuItem(&mi); menuHandleArray.insert(hMenu); } -- cgit v1.2.3