summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 23:13:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 23:13:56 +0000
commit4810d4b1b7a47701b8e6c45490fb2643ea425123 (patch)
treefb94dd5889fdd0558605ffe738f0b2d6d2f08ca2
parent007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (diff)
rest of menu cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4325 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Alarms/src/frame.cpp4
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp6
-rw-r--r--plugins/AvatarHistory/src/icolib.cpp2
-rw-r--r--plugins/BasicHistory/src/BasicHistory.cpp6
-rw-r--r--plugins/Boltun/src/boltun.cpp23
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp8
-rw-r--r--plugins/BossKeyPlus/src/Options.cpp2
-rw-r--r--plugins/BuddyPounce/src/main.cpp3
-rw-r--r--plugins/ClientChangeNotify/src/ClientChangeNotify.cpp8
-rw-r--r--plugins/Clist_modern/src/hdr/modern_cluiframes.h10
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp15
-rw-r--r--plugins/Clist_modern/src/modern_cluiframes.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_groupmenu.cpp61
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp29
-rw-r--r--plugins/Clist_mw/src/groupmenu.cpp44
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp24
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.h7
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp73
-rw-r--r--plugins/Console/src/Console.cpp7
-rw-r--r--plugins/CyrTranslit/src/MirandaContact.cpp4
-rw-r--r--plugins/CyrTranslit/src/MirandaContact.h2
-rw-r--r--plugins/Dbx_mmap_SA/src/commonheaders.h5
-rw-r--r--plugins/Dbx_mmap_SA/src/dialogs.cpp6
-rw-r--r--plugins/FloatingContacts/src/main.cpp2
-rw-r--r--plugins/HTTPServer/src/main.cpp11
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist.cpp1
-rw-r--r--plugins/ListeningTo/src/commons.h2
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp6
-rwxr-xr-xplugins/MetaContacts/src/meta_services.cpp4
-rw-r--r--plugins/MyDetails/src/frame.cpp4
-rw-r--r--plugins/NewEventNotify/src/menuitem.cpp4
-rw-r--r--plugins/NewXstatusNotify/src/common.h2
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp6
-rwxr-xr-xplugins/New_GPG/src/init.cpp24
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp9
-rw-r--r--plugins/NewsAggregator/Src/Common.h2
-rw-r--r--plugins/NewsAggregator/Src/Menus.cpp4
-rw-r--r--plugins/NewsAggregator/Src/Services.cpp2
-rw-r--r--plugins/NoHistory/src/dllmain.cpp2
-rw-r--r--plugins/PasteIt/src/PasteIt.cpp2
-rw-r--r--plugins/Popup/src/main.cpp30
-rw-r--r--plugins/Quotes/src/QuoteInfoDlg.cpp4
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp4
-rw-r--r--plugins/SMS/src/SMSConstans.h9
-rw-r--r--plugins/SMS/src/SMS_svc.cpp94
-rw-r--r--plugins/SMS/src/common.h10
-rw-r--r--plugins/SMS/src/main.cpp26
-rw-r--r--plugins/Scriver/src/chat/clist.cpp2
-rw-r--r--plugins/Sessions/Src/Main.cpp7
-rw-r--r--plugins/SimpleAR/src/Main.cpp8
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp5
-rw-r--r--plugins/UserInfoEx/src/mir_menuitems.cpp2
-rw-r--r--plugins/UserInfoEx/src/mir_menuitems.h2
-rw-r--r--plugins/UserInfoEx/src/svc_refreshci.cpp4
-rw-r--r--plugins/Weather/src/weather.h3
-rw-r--r--plugins/Weather/src/weather_mwin.cpp4
-rw-r--r--plugins/Weather/src/weather_svcs.cpp4
-rw-r--r--plugins/WhoUsesMyFiles/src/wumfplug.cpp6
-rw-r--r--plugins/YAPP/src/services.cpp4
-rw-r--r--plugins/ZeroNotification/src/main.cpp2
-rw-r--r--protocols/AimOscar/src/proto.cpp2
-rw-r--r--protocols/FacebookRM/src/avatars.cpp2
-rw-r--r--protocols/FacebookRM/src/proto.h4
-rw-r--r--protocols/FacebookRM/src/theme.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp2
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp12
-rw-r--r--protocols/IRCG/src/ircproto.cpp2
-rw-r--r--protocols/IRCG/src/options.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp4
-rw-r--r--protocols/IcqOscarJ/src/init.cpp12
-rw-r--r--protocols/MRA/src/Mra_functions.cpp2
-rw-r--r--protocols/MSN/src/msn_proto.cpp2
-rw-r--r--protocols/Tlen/src/jabber.h2
-rw-r--r--protocols/Tlen/src/jabber_iqid.cpp4
-rw-r--r--protocols/Tlen/src/jabber_svc.cpp2
-rw-r--r--protocols/Tlen/src/jabber_thread.cpp4
-rw-r--r--protocols/Tlen/src/tlen.cpp4
-rw-r--r--protocols/Yahoo/src/proto.cpp2
-rw-r--r--src/modules/clist/clistmenus.cpp5
79 files changed, 322 insertions, 437 deletions
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp
index 9f168a6bad..d73c8e7001 100644
--- a/plugins/Alarms/src/frame.cpp
+++ b/plugins/Alarms/src/frame.cpp
@@ -18,7 +18,7 @@ HBRUSH bk_brush = 0;
AlarmList alarm_list;
CRITICAL_SECTION list_cs;
-HANDLE hMenuShowReminders = 0;
+HGENMENU hMenuShowReminders = 0;
#define ID_FRAME_UPDATE_TIMER 1011
#define ID_FRAME_SHOWHIDE_TIMER 1012
@@ -466,7 +466,7 @@ void FixMainMenu()
mi.pszName = Translate("Show Reminders");
}
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuShowReminders, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuShowReminders, &mi);
}
/////////////////////////
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index c26d570aa0..05ed98263d 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -427,7 +427,7 @@ void SetShutdownToolbarButton(BOOL fActive)
/************************* Menu Item **********************************/
-static HANDLE hMainMenuItem,hTrayMenuItem;
+static HGENMENU hMainMenuItem,hTrayMenuItem;
void SetShutdownMenuItem(BOOL fActive)
{
@@ -440,7 +440,7 @@ void SetShutdownMenuItem(BOOL fActive)
mi.flags = CMIF_TCHAR | CMIF_ICONFROMICOLIB;
if (hMainMenuItem != NULL) {
mi.flags |= CMIM_NAME | CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMainMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hMainMenuItem, &mi);
}
else hMainMenuItem = Menu_AddMainMenuItem(&mi);
@@ -448,7 +448,7 @@ void SetShutdownMenuItem(BOOL fActive)
mi.position = 899999;
if(hTrayMenuItem != NULL) {
mi.flags |= CMIM_NAME | CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hTrayMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hTrayMenuItem, &mi);
}
else hTrayMenuItem = Menu_AddTrayMenuItem(&mi);
diff --git a/plugins/AvatarHistory/src/icolib.cpp b/plugins/AvatarHistory/src/icolib.cpp
index cc971b8d6e..5ff2475db7 100644
--- a/plugins/AvatarHistory/src/icolib.cpp
+++ b/plugins/AvatarHistory/src/icolib.cpp
@@ -27,7 +27,7 @@ static void IcoLibUpdateMenus()
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIM_ICON;
mi.hIcon = createDefaultOverlayedIcon(FALSE);
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenu, ( LPARAM )&mi );
+ Menu_ModifyItem(hMenu, &mi);
DestroyIcon(mi.hIcon);
}
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp
index 1a4c589d4e..7810489920 100644
--- a/plugins/BasicHistory/src/BasicHistory.cpp
+++ b/plugins/BasicHistory/src/BasicHistory.cpp
@@ -142,7 +142,7 @@ void InitTaskMenuItems()
mi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_CHILDPOPUP | CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.hParentMenu = hTaskMainMenu;
mi.ptszName = (TCHAR*)taskIt->taskName.c_str();
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HGENMENU)*it, (LPARAM)&mi);
+ Menu_ModifyItem((HGENMENU)*it, &mi);
}
for(; it != taskMenus.end(); ++it)
@@ -151,7 +151,7 @@ void InitTaskMenuItems()
mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP | CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | CMIF_HIDDEN;
mi.hParentMenu = hTaskMainMenu;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HGENMENU)*it, (LPARAM)&mi);
+ Menu_ModifyItem((HGENMENU)*it, &mi);
}
int pos = (int)taskMenus.size();
@@ -172,7 +172,7 @@ void InitTaskMenuItems()
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_ROOTPOPUP | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hTaskMainMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hTaskMainMenu, &mi);
}
}
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp
index 69cc4f0055..cfc03855a2 100644
--- a/plugins/Boltun/src/boltun.cpp
+++ b/plugins/Boltun/src/boltun.cpp
@@ -47,17 +47,10 @@ PLUGININFOEX pluginInfo = {
{0x488c5c84, 0x56da, 0x434f, {0x96, 0xf1, 0xb1, 0x89, 0x0, 0xde, 0xf7, 0x60}}
};
-static HANDLE hEventDbEventAdded;
-static HANDLE hEventOptInitialise;
-static HANDLE hEventPrebuild;
-static HANDLE hMenuItemAutoChat;
-static HANDLE hMenuItemNotToChat;
-static HANDLE hMenuItemStartChatting;
-
+static HGENMENU hMenuItemAutoChat, hMenuItemNotToChat, hMenuItemStartChatting;
#define MIND_DIALOG_FILTER _T("%s (*.mindw)\1*.mindw\1%s (*.*)\1*.*\1")
-
#ifdef DEBUG_LOAD_TIME
#include <intrin.h>
#endif
@@ -568,8 +561,8 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam)
{
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemAutoChat, (LPARAM)&clmi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemNotToChat, (LPARAM)&clmi);
+ Menu_ModifyItem(hMenuItemAutoChat, &clmi);
+ Menu_ModifyItem(hMenuItemNotToChat, &clmi);
}
else
{
@@ -578,11 +571,11 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam)
clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunautochat ? CMIF_CHECKED : 0);
clmi.hIcon = LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE((boltunautochat ? IDI_TICK : IDI_NOTICK)));
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemAutoChat, (LPARAM)&clmi);
+ Menu_ModifyItem(hMenuItemAutoChat, &clmi);
clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunnottochat ? CMIF_CHECKED : 0);
clmi.hIcon = LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE((boltunnottochat ? IDI_TICK : IDI_NOTICK)));
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemNotToChat, (LPARAM)&clmi);
+ Menu_ModifyItem(hMenuItemNotToChat, &clmi);
}
return 0;
}
@@ -612,10 +605,10 @@ extern "C" int __declspec(dllexport) Load(void)
*(_tcsrchr(path, _T('\\'))+1) = _T('\0');
/*initialize miranda hooks and services on options dialog*/
- hEventOptInitialise = HookEvent(ME_OPT_INITIALISE, MessageOptInit);
+ HookEvent(ME_OPT_INITIALISE, MessageOptInit);
/*initialize miranda hooks and services*/
- hEventDbEventAdded = HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded);
- hEventPrebuild = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MessagePrebuild);
+ HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MessagePrebuild);
CreateServiceFunction(SERV_CONTACT_AUTO_CHAT, ContactClickAutoChat);
CreateServiceFunction(SERV_CONTACT_NOT_TO_CHAT, ContactClickNotToChat);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index f760da383e..23a52f1ef7 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -31,7 +31,8 @@
// unique to this DLL, not to be shared
HINSTANCE g_hInstance;
CLIST_INTERFACE *pcli;
-HANDLE g_hMenuItem, g_hHideService, g_hIsHiddenService;
+HGENMENU g_hMenuItem;
+HANDLE g_hHideService, g_hIsHiddenService;
HWINEVENTHOOK g_hWinHook;
HWND g_hListenWindow, hDlg, g_hDlgPass, hOldForegroundWindow;
HWND_ITEM *g_pMirWnds; // a pretty simple linked list
@@ -602,8 +603,7 @@ static IconItem iconList[] =
static int GenMenuInit(WPARAM wParam, LPARAM lParam) // Modify menu item text before to show the main menu
{
- if (g_hMenuItem)
- {
+ if (g_hMenuItem) {
TCHAR buf[128] = {0};
mir_sntprintf(buf, SIZEOF(buf), _T("%s [%s]"), TranslateT("Hide"), GetBossKeyText());
@@ -611,7 +611,7 @@ static int GenMenuInit(WPARAM wParam, LPARAM lParam) // Modify menu item text be
mi.flags = CMIM_FLAGS | CMIF_TCHAR | CMIM_NAME;
mi.ptszName = buf;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenuItem,(LPARAM)&mi);
+ Menu_ModifyItem(g_hMenuItem, &mi);
}
return 0;
}
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp
index 01b0b073ae..dc0f1d5636 100644
--- a/plugins/BossKeyPlus/src/Options.cpp
+++ b/plugins/BossKeyPlus/src/Options.cpp
@@ -21,7 +21,7 @@
bool g_fOptionsOpen;
bool g_fReqRass;
-extern HANDLE g_hMenuItem;
+extern HGENMENU g_hMenuItem;
//void Disable_ChildWindows(HWND hwndParent)
//{
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp
index 1b92532deb..8a1fe01b2a 100644
--- a/plugins/BuddyPounce/src/main.cpp
+++ b/plugins/BuddyPounce/src/main.cpp
@@ -43,8 +43,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
int MainInit(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM mi = {0};
- mi.cbSize=sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position=10;
mi.flags=0;
mi.hIcon= LoadIcon(hInst,MAKEINTRESOURCE(IDI_POUNCE));
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
index dac4399850..9809c4d3a4 100644
--- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
+++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
@@ -20,9 +20,9 @@
#include "Common.h"
HINSTANCE g_hInstance;
-HANDLE g_hMainThread;
-HANDLE g_hTogglePopupsMenuItem;
-int hLangpack;
+HANDLE g_hMainThread;
+HGENMENU g_hTogglePopupsMenuItem;
+int hLangpack;
COptPage *g_PreviewOptPage; // we need to show popup even for the NULL contact if g_PreviewOptPage is not NULL (used for popup preview)
BOOL bPopupExists = FALSE, bMetaContactsExists = FALSE, bFingerprintExists = FALSE, bVariablesExists = FALSE;
@@ -346,7 +346,7 @@ static int PrebuildMainMenu(WPARAM wParam, LPARAM lParam)
mi.hIcon = Skin_GetIcon("popup_disabled");
}
mi.ptszPopupName = LPGENT("PopUps");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hTogglePopupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(g_hTogglePopupsMenuItem, &mi);
}
return 0;
}
diff --git a/plugins/Clist_modern/src/hdr/modern_cluiframes.h b/plugins/Clist_modern/src/hdr/modern_cluiframes.h
index d10b828a17..f4cc677610 100644
--- a/plugins/Clist_modern/src/hdr/modern_cluiframes.h
+++ b/plugins/Clist_modern/src/hdr/modern_cluiframes.h
@@ -59,12 +59,10 @@ typedef struct
struct FrameMenuHandles
{
- HANDLE MainMenuItem;
- HANDLE MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
- HANDLE MIAlignTop,MIAlignClient,MIAlignBottom;
- HANDLE MIBorder;
- HANDLE MIPosRoot;
- HANDLE MIPosUp,MIPosDown;
+ HGENMENU MainMenuItem;
+ HGENMENU MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
+ HGENMENU MIAlignTop,MIAlignClient,MIAlignBottom;
+ HGENMENU MIBorder, MIPosRoot, MIPosUp, MIPosDown;
};
struct FrameTitleBar
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 444fc233b3..42a1d0b016 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -67,9 +67,10 @@ void UninitCustomMenus(void)
#define CLUI_FAVSETRATE "CLUI/SetContactRate" //LParam is rate, Wparam is contact handle
#define CLUI_FAVTOGGLESHOWOFFLINE "CLUI/ToggleContactShowOffline"
-static HGENMENU hFavoriteContactMenu = NULL;
-static HANDLE *hFavoriteContactMenuItems = NULL;
-static HANDLE hShowIfOflineItem = NULL;
+static HGENMENU hFavoriteContactMenu = NULL;
+static HGENMENU *hFavoriteContactMenuItems = NULL;
+
+static HGENMENU hShowIfOflineItem = NULL;
static HANDLE hOnContactMenuBuild_FAV = NULL;
static TCHAR * FAVMENUROOTNAME = LPGENT("&Contact rate");
@@ -114,7 +115,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
else {
mi.flags |= CMIM_FLAGS | CMIM_NAME;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hFavoriteContactMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hFavoriteContactMenu, &mi);
bModifyMenu = TRUE;
}
@@ -126,7 +127,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
mi.hParentMenu = hFavoriteContactMenu;
if ( !hFavoriteContactMenuItems) {
- hFavoriteContactMenuItems = (HANDLE*)malloc(sizeof(HANDLE)*SIZEOF(rates));
+ hFavoriteContactMenuItems = (HGENMENU*)malloc(sizeof(HANDLE)*SIZEOF(rates));
memset(hFavoriteContactMenuItems, 0, sizeof(HANDLE)*SIZEOF(rates));
}
@@ -139,7 +140,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
mi.popupPosition = i;
if (bModifyMenu && hFavoriteContactMenuItems[i]) {
mi.flags |= CMIM_FLAGS | CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenuItems[i], (LPARAM)&mi);
+ Menu_ModifyItem(hFavoriteContactMenuItems[i], &mi);
}
else hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
}
@@ -152,7 +153,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
mi.position = -100000000;
if (bModifyMenu && hShowIfOflineItem) {
mi.flags |= CMIM_FLAGS | CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hShowIfOflineItem, (LPARAM)&mi);
+ Menu_ModifyItem(hShowIfOflineItem, &mi);
}
else hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp
index ff162fc7f7..1f0bdb8beb 100644
--- a/plugins/Clist_modern/src/modern_cluiframes.cpp
+++ b/plugins/Clist_modern/src/modern_cluiframes.cpp
@@ -1055,42 +1055,42 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
mi.flags = CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
if (g_pfwFrames[pos].visible) mi.flags |= CMIF_CHECKED;
mi.ptszName = g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIVisible,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIVisible, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].Locked) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MILock,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MILock, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MITBVisible,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MITBVisible, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].floating) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIFloating,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIFloating, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if ( g_CluiData.fLayered ) mi.flags |= CMIF_GRAYED;
else if ((g_pfwFrames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIBorder,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIBorder, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
if (g_pfwFrames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignTop,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIAlignTop, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignClient,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIAlignClient, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
if (g_pfwFrames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignBottom,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIAlignBottom, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].collapsed) mi.flags |= CMIF_CHECKED;
if ((!g_pfwFrames[pos].visible) || g_pfwFrames[pos].Locked || (pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIColl,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIColl, &mi);
}
return 0;
diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp
index df63d36e8f..ab78f0f0b6 100644
--- a/plugins/Clist_modern/src/modern_groupmenu.cpp
+++ b/plugins/Clist_modern/src/modern_groupmenu.cpp
@@ -28,16 +28,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////Group MENU/////////////////////////
HANDLE hGroupMenuObject;
-HANDLE hGroupMainMenuItemProxy;
-HANDLE hHideShowMainMenuItem;
-HANDLE hGroupStatusMenuItemProxy;
+HGENMENU hGroupMainMenuItemProxy;
+HGENMENU hHideShowMainMenuItem;
+HGENMENU hGroupStatusMenuItemProxy;
-HANDLE hHideOfflineUsersMenuItem;
-HANDLE hHideOfflineUsersOutHereMenuItem;
-HANDLE hHideEmptyGroupsMenuItem;
-HANDLE hDisableGroupsMenuItem;
-HANDLE hNewGroupMenuItem;
-HANDLE hNewSubGroupMenuItem;
+HGENMENU hHideOfflineUsersMenuItem;
+HGENMENU hHideOfflineUsersOutHereMenuItem;
+HGENMENU hHideEmptyGroupsMenuItem;
+
+HGENMENU hDisableGroupsMenuItem;
+HGENMENU hNewGroupMenuItem;
+HGENMENU hNewSubGroupMenuItem;
int NewGroupIconidx;
@@ -209,16 +210,16 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | ( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersMenuItem, &mi);
mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT, 0, 0)?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersOutHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, &mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideEmptyGroupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideEmptyGroupsMenuItem, &mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableGroupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hDisableGroupsMenuItem, &mi);
return 0;
}
@@ -235,8 +236,8 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON;
clmi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewSubGroupMenuItem,(LPARAM)&clmi);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewGroupMenuItem,(LPARAM)&clmi);
+ Menu_ModifyItem(hNewSubGroupMenuItem, &clmi);
+ Menu_ModifyItem(hNewGroupMenuItem, &clmi);
return 0;
}
@@ -302,7 +303,7 @@ void GroupMenus_Init(void)
mi.pszService = MS_CLIST_SHOWHIDE;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.pszName = LPGEN("&Hide/Show");
- hHideShowMainMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 200000;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
@@ -314,13 +315,13 @@ void GroupMenus_Init(void)
mi.pszService = "";
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
mi.pszName = LPGEN("&Main Menu");
- hGroupMainMenuItemProxy = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 300100;
mi.pszService = "";
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
mi.pszName = LPGEN("&Status");
- hGroupStatusMenuItemProxy = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 400000;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
@@ -339,7 +340,7 @@ void GroupMenus_Init(void)
mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
mi.pszName = LPGEN("&New Group");
- hNewGroupMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
mi.position = 100001;
@@ -347,22 +348,22 @@ void GroupMenus_Init(void)
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.pszName = LPGEN("&Hide Offline Users");
gmp.lParam = 0;gmp.wParam = -1;
- hHideOfflineUsersMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+ hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
mi.position = 100002;
mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
mi.pszName = LPGEN("Hide &Offline Users out here");
- hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 100003;
mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
mi.pszName = LPGEN("Hide &Empty Groups");
- hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 100004;
mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
mi.pszName = LPGEN("Disable &Groups");
- hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
HookEvent(ME_SKIN2_ICONSCHANGED, OnIconLibIconChanged);
}
@@ -374,8 +375,8 @@ HANDLE hSubGroupMenuObject;
HANDLE hSubGroupMainMenuItemProxy;
HANDLE hSubGroupStatusMenuItemProxy;
-HANDLE hHideOfflineUsersHereMenuItem;
-HANDLE hShowOfflineUsersHereMenuItem;
+
+HGENMENU hHideOfflineUsersHereMenuItem, hShowOfflineUsersHereMenuItem;
//SubGroupmenu exec param(ownerdata)
typedef struct{
@@ -413,10 +414,10 @@ static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | ((group->hideOffline && !gray1)?CMIF_CHECKED:0)| (gray1?CMIF_GRAYED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
mi.flags = CMIM_FLAGS | ((showOfflineinGroup && !gray2) ? CMIF_CHECKED:0)| (gray2?CMIF_GRAYED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowOfflineUsersHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hShowOfflineUsersHereMenuItem, &mi);
return 0;
}
@@ -586,7 +587,7 @@ void InitSubGroupMenus(void)
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&New SubGroup");
gmp.lParam = 0;gmp.wParam = POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
mi.position = 1001;
@@ -595,7 +596,7 @@ void InitSubGroupMenus(void)
mi.pszName = LPGEN("&Hide Offline Users in here");
gmp.lParam = 0;
gmp.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
mi.position = 1002;
mi.hIcon = NULL;
@@ -603,7 +604,7 @@ void InitSubGroupMenus(void)
mi.pszName = LPGEN("&Show Offline Users in here");
gmp.lParam = 0;
gmp.wParam = POPUP_GROUPSHOWOFFLINE;
- hShowOfflineUsersHereMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hShowOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
index 498dc2e896..4441022cfa 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
@@ -77,10 +77,9 @@ static int sortfunc(const void *a,const void *b)
#define CLUIFRAMESMOVEUPDOWN "CLUIFramesMoveUpDown"
typedef struct tagMenuHandles
{
- HANDLE MainMenuItem;
- HANDLE MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
- HANDLE MIAlignTop,MIAlignClient,MIAlignBottom;
- HANDLE MIBorder;
+ HGENMENU MainMenuItem;
+ HGENMENU MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
+ HGENMENU MIAlignTop,MIAlignClient,MIAlignBottom,MIBorder;
} FrameMenuHandles;
typedef struct tagFrameTitleBar{
@@ -632,7 +631,7 @@ int CLUIFramesGetalClientFrame(void)
HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
- HANDLE menuid;
+ HGENMENU menuid;
int framepos = id2pos(frameid);
CLISTMENUITEM mi = { sizeof(mi) };
@@ -864,44 +863,44 @@ INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MITitle,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MITitle, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].visible) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIVisible,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIVisible, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].Locked) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MILock,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MILock, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MITBVisible,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MITBVisible, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].floating) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIFloating,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIFloating, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if ((Frames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIBorder,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIBorder, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
if (Frames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignTop,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignTop, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignClient,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignClient, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
if (Frames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignBottom,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignBottom, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].collapsed) mi.flags |= CMIF_CHECKED;
if ((!Frames[pos].visible)||Frames[pos].Locked||(pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIColl,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIColl, &mi);
}
ulockfrm();
return 0;
diff --git a/plugins/Clist_mw/src/groupmenu.cpp b/plugins/Clist_mw/src/groupmenu.cpp
index 118d66a463..121f166b26 100644
--- a/plugins/Clist_mw/src/groupmenu.cpp
+++ b/plugins/Clist_mw/src/groupmenu.cpp
@@ -34,12 +34,8 @@ HANDLE hGroupMainMenuItemProxy;
HANDLE hGroupStatusMenuItemProxy;
HANDLE hPreBuildGroupMenuEvent;
-HANDLE hHideOfflineUsersMenuItem;
-HANDLE hHideOfflineUsersOutHereMenuItem;
-HANDLE hHideEmptyGroupsMenuItem;
-HANDLE hDisableGroupsMenuItem;
-HANDLE hNewGroupMenuItem;
-HANDLE hNewSubGroupMenuItem;
+HGENMENU hHideOfflineUsersMenuItem, hHideOfflineUsersOutHereMenuItem, hHideEmptyGroupsMenuItem;
+HGENMENU hDisableGroupsMenuItem, hNewGroupMenuItem, hNewSubGroupMenuItem;
int NewGroupIconidx;
@@ -211,16 +207,16 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | ( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersMenuItem, &mi);
mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT,0,0)?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersOutHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, &mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideEmptyGroupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideEmptyGroupsMenuItem, &mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableGroupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hDisableGroupsMenuItem, &mi);
return 0;
}
@@ -232,8 +228,8 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON;
mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewSubGroupMenuItem,(LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewGroupMenuItem,(LPARAM)&mi);
+ Menu_ModifyItem(hNewSubGroupMenuItem, &mi);
+ Menu_ModifyItem(hNewGroupMenuItem, &mi);
return 0;
}
@@ -334,7 +330,6 @@ void InitGroupMenus(void)
AddGroupMenuItem(0,(LPARAM)&mi);
-
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 500000;
@@ -350,7 +345,7 @@ void InitGroupMenus(void)
mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
mi.pszService = MS_CLIST_GROUPCREATE;
mi.pszName = LPGEN("&New Group");
- hNewGroupMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -359,7 +354,7 @@ void InitGroupMenus(void)
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.pszName = LPGEN("&Hide Offline Users");
gmp.lParam = 0;gmp.wParam = -1;
- hHideOfflineUsersMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -367,8 +362,7 @@ void InitGroupMenus(void)
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
mi.pszName = LPGEN("Hide &Offline Users out here");
- hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
+ hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -376,9 +370,7 @@ void InitGroupMenus(void)
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
mi.pszName = LPGEN("Hide &Empty Groups");
- hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
-
+ hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -386,8 +378,7 @@ void InitGroupMenus(void)
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
mi.pszName = LPGEN("Disable &Groups");
- hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
+ hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
@@ -407,7 +398,8 @@ HANDLE hSubGroupMenuObject;
HANDLE hSubGroupMainMenuItemProxy;
HANDLE hSubGroupStatusMenuItemProxy;
HANDLE hPreBuildSubGroupMenuEvent;
-HANDLE hHideOfflineUsersHereMenuItem;
+
+HGENMENU hHideOfflineUsersHereMenuItem;
//SubGroupmenu exec param(ownerdata)
typedef struct{
@@ -433,7 +425,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
//contact->group
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (group->hideOffline?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
return 0;
}
@@ -590,7 +582,7 @@ void InitSubGroupMenus(void)
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&New SubGroup");
gmp.lParam = 0;gmp.wParam = POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -599,7 +591,7 @@ void InitSubGroupMenus(void)
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&Hide Offline Users in here");
gmp.lParam = 0;gmp.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index 0eb0752233..052ef37f2d 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -636,7 +636,7 @@ int CLUIFramesGetalClientFrame(void)
HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
- HANDLE menuid;
+ HGENMENU menuid;
int framepos = id2pos(frameid);
if (FramesSysNotStarted)
@@ -902,48 +902,48 @@ INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam, LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIF_CHILDPOPUP | CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MITitle, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MITitle, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP;
if (Frames[pos].visible) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MIVisible, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIVisible, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP;
if (Frames[pos].Locked) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MILock, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MILock, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP;
if (Frames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MITBVisible, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MITBVisible, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP;
if (Frames[pos].floating) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MIFloating, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIFloating, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP;
if ((Frames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MIBorder, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIBorder, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP;
if ((Frames[pos].Skinned)) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MISkinned, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MISkinned, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP | ((Frames[pos].align & alClient) ? CMIF_GRAYED : 0);
if (Frames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MIAlignTop, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignTop, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP;
if (Frames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MIAlignClient, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignClient, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP | ((Frames[pos].align & alClient) ? CMIF_GRAYED : 0);
if (Frames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MIAlignBottom, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignBottom, &mi);
mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP;
if ( !Frames[pos].collapsed) mi.flags |= CMIF_CHECKED;
if ((!Frames[pos].visible) || Frames[pos].Locked || (pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MIColl, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIColl, &mi);
}
ulockfrm();
return 0;
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
index 083066ca6d..60caca8ab8 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
@@ -49,10 +49,9 @@ typedef struct _DockOpt {
DockOpt;
typedef struct tagMenuHandles {
- HANDLE MainMenuItem;
- HANDLE MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
- HANDLE MIAlignTop,MIAlignClient,MIAlignBottom;
- HANDLE MIBorder, MISkinned;
+ HGENMENU MainMenuItem;
+ HGENMENU MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
+ HGENMENU MIAlignTop,MIAlignClient,MIAlignBottom,MIBorder,MISkinned;
} FrameMenuHandles;
typedef struct tagFrameTitleBar {
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
index 7e3e32361d..fd261b6f6a 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
@@ -24,22 +24,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////Group MENU/////////////////////////
HANDLE hGroupMenuObject;
-
-HANDLE hGroupMainMenuItemProxy;
-HANDLE hHideShowMainMenuItem;
-HANDLE hGroupStatusMenuItemProxy;
HANDLE hPreBuildGroupMenuEvent;
-HANDLE hAppearanceMenuItemProxy;
-HANDLE hEventAreaMenuItemProxy;
+
+HGENMENU hGroupMainMenuItemProxy;
+HGENMENU hHideShowMainMenuItem;
+HGENMENU hGroupStatusMenuItemProxy;
+HGENMENU hAppearanceMenuItemProxy;
+HGENMENU hEventAreaMenuItemProxy;
static HMENU hMenuOldContext;
-HANDLE hHideOfflineUsersMenuItem;
-HANDLE hHideOfflineUsersOutHereMenuItem;
-HANDLE hHideEmptyGroupsMenuItem;
-HANDLE hDisableGroupsMenuItem;
-HANDLE hNewGroupMenuItem;
-HANDLE hNewSubGroupMenuItem;
+HGENMENU hHideOfflineUsersMenuItem;
+HGENMENU hHideOfflineUsersOutHereMenuItem;
+HGENMENU hHideEmptyGroupsMenuItem;
+HGENMENU hDisableGroupsMenuItem;
+HGENMENU hNewGroupMenuItem;
+HGENMENU hNewSubGroupMenuItem;
int NewGroupIconidx;
@@ -220,22 +220,22 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (cfg::getByte("CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersMenuItem, &mi);
mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT,0,0)?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersOutHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, &mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideEmptyGroupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideEmptyGroupsMenuItem, &mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableGroupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hDisableGroupsMenuItem, &mi);
mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hGroupMainMenuItemProxy, (LPARAM)&mi);
+ Menu_ModifyItem(hGroupMainMenuItemProxy, &mi);
mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAppearanceMenuItemProxy, (LPARAM)&mi);
+ Menu_ModifyItem(hAppearanceMenuItemProxy, &mi);
return 0;
}
@@ -244,8 +244,8 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON;
clmi.hIcon = ImageList_GetIcon(hCListImages, NewGroupIconidx, 0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hNewSubGroupMenuItem, (LPARAM)&clmi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hNewGroupMenuItem, (LPARAM)&clmi);
+ Menu_ModifyItem(hNewSubGroupMenuItem, &clmi);
+ Menu_ModifyItem(hNewGroupMenuItem, &clmi);
return 0;
}
@@ -266,7 +266,7 @@ void InitGroupMenus(void)
CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
- hPreBuildGroupMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
+ hPreBuildGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
HookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);
InitSubGroupMenus();
@@ -310,7 +310,7 @@ void InitGroupMenus(void)
mi.position=500;
mi.pszService=MS_CLIST_SHOWHIDE;
mi.pszName=LPGEN("&Hide/Show");
- hHideShowMainMenuItem=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -326,21 +326,21 @@ void InitGroupMenus(void)
mi.position=300000;
mi.pszService="";
mi.pszName=LPGEN("&Main Menu");
- hGroupMainMenuItemProxy=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=300100;
mi.pszService="";
mi.pszName=LPGEN("&Status");
- hGroupStatusMenuItemProxy=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=390100;
mi.pszService="";
mi.pszName=LPGEN("Appearance");
- hAppearanceMenuItemProxy=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hAppearanceMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -371,7 +371,7 @@ void InitGroupMenus(void)
//mi.pszService="CLISTMENUSGroup/ExecService";
mi.pszName=LPGEN("&New Group");
gmp.lParam=0;gmp.wParam=POPUP_NEWGROUP;
- hNewGroupMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -380,7 +380,7 @@ void InitGroupMenus(void)
mi.pszService=MS_CLIST_SETHIDEOFFLINE;
mi.pszName=LPGEN("&Hide Offline Users");
gmp.lParam=0;gmp.wParam=-1;
- hHideOfflineUsersMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -388,8 +388,7 @@ void InitGroupMenus(void)
mi.hIcon=NULL;
mi.pszService="CLISTMENUSGroup/HideOfflineRootHelper";
mi.pszName=LPGEN("Hide &Offline Users out here");
- hHideOfflineUsersOutHereMenuItem=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
+ hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -397,9 +396,7 @@ void InitGroupMenus(void)
mi.hIcon=NULL;
mi.pszService="CLISTMENUSGroup/HideGroupsHelper";
mi.pszName=LPGEN("Hide &Empty Groups");
- hHideEmptyGroupsMenuItem=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
-
+ hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -407,8 +404,7 @@ void InitGroupMenus(void)
mi.hIcon=NULL;
mi.pszService="CLISTMENUSGroup/UseGroupsHelper";
mi.pszName=LPGEN("Disable &Groups");
- hDisableGroupsMenuItem=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
+ hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
//MS_CLIST_GROUPCREATE
@@ -421,7 +417,7 @@ HANDLE hSubGroupMainMenuItemProxy;
//HANDLE hHideShowMainMenuItem;
HANDLE hSubGroupStatusMenuItemProxy;
HANDLE hPreBuildSubGroupMenuEvent;
-HANDLE hHideOfflineUsersHereMenuItem;
+HGENMENU hHideOfflineUsersHereMenuItem;
//SubGroupmenu exec param(ownerdata)
typedef struct {
@@ -448,8 +444,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
//contact->group
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (group->hideOffline?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
-
+ Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
return 0;
}
@@ -628,7 +623,7 @@ void InitSubGroupMenus(void)
mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName=LPGEN("&New SubGroup");
gmp.lParam=0;gmp.wParam=POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem=(HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hNewSubGroupMenuItem=(HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -637,7 +632,7 @@ void InitSubGroupMenus(void)
mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName=LPGEN("&Hide Offline Users in here");
gmp.lParam=0;gmp.wParam=POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem=(HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index 50373a214f..cda19327bc 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -103,7 +103,7 @@ static DWORD OutMsgs = 0;
static DWORD InMsgs = 0;
static HICON hIcons[15] = {0};
-static HANDLE hMenu = NULL;
+static HGENMENU hMenu = NULL;
static void LoadSettings();
static void ShowConsole(int show);
@@ -169,12 +169,11 @@ static void ShowConsole(int show)
if (show)
RedrawWindow(pActive->hList, NULL, NULL, RDW_INVALIDATE | RDW_FRAME |RDW_UPDATENOW | RDW_ERASE);
- if (hMenu)
- {
+ if (hMenu) {
CLISTMENUITEM mi = { sizeof(mi) };
mi.ptszName = (show) ? LPGENT("Hide Console") : LPGENT("Show Console");
mi.flags = CMIM_NAME | CMIF_TCHAR;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hMenu, &mi);
}
if (hTTBButt)
diff --git a/plugins/CyrTranslit/src/MirandaContact.cpp b/plugins/CyrTranslit/src/MirandaContact.cpp
index 8bf9977dd5..d8b6907083 100644
--- a/plugins/CyrTranslit/src/MirandaContact.cpp
+++ b/plugins/CyrTranslit/src/MirandaContact.cpp
@@ -31,7 +31,7 @@ char *MirandaContact::MENU_ITEM_TEXT = LPGEN("&Transliterate (ÔÛÂÀ->FYVA)");
char *MirandaContact::MENU_COMMAND_CALLBACK_SERVICE
= "CyrTranslit/ContactMenuCmd";
-HANDLE MirandaContact::hTransliterateCmdMenuItem = 0;
+HGENMENU MirandaContact::hTransliterateCmdMenuItem = 0;
//------------------------------------------------------------------------------
@@ -101,7 +101,7 @@ int MirandaContact::onPreBuildContactMenu(WPARAM wParam, LPARAM lParam)
if ( bIsActive(hContact))
mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hTransliterateCmdMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hTransliterateCmdMenuItem, &mi);
return 0;
}
diff --git a/plugins/CyrTranslit/src/MirandaContact.h b/plugins/CyrTranslit/src/MirandaContact.h
index 3cf46ed10e..f6e3d558e0 100644
--- a/plugins/CyrTranslit/src/MirandaContact.h
+++ b/plugins/CyrTranslit/src/MirandaContact.h
@@ -93,7 +93,7 @@ private:
* transliteration setting (on or off) is inverted for the contact owing the
* menu.
*/
- static HANDLE hTransliterateCmdMenuItem;
+ static HGENMENU hTransliterateCmdMenuItem;
/**
* @param wParam The HANDLE of the contact that owns the menu item being
diff --git a/plugins/Dbx_mmap_SA/src/commonheaders.h b/plugins/Dbx_mmap_SA/src/commonheaders.h
index b454148bc7..87255bdc18 100644
--- a/plugins/Dbx_mmap_SA/src/commonheaders.h
+++ b/plugins/Dbx_mmap_SA/src/commonheaders.h
@@ -35,6 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <win2k.h>
#include <m_system_cpp.h>
#include <m_database.h>
+#include <m_genmenu.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_skin.h>
@@ -48,7 +49,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "version.h"
extern HINSTANCE g_hInst;
-extern HANDLE hSetPwdMenu;
+extern HGENMENU hSetPwdMenu;
#ifdef __GNUC__
#define mir_i64(x) (x##LL)
@@ -80,7 +81,7 @@ INT_PTR CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
INT_PTR CALLBACK DlgStdNewPass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam);
INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-void xModifyMenu(HANDLE hMenu,long flags,const TCHAR* name, HICON hIcon);
+void xModifyMenu(HGENMENU hMenu,long flags,const TCHAR* name, HICON hIcon);
extern DBSignature dbSignature, dbSignatureSecured, dbSignatureNonSecured;
diff --git a/plugins/Dbx_mmap_SA/src/dialogs.cpp b/plugins/Dbx_mmap_SA/src/dialogs.cpp
index 90c0fdbbab..c1b8e29d1f 100644
--- a/plugins/Dbx_mmap_SA/src/dialogs.cpp
+++ b/plugins/Dbx_mmap_SA/src/dialogs.cpp
@@ -8,7 +8,7 @@
extern LIST<CryptoModule> arCryptors;
-HANDLE hSetPwdMenu;
+HGENMENU hSetPwdMenu;
BOOL ShowDlgItem(HWND hwndDlg, int iIDCtrl, BOOL bShow)
{
@@ -69,7 +69,7 @@ INT_PTR ChangePassword(void* obj, LPARAM wParam, LPARAM lParam)
return 0;
}
-void xModifyMenu(HANDLE hMenu,long flags,const TCHAR* name, HICON hIcon)
+void xModifyMenu(HGENMENU hMenu,long flags,const TCHAR* name, HICON hIcon)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_TCHAR;
@@ -78,7 +78,7 @@ void xModifyMenu(HANDLE hMenu,long flags,const TCHAR* name, HICON hIcon)
mi.flags |= flags;
mi.ptszName = (TCHAR*)name;
mi.hIcon = hIcon;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenu,(LPARAM)&mi);
+ Menu_ModifyItem(hMenu, &mi);
}
static IconItem iconList[] =
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index ceb9c2d971..4bf2de12d2 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -799,7 +799,7 @@ static INT_PTR OnMainMenu_HideAll( WPARAM wParam, LPARAM lParam )
clmi.flags = CMIM_NAME | CMIM_ICON|CMIF_TCHAR;
clmi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ));
clmi.ptszName = fcOpt.bHideAll ? LPGENT("Show all thumbs") : LPGENT("Hide all thumbs");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMainMenuItemHideAll, (LPARAM)&clmi);
+ Menu_ModifyItem(hMainMenuItemHideAll, &clmi);
return 0;
}
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp
index bfef61016f..f6bd92563a 100644
--- a/plugins/HTTPServer/src/main.cpp
+++ b/plugins/HTTPServer/src/main.cpp
@@ -61,7 +61,7 @@ static HANDLE hHttpAddChangeRemoveService = 0;
static HANDLE hHttpGetShareService = 0;
static HANDLE hHttpGetAllShares = 0;
-static HANDLE hAcceptConnectionsMenuItem = 0;
+static HGENMENU hAcceptConnectionsMenuItem = 0;
char szPluginPath[MAX_PATH] = {0};
int nPluginPathLen = 0;
@@ -625,8 +625,7 @@ static int nProtoAck(WPARAM /*wParam*/, LPARAM lParam) {
/////////////////////////////////////////////////////////////////////
INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) {
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIM_ICON;
if (!hDirectBoundPort) {
@@ -670,7 +669,7 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) {
}
if (hAcceptConnectionsMenuItem)
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAcceptConnectionsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hAcceptConnectionsMenuItem, &mi);
if (! bShutdownInProgress)
db_set_b(NULL, MODULE, "AcceptConnections", hDirectBoundPort != 0);
@@ -935,9 +934,7 @@ int nSystemShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/) {
indexCreationMode = (eIndexCreationMode) db_get_b(NULL, MODULE, "IndexCreationMode", 2);
if (db_get_b(NULL, MODULE, "AddAcceptConMenuItem", 1)) {
- CLISTMENUITEM mi;
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.pszContactOwner = NULL; //all contacts
mi.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp
index 6a2cf70e02..cf3997327a 100644
--- a/plugins/HistoryLinkListPlus/src/linklist.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist.cpp
@@ -70,7 +70,6 @@ extern "C" __declspec(dllexport) int Load(void)
CreateServiceFunction("Linklist/MenuCommand", LinkList_Main);
CLISTMENUITEM mi = { sizeof(mi) };
- mi.position = 0x00;
mi.flags = CMIF_TCHAR;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON));
mi.ptszName = LPGENT("&Create Linklist");
diff --git a/plugins/ListeningTo/src/commons.h b/plugins/ListeningTo/src/commons.h
index 548dd4becd..60225f3304 100644
--- a/plugins/ListeningTo/src/commons.h
+++ b/plugins/ListeningTo/src/commons.h
@@ -91,7 +91,7 @@ struct ProtocolInfo
{
char proto[128];
TCHAR account[128];
- HANDLE hMenu;
+ HGENMENU hMenu;
int old_xstatus;
TCHAR old_xstatus_name[1024];
TCHAR old_xstatus_message[1024];
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 9c20374202..6e82365846 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -161,7 +161,7 @@ void UpdateGlobalStatusMenus()
clmi.flags = CMIM_FLAGS
| (enabled ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto_items[0].hMenu, (LPARAM) &clmi);
+ Menu_ModifyItem(proto_items[0].hMenu, &clmi);
if (hTTB != NULL)
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM) hTTB, (LPARAM) (enabled ? TTBST_PUSHED : TTBST_RELEASED));
@@ -246,7 +246,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam)
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
clmi.ptszName = text;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->hMenu, (LPARAM) &clmi);
+ Menu_ModifyItem(info->hMenu, &clmi);
}
else if (wParam == PRAC_REMOVED || (wParam == PRAC_CHECKED && !proto->bIsEnabled))
{
@@ -762,7 +762,7 @@ INT_PTR EnableListeningTo(char *proto,BOOL enabled)
clmi.flags = CMIM_FLAGS
| (enabled ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->hMenu, (LPARAM) &clmi);
+ Menu_ModifyItem(info->hMenu, &clmi);
SetListeningInfo(proto,(opts.enable_sending && enabled) ? GetListeningInfo() : NULL);
}
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp
index 4ef0be7e69..042a0e43a1 100755
--- a/plugins/MetaContacts/src/meta_services.cpp
+++ b/plugins/MetaContacts/src/meta_services.cpp
@@ -1082,7 +1082,7 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam)
mi.flags = CMIM_NAME | CMIM_ICON;
mi.icolibItem = GetIconHandle(I_MENU);
mi.pszName = LPGEN("Toggle MetaContacts On");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuOnOff, &mi);
Meta_HideMetaContacts(TRUE);
}
@@ -1391,7 +1391,7 @@ INT_PTR Meta_OnOff(WPARAM wParam, LPARAM lParam)
mi.icolibItem = GetIconHandle(I_MENUOFF);
mi.pszName = LPGEN("Toggle MetaContacts Off");
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuOnOff, &mi);
return 0;
}
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp
index 61b65eeb68..a040de6e63 100644
--- a/plugins/MyDetails/src/frame.cpp
+++ b/plugins/MyDetails/src/frame.cpp
@@ -53,7 +53,7 @@ HWND hwnd_container = NULL;
int frame_id = -1;
bool g_bFramesExist = false;
-HANDLE hMenuShowHideFrame = 0;
+HGENMENU hMenuShowHideFrame = 0;
#define FONT_NICK 0
#define FONT_PROTO 1
@@ -2276,7 +2276,7 @@ void FixMainMenu()
else
mi.ptszName = LPGENT("Show My Details");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuShowHideFrame, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuShowHideFrame, &mi);
}
#include <math.h>
diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp
index 99e35c4740..e1745df966 100644
--- a/plugins/NewEventNotify/src/menuitem.cpp
+++ b/plugins/NewEventNotify/src/menuitem.cpp
@@ -24,7 +24,7 @@
#include "neweventnotify.h"
-HANDLE hMenuitemNotify;
+HGENMENU hMenuitemNotify;
BOOL bNotify;
static INT_PTR MenuitemNotifyCmd(WPARAM wParam,LPARAM lParam)
@@ -46,7 +46,7 @@ int MenuitemUpdate(BOOL bStatus)
else
mi.ptszName = TranslateT(MENUITEM_ENABLE);
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuitemNotify, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuitemNotify, &mi);
return 0;
}
diff --git a/plugins/NewXstatusNotify/src/common.h b/plugins/NewXstatusNotify/src/common.h
index 473a51c1fc..78cdc6b807 100644
--- a/plugins/NewXstatusNotify/src/common.h
+++ b/plugins/NewXstatusNotify/src/common.h
@@ -149,7 +149,7 @@ extern OPTIONS opt;
extern LIST<DBEVENT> eventList;
extern TEMPLATES templates;
extern HINSTANCE hInst;
-extern HANDLE hEnableDisableMenu;
+extern HGENMENU hEnableDisableMenu;
extern STATUS StatusList[STATUS_COUNT];
#endif //COMMON_H
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index 29f6cc5c5a..1dc3bf3188 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -25,8 +25,8 @@ HINSTANCE hInst;
LIST<DBEVENT> eventList( 10 );
-HANDLE hStatusModeChange, hServiceMenu, hHookContactStatusChanged, hEnableDisableMenu;
-HANDLE hToolbarButton;
+HANDLE hStatusModeChange, hServiceMenu, hHookContactStatusChanged, hToolbarButton;
+HGENMENU hEnableDisableMenu;
char szMetaModuleName[256] = {0};
STATUS StatusList[STATUS_COUNT];
@@ -1051,7 +1051,7 @@ INT_PTR EnableDisableMenuCommand(WPARAM wParam, LPARAM lParam)
mi.icolibItem = GetIconHandle(ICO_NOTIFICATION_ON);
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hEnableDisableMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hEnableDisableMenu, &mi);
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hToolbarButton, opt.TempDisabled ? TTBST_RELEASED : TTBST_PUSHED);
return 0;
}
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index af83770a2d..2c9f05b3e8 100755
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -24,7 +24,8 @@ list <JabberAccount*> Accounts;
HINSTANCE hInst;
HFONT bold_font = NULL;
-HANDLE hLoadPubKey = NULL, hToggleEncryption = NULL, hOnPreBuildContactMenu = NULL, hSendKey = NULL, g_hCLIcon = NULL, hExportGpgKeys = NULL, hImportGpgKeys = NULL;
+HANDLE hLoadPubKey = NULL, g_hCLIcon = NULL, hExportGpgKeys = NULL, hImportGpgKeys = NULL;
+HGENMENU hSendKey = NULL, hToggleEncryption = NULL;
RECT key_from_keyserver_rect = {0}, firstrun_rect = {0}, new_key_rect = {0}, key_gen_rect = {0}, load_key_rect = {0}, import_key_rect = {0}, key_password_rect = {0}, load_existing_key_rect = {0};
XML_API xi = {0};
int hLangpack = 0;
@@ -67,21 +68,21 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l);
void init_vars()
{
- bAppendTags = db_get_b(NULL, szGPGModuleName, "bAppendTags", 0);
- bStripTags = db_get_b(NULL, szGPGModuleName, "bStripTags", 0);
+ bAppendTags = db_get_b(NULL, szGPGModuleName, "bAppendTags", 0) != 0;
+ bStripTags = db_get_b(NULL, szGPGModuleName, "bStripTags", 0) != 0;
inopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", _T("<GPGdec>"));
inclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", _T("</GPGdec>"));
outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", _T("<GPGenc>"));
outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", _T("</GPGenc>"));
- bDebugLog = db_get_b(NULL, szGPGModuleName, "bDebugLog", 0);
- bAutoExchange = db_get_b(NULL, szGPGModuleName, "bAutoExchange", 0);
- bSameAction = db_get_b(NULL, szGPGModuleName, "bSameAction", 0);
+ bDebugLog = db_get_b(NULL, szGPGModuleName, "bDebugLog", 0) != 0;
+ bAutoExchange = db_get_b(NULL, szGPGModuleName, "bAutoExchange", 0) != 0;
+ bSameAction = db_get_b(NULL, szGPGModuleName, "bSameAction", 0) != 0;
password = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", _T(""));
debuglog.init();
- bIsMiranda09 = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00090001?true:false;
- bJabberAPI = db_get_b(NULL, szGPGModuleName, "bJabberAPI", bIsMiranda09?1:0);
- bPresenceSigning = db_get_b(NULL, szGPGModuleName, "bPresenceSigning", 0);
- bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0);
+ bIsMiranda09 = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00090001;
+ bJabberAPI = db_get_b(NULL, szGPGModuleName, "bJabberAPI", bIsMiranda09) != 0;
+ bPresenceSigning = db_get_b(NULL, szGPGModuleName, "bPresenceSigning", 0) != 0;
+ bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0) != 0;
firstrun_rect.left = db_get_dw(NULL, szGPGModuleName, "FirstrunWindowX", 0);
firstrun_rect.top = db_get_dw(NULL, szGPGModuleName, "FirstrunWindowY", 0);
key_password_rect.left = db_get_dw(NULL, szGPGModuleName, "PasswordWindowX", 0);
@@ -144,8 +145,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
}
-
- bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT);
+ bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT) != 0;
if(bJabberAPI && bIsMiranda09)
GetJabberInterface(0,0);
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index 4dd31b3a1a..51f9bb8312 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -192,7 +192,8 @@ INT_PTR SendKey(WPARAM w, LPARAM l)
return 0;
}
-extern HANDLE hLoadPublicKey, hToggleEncryption, hSendKey;
+extern HANDLE hLoadPublicKey;
+extern HGENMENU hToggleEncryption, hSendKey;
INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
{
@@ -227,7 +228,7 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME;
enc?mi.pszName="Turn off GPG encryption":mi.pszName="Turn on GPG encryption";
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggleEncryption, (LPARAM)&mi);
+ Menu_ModifyItem(hToggleEncryption, &mi);
return 0;
}
@@ -260,7 +261,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l)
mir_sntprintf(buf, 127 * sizeof(TCHAR), _T("%s: %s"), TranslateT("Send publick key"), toUTF16(keyid).c_str());
mi2.ptszName = buf;
mi2.flags = CMIM_NAME | CMIF_TCHAR;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hSendKey, (LPARAM)&mi2);
+ Menu_ModifyItem(hSendKey, &mi2);
}
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME;
@@ -273,7 +274,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l)
else
mi.flags = CMIM_NAME | CMIM_FLAGS;
mi.pszName = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)?"Turn off GPG encryption":"Turn on GPG encryption";
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggleEncryption, (LPARAM)&mi);
+ Menu_ModifyItem(hToggleEncryption, &mi);
return 0;
}
diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h
index d26aefed29..2c664d035b 100644
--- a/plugins/NewsAggregator/Src/Common.h
+++ b/plugins/NewsAggregator/Src/Common.h
@@ -85,7 +85,7 @@ void UpdateThreadProc(LPVOID AvatarCheck);
void DestroyUpdateList(void);
extern HANDLE hUpdateMutex;
-extern HANDLE hService2[7];
+extern HGENMENU hService2[7];
int NewsAggrInit(WPARAM wParam,LPARAM lParam);
INT OptInit(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp
index 66c72a8dcb..d58654d4ea 100644
--- a/plugins/NewsAggregator/Src/Menus.cpp
+++ b/plugins/NewsAggregator/Src/Menus.cpp
@@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA.
#include "common.h"
-HANDLE hService2[7];
+HGENMENU hService2[7];
VOID InitMenu()
{
@@ -81,5 +81,5 @@ VOID InitMenu()
mi.icolibItem = GetIconHandle("enabled");
else
mi.icolibItem = GetIconHandle("disabled");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hService2[0], (LPARAM)&mi);
+ Menu_ModifyItem(hService2[0], &mi);
} \ No newline at end of file
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp
index 4b2e38950d..622723f205 100644
--- a/plugins/NewsAggregator/Src/Services.cpp
+++ b/plugins/NewsAggregator/Src/Services.cpp
@@ -255,7 +255,7 @@ void UpdateMenu(BOOL State)
}
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hService2[0], (LPARAM)&mi);
+ Menu_ModifyItem(hService2[0], &mi);
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTBButton, State ? TTBST_PUSHED : TTBST_RELEASED);
db_set_b(NULL, MODULE, "AutoUpdate", !State);
}
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp
index babf696ccf..1d8caa5cd8 100644
--- a/plugins/NoHistory/src/dllmain.cpp
+++ b/plugins/NoHistory/src/dllmain.cpp
@@ -162,7 +162,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
mi.ptszName = (remove ? LPGENT("Enable History") : LPGENT("Disable History"));
mi.hIcon = (remove ? hIconKeep : hIconRemove);
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuToggle, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuToggle, &mi);
Menu_ShowItem(hMenuClear, !chat_room && db_event_count(hContact) > 0);
return 0;
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp
index b2a5196a94..3c30104e26 100644
--- a/plugins/PasteIt/src/PasteIt.cpp
+++ b/plugins/PasteIt/src/PasteIt.cpp
@@ -396,7 +396,7 @@ void DefWebPageChanged()
if (Options::instance->defWeb == i)
mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hWebPageMenus[i], (LPARAM)&mi);
+ Menu_ModifyItem(hWebPageMenus[i], &mi);
}
}
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 5ccb4ac13d..711ec72259 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -54,22 +54,21 @@ HMODULE hDwmapiDll = 0;
GLOBAL_WND_CLASSES g_wndClass = {0};
//===== MTextControl ====
-HANDLE htuText = NULL;
-HANDLE htuTitle = NULL;
+HANDLE htuText;
+HANDLE htuTitle;
//===== Menu item =====
-HANDLE hMenuRoot = NULL;
-HANDLE hMenuItem = NULL;
-HANDLE hMenuItemHistory = NULL;
+HGENMENU hMenuRoot;
+HGENMENU hMenuItem;
+HGENMENU hMenuItemHistory;
//===== Event Handles =====
-HANDLE hTTButton = NULL;
+HANDLE hTTButton;
//===== Options pages =====
static int OptionsInitialize(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.cbSize = sizeof(odp);
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.position = 100000000;
odp.groupPosition = 910000000;
odp.hInstance = hInst;
@@ -129,12 +128,12 @@ static int IconsChanged(WPARAM wParam, LPARAM lParam)
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_OFF, 0);
}
mi.flags = CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuRoot, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuItem, &mi);
+ Menu_ModifyItem(hMenuRoot, &mi);
mi.hIcon = IcoLib_GetIcon(ICO_HISTORY, 0);
mi.flags = CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemHistory, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuItemHistory, &mi);
return 0;
}
@@ -158,9 +157,6 @@ static int TTBLoaded(WPARAM wParam, LPARAM lParam)
//===== EnableDisableMenuCommand =====
INT_PTR svcEnableDisableMenuCommand(WPARAM wp, LPARAM lp)
{
- int iResult = 0;
- int iResultRoot = 0;
-
CLISTMENUITEM mi = { sizeof(mi) };
if (PopUpOptions.ModuleIsEnabled) {
//The module is enabled.
@@ -179,14 +175,14 @@ INT_PTR svcEnableDisableMenuCommand(WPARAM wp, LPARAM lp)
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_ON,0);
}
mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
- iResult = CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuItem, &mi);
mi.flags = CMIM_ICON;
- iResultRoot = CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuRoot, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuRoot, &mi);
if (hTTButton)
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, (PopUpOptions.ModuleIsEnabled) ? TTBST_PUSHED : TTBST_RELEASED);
- return (iResult != 0 && iResultRoot != 0);
+ return 0;
}
INT_PTR svcShowHistory(WPARAM, LPARAM)
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp
index a28aa838a9..c04f6d8ec9 100644
--- a/plugins/Quotes/src/QuoteInfoDlg.cpp
+++ b/plugins/Quotes/src/QuoteInfoDlg.cpp
@@ -292,14 +292,14 @@ int Quotes_OnContactDoubleClick(WPARAM wp,LPARAM/* lp*/)
namespace
{
- void enable_menu(HANDLE hMenu,bool bEnable)
+ void enable_menu(HGENMENU hMenu,bool bEnable)
{
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
if(false == bEnable)
clmi.flags |= CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM,reinterpret_cast<WPARAM>(hMenu),reinterpret_cast<LPARAM>(&clmi));
+ Menu_ModifyItem(hMenu, &clmi);
}
}
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index 1952c4557a..1d7574dfaa 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -14,7 +14,7 @@ int hLangpack = 0;
HANDLE hTopToolbarButtonShowList;
HANDLE hMsgWndEvent;
HANDLE hWindowList;
-HANDLE hMenuItemRemove;
+HGENMENU hMenuItemRemove;
const INT_PTR boo = 0;
@@ -491,7 +491,7 @@ static int OnPrebuildContactMenu (WPARAM wParam, LPARAM lParam)
else
clmi.ptszName = TranslateT("Show Contact");
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemRemove, (LPARAM)&clmi );
+ Menu_ModifyItem(hMenuItemRemove, &clmi);
return 0;
}
diff --git a/plugins/SMS/src/SMSConstans.h b/plugins/SMS/src/SMSConstans.h
index 06ae75a3ff..d20ce5dc1d 100644
--- a/plugins/SMS/src/SMSConstans.h
+++ b/plugins/SMS/src/SMSConstans.h
@@ -78,12 +78,9 @@ struct SERVICE_ITEM
static const SERVICE_ITEM siPluginServices[] =
{
- { SMS_READ, ReadMsgSMS },
- { SMS_READ_ACK, ReadAckSMS },
- { SMS_SEND, SendSMSMenuCommand },
+ { SMS_READ, ReadMsgSMS },
+ { SMS_READ_ACK, ReadAckSMS },
+ { SMS_SEND, SendSMSMenuCommand },
};
-
-
-
#endif // !defined(AFX_SMS_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp
index cff9a72946..14df262de2 100644
--- a/plugins/SMS/src/SMS_svc.cpp
+++ b/plugins/SMS/src/SMS_svc.cpp
@@ -19,105 +19,61 @@ int LoadServices(void)
int LoadModules(void)
{
- ssSMSSettings.hHookOptInitialize=HookEvent(ME_OPT_INITIALISE,OptInitialise);
- ssSMSSettings.hHookRebuildCMenu=HookEvent(ME_CLIST_PREBUILDCONTACTMENU,SmsRebuildContactMenu);
- ssSMSSettings.hHookProtoAck=HookEvent(ME_PROTO_ACK,handleAckSMS);
- ssSMSSettings.hHookDbAdd=HookEvent(ME_DB_EVENT_ADDED,handleNewMessage);
- ssSMSSettings.hHookAccListChanged=HookEvent(ME_PROTO_ACCLISTCHANGED,RefreshAccountList);
-
-
- CLISTMENUITEM mi={0};
- CHAR szServiceFunction[MAX_PATH];
+ HookEvent(ME_OPT_INITIALISE,OptInitialise);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU,SmsRebuildContactMenu);
+ HookEvent(ME_PROTO_ACK,handleAckSMS);
+ HookEvent(ME_DB_EVENT_ADDED,handleNewMessage);
+ HookEvent(ME_PROTO_ACCLISTCHANGED,RefreshAccountList);
+ CHAR szServiceFunction[MAX_PATH];
mir_snprintf(szServiceFunction,sizeof(szServiceFunction),"%s%s",PROTOCOL_NAMEA,SMS_SEND);
- mi.cbSize=sizeof(mi);
- mi.position=300050000;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_SMS);
- mi.ptszName=SMS_SEND_STR;
- mi.pszService=szServiceFunction;
- mi.flags=CMIF_TCHAR;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 300050000;
+ mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
+ mi.ptszName = SMS_SEND_STR;
+ mi.pszService = szServiceFunction;
+ mi.flags = CMIF_TCHAR;
Menu_AddMainMenuItem(&mi);
- mi.position=-2000070000;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_SMS);
- mi.ptszName=SMS_SEND_CM_STR;
- mi.pszService=szServiceFunction;
- mi.flags=CMIF_TCHAR;
- ssSMSSettings.hContactMenuItems[0]=Menu_AddContactMenuItem(&mi);
+ mi.position = -2000070000;
+ mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
+ mi.ptszName = SMS_SEND_CM_STR;
+ mi.pszService = szServiceFunction;
+ mi.flags = CMIF_TCHAR;
+ ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
SkinAddNewSoundEx("RecvSMSMsg",PROTOCOL_NAMEA,LPGEN("Incoming SMS Message"));
SkinAddNewSoundEx("RecvSMSConfirmation",PROTOCOL_NAMEA,LPGEN("Incoming SMS Confirmation"));
-
RefreshAccountList(NULL,NULL);
RestoreUnreadMessageAlerts();
-
return 0;
}
-
-void UnloadModules()
-{
- // Main menu destroy
- //CListDestroyMenu(gdiMenuItems,SIZEOF(gdiMenuItems));
- //ZeroMemory(masMraSettings.hMainMenuItems,sizeof(masMraSettings.hMainMenuItems));
-
- // Contact menu destroy
- //CListDestroyMenu(gdiContactMenuItems,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)));
- //ZeroMemory(masMraSettings.hContactMenuItems,sizeof(masMraSettings.hContactMenuItems));
-
- if (ssSMSSettings.hHookAccListChanged) {UnhookEvent(ssSMSSettings.hHookAccListChanged); ssSMSSettings.hHookAccListChanged=NULL;}
- if (ssSMSSettings.hHookDbAdd) {UnhookEvent(ssSMSSettings.hHookDbAdd); ssSMSSettings.hHookDbAdd=NULL;}
- if (ssSMSSettings.hHookProtoAck) {UnhookEvent(ssSMSSettings.hHookProtoAck); ssSMSSettings.hHookProtoAck=NULL;}
- if (ssSMSSettings.hHookRebuildCMenu) {UnhookEvent(ssSMSSettings.hHookRebuildCMenu); ssSMSSettings.hHookRebuildCMenu=NULL;}
- if (ssSMSSettings.hHookOptInitialize) {UnhookEvent(ssSMSSettings.hHookOptInitialize); ssSMSSettings.hHookOptInitialize=NULL;}
-
- //IconsUnLoad();
-
-}
-
-
-void UnloadServices()
-{
- CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
-
- CopyMemory(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
-
- // destroy plugin services
- for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++)
- {
- CopyMemory(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
- DestroyServiceFunction(szServiceFunction);
- }
-}
-
-
-
int SmsRebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount((HANDLE)wParam));
return 0;
}
-
//This function called when user clicked Menu.
int SendSMSMenuCommand(WPARAM wParam,LPARAM lParam)
{
HWND hwndSendSms;
- if (wParam)
- {// user clicked on the "SMS Message" on one of the users
- hwndSendSms=SendSMSWindowIsOtherInstanceHContact((HANDLE)wParam);
+ // user clicked on the "SMS Message" on one of the users
+ if (wParam) {
+ hwndSendSms = SendSMSWindowIsOtherInstanceHContact((HANDLE)wParam);
if (hwndSendSms)
SetFocus(hwndSendSms);
else
- hwndSendSms=SendSMSWindowAdd((HANDLE)wParam);
+ hwndSendSms = SendSMSWindowAdd((HANDLE)wParam);
}
- else{// user clicked on the "SMS Send" in the Main Menu
- hwndSendSms=SendSMSWindowAdd(NULL);
+ // user clicked on the "SMS Send" in the Main Menu
+ else{
+ hwndSendSms = SendSMSWindowAdd(NULL);
EnableWindow(GetDlgItem(hwndSendSms,IDC_NAME),TRUE);
EnableWindow(GetDlgItem(hwndSendSms,IDC_SAVENUMBER),FALSE);
diff --git a/plugins/SMS/src/common.h b/plugins/SMS/src/common.h
index b0c3366480..e88b11c131 100644
--- a/plugins/SMS/src/common.h
+++ b/plugins/SMS/src/common.h
@@ -59,14 +59,6 @@ typedef struct
HGENMENU hMainMenuItems[MAIN_MENU_ITEMS_COUNT+1];
HGENMENU hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+1];
- HANDLE hHookModulesLoaded;
- HANDLE hHookPreShutdown;
- HANDLE hHookOptInitialize;
- HANDLE hHookRebuildCMenu;
- HANDLE hHookDbAdd;
- HANDLE hHookProtoAck;
- HANDLE hHookAccListChanged;
-
LIST_MT lmtSendSMSWindowsListMT;
LIST_MT lmtRecvSMSWindowsListMT;
@@ -155,8 +147,6 @@ int OptInitialise(WPARAM wParam,LPARAM lParam);
int LoadServices();
int LoadModules();
-void UnloadModules();
-void UnloadServices();
int handleAckSMS(WPARAM wParam,LPARAM lParam);
int handleNewMessage(WPARAM wParam,LPARAM lParam);
diff --git a/plugins/SMS/src/main.cpp b/plugins/SMS/src/main.cpp
index 0d8d9de589..d2a846e5e1 100644
--- a/plugins/SMS/src/main.cpp
+++ b/plugins/SMS/src/main.cpp
@@ -80,8 +80,8 @@ extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- ssSMSSettings.hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,OnModulesLoaded);
- ssSMSSettings.hHookPreShutdown=HookEvent(ME_SYSTEM_PRESHUTDOWN,OnPreShutdown);
+ HookEvent(ME_SYSTEM_MODULESLOADED,OnModulesLoaded);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN,OnPreShutdown);
SendSMSWindowInitialize();
RecvSMSWindowInitialize();
@@ -93,11 +93,6 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
- UnloadServices();
-
- if (ssSMSSettings.hHookPreShutdown) {UnhookEvent(ssSMSSettings.hHookPreShutdown); ssSMSSettings.hHookPreShutdown=NULL;}
- if (ssSMSSettings.hHookModulesLoaded) {UnhookEvent(ssSMSSettings.hHookModulesLoaded); ssSMSSettings.hHookModulesLoaded=NULL;}
-
return 0;
}
@@ -112,8 +107,6 @@ int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
int OnPreShutdown(WPARAM wParam,LPARAM lParam)
{
- UnloadModules();
-
RecvSMSWindowDestroy();
SendSMSWindowDestroy();
FreeAccountList();
@@ -126,24 +119,17 @@ void VersionConversions()
WCHAR wsztm[MAX_PATH];
if (DB_SMS_GetStaticStringW(NULL,"UseSignature",wsztm,SIZEOF(wsztm),NULL))
- {
DB_SMS_SetByte(NULL,"UseSignature",(wsztm[0]=='0'));
- }else{
+ else
DB_SMS_SetByte(NULL,"UseSignature",SMS_DEFAULT_USESIGNATURE);
- }
if (DB_SMS_GetStaticStringW(NULL,"SignaturePos",wsztm,SIZEOF(wsztm),NULL))
- {
DB_SMS_SetByte(NULL,"SignaturePos",(wsztm[0]=='0'));
- }else{
+ else
DB_SMS_SetByte(NULL,"SignaturePos",SMS_DEFAULT_SIGNATUREPOS);
- }
if (DB_SMS_GetStaticStringW(NULL,"ShowACK",wsztm,SIZEOF(wsztm),NULL))
- {
DB_SMS_SetByte(NULL,"ShowACK",(wsztm[0]=='0'));
- }else{
+ else
DB_SMS_SetByte(NULL,"ShowACK",SMS_DEFAULT_SHOWACK);
- }
-
-} \ No newline at end of file
+}
diff --git a/plugins/Scriver/src/chat/clist.cpp b/plugins/Scriver/src/chat/clist.cpp
index 9cb2f09b09..91c3e3f78c 100644
--- a/plugins/Scriver/src/chat/clist.cpp
+++ b/plugins/Scriver/src/chat/clist.cpp
@@ -207,7 +207,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
clmi.pszName = (char*)LPGEN("Join chat");
else
clmi.pszName = (char*)LPGEN("Open chat window");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hJoinMenuItem, (LPARAM)&clmi);
+ Menu_ModifyItem(hJoinMenuItem, &clmi);
bEnabled = true;
} } }
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index b5c7fd658a..35276af9c3 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -23,9 +23,8 @@ HINSTANCE hinstance = NULL;
WNDPROC mainProc;
-HANDLE
- hServiceOpenManager, hServiceShowFavMenu, hServiceCloseCurrentSession, hServiceSaveUserSession,
- hServiceLoadLastSession, hmSaveCurrentSession, hmLoadLastSession, hmLoadSession, hmSessionsManager;
+HANDLE hServiceOpenManager, hServiceShowFavMenu, hServiceCloseCurrentSession, hServiceSaveUserSession, hServiceLoadLastSession;
+HGENMENU hmSaveCurrentSession, hmLoadLastSession, hmLoadSession, hmSessionsManager;
HANDLE hmTBButton[2],hiTBbutton[2],iTBbutton[2];
@@ -991,7 +990,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
cl.cbSize = sizeof(cl);
cl.flags = CMIM_ICON;
cl.icolibItem = iconList[4].hIcolib;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hmSaveCurrentSession, (LPARAM)&cl);
+ Menu_ModifyItem(hmSaveCurrentSession, &cl);
return 0;
}
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp
index c3f4337efb..94032d97d8 100644
--- a/plugins/SimpleAR/src/Main.cpp
+++ b/plugins/SimpleAR/src/Main.cpp
@@ -19,7 +19,7 @@ Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
HINSTANCE hinstance;
HANDLE hPreBuildHook = NULL, hAddEventHook = NULL, hOptHook = NULL, hCheckDefHook = NULL, hOnPreShutdown = NULL, hToggleEnable = NULL, hToggleAutoanswer = NULL;
-HANDLE hToggle = NULL, hEnableMenu = NULL;
+HGENMENU hToggle, hEnableMenu;
BOOL fEnabled, gbVarsServiceExist = FALSE;
INT interval;
int hLangpack;
@@ -71,7 +71,7 @@ INT_PTR ToggleEnable(WPARAM wParam, LPARAM lParam)
mi.ptszName = LPGENT("Enable Auto&reply");
mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_OFF));
}
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hEnableMenu,(LPARAM)&mi);
+ Menu_ModifyItem(hEnableMenu, &mi);
return 0;
}
@@ -87,7 +87,7 @@ INT_PTR Toggle(WPARAM w, LPARAM l)
mi.flags = CMIM_NAME |CMIM_ICON | CMIF_TCHAR;
mi.ptszName = on ? LPGENT("Turn off Autoanswer") : LPGENT("Turn on Autoanswer");
mi.hIcon = on ? LoadIcon(hinstance, MAKEINTRESOURCE(IDI_OFF)) : LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ON));
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggle, (LPARAM)&mi);
+ Menu_ModifyItem(hToggle, &mi);
return 0;
}
@@ -100,7 +100,7 @@ INT OnPreBuildContactMenu(WPARAM w, LPARAM l)
BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0);
mi.ptszName = on ? LPGENT("Turn off Autoanswer") : LPGENT("Turn on Autoanswer");
mi.hIcon = on?LoadIcon(hinstance, MAKEINTRESOURCE(IDI_OFF)):LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ON));
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggle, (LPARAM)&mi);
+ Menu_ModifyItem(hToggle, &mi);
return 0;
}
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index 563543fe95..15a52ef814 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -2,7 +2,8 @@
HANDLE hTypingNotify;
-static HANDLE hDisableMenu = NULL;
+static HGENMENU hDisableMenu = NULL;
+
static HANDLE hPopUpsList = NULL;
static BYTE OnePopUp;
@@ -56,7 +57,7 @@ static INT_PTR EnableDisableMenuCommand(WPARAM wParam,LPARAM lParam)
mi.hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED));
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hDisableMenu, &mi);
}
return 0;
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp
index 9ff015ce1c..3777556d28 100644
--- a/plugins/UserInfoEx/src/mir_menuitems.cpp
+++ b/plugins/UserInfoEx/src/mir_menuitems.cpp
@@ -28,7 +28,7 @@ enum ECascadeType {
MCAS_NOTINITIATED = 128
};
-int hMenuItemRefresh = NULL;
+HGENMENU hMenuItemRefresh = NULL;
HGENMENU *hMenuItemAccount = NULL;
/**
diff --git a/plugins/UserInfoEx/src/mir_menuitems.h b/plugins/UserInfoEx/src/mir_menuitems.h
index a081037513..612f45fcab 100644
--- a/plugins/UserInfoEx/src/mir_menuitems.h
+++ b/plugins/UserInfoEx/src/mir_menuitems.h
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _UINFOEX_MENUITEMS_H_INCLUDED_
#define _UINFOEX_MENUITEMS_H_INCLUDED_
-extern int hMenuItemRefresh;
+extern HGENMENU hMenuItemRefresh;
extern HGENMENU *hMenuItemAccount;
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp
index 5c4e87ae87..2db5949405 100644
--- a/plugins/UserInfoEx/src/svc_refreshci.cpp
+++ b/plugins/UserInfoEx/src/svc_refreshci.cpp
@@ -614,7 +614,7 @@ class CContactUpdater : public CContactQueue
clmi.flags = CMIM_NAME|CMIM_ICON;
clmi.pszName = LPGEN("Refresh Contact Details");
clmi.hIcon = IcoLib_GetIcon(ICO_BTN_UPDATE);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hMenuItemRefresh, (LPARAM)&clmi);
+ Menu_ModifyItem(hMenuItemRefresh, &clmi);
}
}
@@ -740,7 +740,7 @@ public:
clmi.flags = CMIM_NAME|CMIM_ICON;
clmi.pszName = LPGEN("Abort Refreshing Contact Details");
clmi.hIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hMenuItemRefresh, (LPARAM) &clmi);
+ Menu_ModifyItem(hMenuItemRefresh, &clmi);
}
}
diff --git a/plugins/Weather/src/weather.h b/plugins/Weather/src/weather.h
index 868440ad22..84d1b2b888 100644
--- a/plugins/Weather/src/weather.h
+++ b/plugins/Weather/src/weather.h
@@ -361,11 +361,12 @@ extern HANDLE hNetlibUser, hNetlibHttp;
extern HANDLE hHookWeatherUpdated;
extern HANDLE hHookWeatherError;
extern HANDLE hWindowList;
-extern HANDLE hMwinMenu;
extern HANDLE hTBButton;
extern UINT_PTR timerId;
extern HANDLE hUpdateMutex;
+extern HGENMENU hMwinMenu;
+
// check if weather is currently updating
extern BOOL ThreadRunning;
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp
index 4061858a73..b748173aeb 100644
--- a/plugins/Weather/src/weather_mwin.cpp
+++ b/plugins/Weather/src/weather_mwin.cpp
@@ -29,7 +29,7 @@ static ft_TrackMouseEvent f_TrackMouseEvent = NULL;
static HANDLE hMwinWindowList;
static HANDLE hFontHook;
-HANDLE hMwinMenu;
+HGENMENU hMwinMenu;
typedef struct
{
@@ -312,7 +312,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS |
(db_get_dw((HANDLE)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMwinMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hMwinMenu, &mi);
return 0;
}
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp
index d61bdc2a8b..0f074e292a 100644
--- a/plugins/Weather/src/weather_svcs.cpp
+++ b/plugins/Weather/src/weather_svcs.cpp
@@ -241,7 +241,7 @@ void UpdateMenu(BOOL State)
}
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hEnableDisableMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hEnableDisableMenu, &mi);
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTBButton, !State ? TTBST_PUSHED : TTBST_RELEASED);
}
@@ -265,7 +265,7 @@ void UpdatePopupMenu(BOOL State)
}
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hEnableDisablePopupMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hEnableDisablePopupMenu, &mi);
}
// update the weather auto-update menu item when click on it
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
index c543dd8576..757d39ffcd 100644
--- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp
+++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
@@ -2,7 +2,7 @@
HINSTANCE hInst;
WUMF_OPTIONS WumfOptions = { 0 };
-HANDLE hMenuItem = 0;
+HGENMENU hMenuItem = 0;
int hLangpack;
HWND hDlg;
@@ -266,8 +266,8 @@ static INT_PTR WumfMenuCommand(WPARAM,LPARAM)
}
db_set_b(NULL, ModuleName, POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
mi.flags = CMIM_NAME | CMIM_ICON;
- iResult = CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
- return iResult;
+ Menu_ModifyItem(hMenuItem, &mi);
+ return 0;
}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index 232ffb19e8..0d6b116f3f 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -1,6 +1,6 @@
#include "common.h"
-HANDLE hMenuShowHistory, hMenuToggleOnOff;
+HGENMENU hMenuShowHistory, hMenuToggleOnOff;
void StripBBCodesInPlace(wchar_t *text)
{
@@ -190,7 +190,7 @@ void UpdateMenu()
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszName = (char*)(db_get_b(0, MODULE, "Enabled", 1) == 1 ? LPGEN("Disable Popups") : LPGEN("Enable Popups"));
mi.flags = CMIM_NAME;// | CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuToggleOnOff, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuToggleOnOff, &mi);
}
INT_PTR PopupQuery(WPARAM wParam, LPARAM lParam) {
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp
index 16238d43d2..0a1b5ed491 100644
--- a/plugins/ZeroNotification/src/main.cpp
+++ b/plugins/ZeroNotification/src/main.cpp
@@ -101,7 +101,7 @@ static void UpdateMenuItem()
else
mi.ptszName = ENABLE_SOUND;
mi.flags |= CMIM_NAME | CMIF_TCHAR;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)noSoundMenu,(LPARAM)&mi);
+ Menu_ModifyItem(noSoundMenu, &mi);
}
//Called when the sound setting in the database is changed
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index 629bd50c3a..2d5758a93b 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -861,7 +861,7 @@ int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
clmi.ptszName = m_tszUserName;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuRoot, (LPARAM)&clmi);
+ Menu_ModifyItem(hMenuRoot, &clmi);
}
break;
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index e73c034968..ae0f2f40b3 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -57,7 +57,7 @@ void FacebookProto::CheckAvatarChange(HANDLE hContact, std::string image_url)
if (image_url.empty())
return;
- bool big_avatars = (bool)db_get_b(NULL, m_szModuleName, FACEBOOK_KEY_BIG_AVATARS, DEFAULT_BIG_AVATARS);
+ bool big_avatars = db_get_b(NULL, m_szModuleName, FACEBOOK_KEY_BIG_AVATARS, DEFAULT_BIG_AVATARS) != 0;
// We've got url to avatar of default size 32x32px, let's change it to slightly bigger (50x50px) - looks like maximum size for square format
std::tstring::size_type pos = image_url.rfind( "/s32x32/" );
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h
index 41bf2e513e..0637b90f5e 100644
--- a/protocols/FacebookRM/src/proto.h
+++ b/protocols/FacebookRM/src/proto.h
@@ -186,9 +186,7 @@ public:
void parseSmileys(std::string message, HANDLE hContact);
// Handles, Locks
- HGENMENU m_hMenuRoot;
- HGENMENU m_hMenuServicesRoot;
- HANDLE m_hStatusMind;
+ HGENMENU m_hMenuRoot, m_hMenuServicesRoot, m_hStatusMind;
HANDLE signon_lock_;
HANDLE avatar_lock_;
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index f2b14ce3bf..e7dff88aba 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -247,7 +247,7 @@ void FacebookProto::ToggleStatusMenuItems( BOOL bEnable )
CLISTMENUITEM clmi = {sizeof(clmi)};
clmi.flags = CMIM_FLAGS | (( bEnable ) ? 0 : CMIF_GRAYED);
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)m_hMenuRoot, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)m_hStatusMind, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)m_hMenuServicesRoot, ( LPARAM )&clmi );
+ Menu_ModifyItem(m_hMenuRoot, &clmi );
+ Menu_ModifyItem(m_hStatusMind, &clmi );
+ Menu_ModifyItem(m_hMenuServicesRoot, &clmi );
}
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 133c38469f..f52f97b76c 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -838,7 +838,7 @@ int GGPROTO::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.ptszName = m_tszUserName;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuRoot, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuRoot, &mi);
}
break;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index 752e764ccf..a38c11fe2a 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -2332,9 +2332,9 @@ void CIrcProto::OnIrcDisconnected()
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuJoin, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuList, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuNick, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuJoin, &mi);
+ Menu_ModifyItem(hMenuList, &mi);
+ Menu_ModifyItem(hMenuNick, &mi);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -2362,9 +2362,9 @@ bool CIrcProto::DoOnConnect( const CIrcMessage* )
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuJoin, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuList, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuNick, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuJoin, &mi);
+ Menu_ModifyItem(hMenuList, &mi);
+ Menu_ModifyItem(hMenuNick, &mi);
int Temp = m_iStatus;
m_iStatus = ID_STATUS_ONLINE;
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 55566a75c0..7c25fbc036 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -1035,7 +1035,7 @@ int __cdecl CIrcProto::OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.ptszName = m_tszUserName;
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuRoot, ( LPARAM )&mi );
+ Menu_ModifyItem(hMenuRoot, &mi);
}
break;
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index a0103154d7..8a0b478598 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -765,7 +765,7 @@ void CConnectPrefsDlg::OnApply()
mi.flags = CMIM_FLAGS;
if ( !m_proto->m_useServer )
mi.flags |= CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)m_proto->hMenuServer, (LPARAM)&mi);
+ Menu_ModifyItem(m_proto->hMenuServer, &mi);
m_proto->m_joinOnInvite = m_autoJoin.GetState();
m_proto->m_hideServerWindow = !m_showServer.GetState();
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index dc1efbdacf..b8b7a2d056 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -781,11 +781,11 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet)
CLISTMENUITEM mi = { sizeof(mi) };
if (bOldXStatus <= XSTATUS_COUNT) {
mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hXStatusItems[bOldXStatus], (LPARAM)&mi);
+ Menu_ModifyItem(hXStatusItems[bOldXStatus], &mi);
}
mi.flags = CMIM_FLAGS | CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hXStatusItems[bXStatus], (LPARAM)&mi);
+ Menu_ModifyItem(hXStatusItems[bXStatus], &mi);
}
if (bXStatus) {
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp
index 0cf65d5eb7..b7ca1ce204 100644
--- a/protocols/IcqOscarJ/src/init.cpp
+++ b/protocols/IcqOscarJ/src/init.cpp
@@ -144,18 +144,6 @@ extern "C" int __declspec(dllexport) Unload(void)
return 0;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// OnPrebuildContactMenu event
-
-static void CListSetMenuItemIcon(HANDLE hMenuItem, HICON hIcon)
-{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | CMIM_ICON;
- mi.hIcon = hIcon;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&mi);
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// UpdateGlobalSettings event
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 5d07eab6cc..9cdc9a4758 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -1294,7 +1294,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = (CMIM_NAME|CMIF_UNICODE);
mi.ptszName = szBuff;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)dat->ppro->hXStatusMenuItems[dat->dwXStatus], (LPARAM)&mi);
+ Menu_ModifyItem(dat->ppro->hXStatusMenuItems[dat->dwXStatus], &mi);
dat->ppro->MraSetXStatusInternal(dat->dwXStatus);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 04a079bfd3..bdf55a975f 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -1189,7 +1189,7 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
clmi.ptszName = m_tszUserName;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)mainMenuRoot, (LPARAM)&clmi);
+ Menu_ModifyItem(mainMenuRoot, &clmi);
}
break;
diff --git a/protocols/Tlen/src/jabber.h b/protocols/Tlen/src/jabber.h
index 2b3899cc3a..28459d781a 100644
--- a/protocols/Tlen/src/jabber.h
+++ b/protocols/Tlen/src/jabber.h
@@ -314,7 +314,7 @@ struct TlenProtocol : public PROTO_INTERFACE
CRITICAL_SECTION modeMsgMutex;
- HANDLE hMenuRoot;
+ HGENMENU hMenuRoot;
char *searchJID;
int searchID;
diff --git a/protocols/Tlen/src/jabber_iqid.cpp b/protocols/Tlen/src/jabber_iqid.cpp
index ef5a6844dc..a94630b628 100644
--- a/protocols/Tlen/src/jabber_iqid.cpp
+++ b/protocols/Tlen/src/jabber_iqid.cpp
@@ -243,9 +243,9 @@ void JabberIqResultRoster(TlenProtocol *proto, XmlNode *iqNode)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto->hMenuMUC, (LPARAM) &mi);
+ Menu_ModifyItem(proto->hMenuMUC, &mi);
if (proto->hMenuChats != NULL)
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto->hMenuChats, (LPARAM)&mi);
+ Menu_ModifyItem(proto->hMenuChats, &mi);
}
proto->isOnline = TRUE;
diff --git a/protocols/Tlen/src/jabber_svc.cpp b/protocols/Tlen/src/jabber_svc.cpp
index db39892f83..8a505ac471 100644
--- a/protocols/Tlen/src/jabber_svc.cpp
+++ b/protocols/Tlen/src/jabber_svc.cpp
@@ -1191,7 +1191,7 @@ int __cdecl TlenProtocol::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPAR
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIF_TCHAR;
mi.ptszName = m_tszUserName;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuRoot, ( LPARAM )&mi );
+ Menu_ModifyItem(hMenuRoot, &mi);
/* FIXME: Rename network user as well */
}
}
diff --git a/protocols/Tlen/src/jabber_thread.cpp b/protocols/Tlen/src/jabber_thread.cpp
index 31fb47a10f..ce4a95f539 100644
--- a/protocols/Tlen/src/jabber_thread.cpp
+++ b/protocols/Tlen/src/jabber_thread.cpp
@@ -353,9 +353,9 @@ void __cdecl JabberServerThread(ThreadData *info)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->proto->hMenuMUC, (LPARAM) &mi);
+ Menu_ModifyItem(info->proto->hMenuMUC, &mi);
if (info->proto->hMenuChats != NULL)
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->proto->hMenuChats, (LPARAM) &mi);
+ Menu_ModifyItem(info->proto->hMenuChats, &mi);
// Set status to offline
oldStatus = info->proto->m_iStatus;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index 495a89a0ee..de5c844120 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -321,7 +321,7 @@ static void initMenuItems(TlenProtocol *proto)
mi.icolibItem = GetIconHandle(IDI_CHATS);
mi.pszService = text;
proto->hMenuChats = Menu_AddMainMenuItem(&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto->hMenuChats, (LPARAM) &clmi);
+ Menu_ModifyItem(proto->hMenuChats, &clmi);
}
// "Multi-User Conference"
@@ -332,7 +332,7 @@ static void initMenuItems(TlenProtocol *proto)
mi.icolibItem = GetIconHandle(IDI_MUC);
mi.pszService = text;
proto->hMenuMUC = Menu_AddMainMenuItem(&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto->hMenuMUC, (LPARAM) &clmi);
+ Menu_ModifyItem(proto->hMenuMUC, &clmi);
sprintf(text, "%s/MainMenuInbox", proto->m_szModuleName);
CreateServiceFunction_Ex(text, proto, TlenMenuHandleInbox);
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp
index e24666ef02..fcd5827ffd 100644
--- a/protocols/Yahoo/src/proto.cpp
+++ b/protocols/Yahoo/src/proto.cpp
@@ -728,7 +728,7 @@ int __cdecl CYahooProto::OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARA
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.ptszName = m_tszUserName;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)mainMenuRoot, (LPARAM)&mi );
+ Menu_ModifyItem(mainMenuRoot, &mi);
}
break;
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index edabd41796..debabd55a2 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -471,8 +471,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
if (reset || check) {
PMO_IntMenuItem timiParent = MO_GetIntMenuItem(timi->mi.root);
if (timiParent) {
- CLISTMENUITEM mi2 = {0};
- mi2.cbSize = sizeof(mi2);
+ CLISTMENUITEM mi2 = { sizeof(mi2) };
mi2.flags = CMIM_NAME | CMIF_TCHAR;
mi2.ptszName = TranslateTH(timi->mi.hLangpack, timi->mi.hIcon ? timi->mi.ptszName : LPGENT("Custom status"));
@@ -510,7 +509,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
SetMenuItemInfo(it.OwnerMenu, it.position, TRUE, &mi);
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)timi->mi.root, (LPARAM)&mi2);
+ Menu_ModifyItem(timi->mi.root, &mi2);
timiParent->iconId = timi->iconId;
if (timiParent->hBmp) DeleteObject(timiParent->hBmp);
timiParent->hBmp = NULL;