summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/theme.cpp22
-rw-r--r--protocols/FacebookRM/theme.cpp24
-rw-r--r--protocols/GTalkExt/menu.cpp2
-rw-r--r--protocols/Gadu-Gadu/gg.c8
-rw-r--r--protocols/Gadu-Gadu/groupchat.c4
-rw-r--r--protocols/Gadu-Gadu/image.c2
-rw-r--r--protocols/Gadu-Gadu/import.c10
-rw-r--r--protocols/Gadu-Gadu/sessions.c2
-rw-r--r--protocols/IRCG/services.cpp20
-rw-r--r--protocols/IcqOscarJ/icq_menu.cpp12
-rw-r--r--protocols/IcqOscarJ/icq_xstatus.cpp2
-rw-r--r--protocols/JabberG/jabber_menu.cpp62
-rw-r--r--protocols/JabberG/jabber_privacy.cpp8
-rw-r--r--protocols/JabberG/jabber_xstatus.cpp2
-rw-r--r--protocols/MRA/Mra.h2
-rw-r--r--protocols/MRA/Mra_functions.cpp4
-rw-r--r--protocols/MRA/Mra_svcs.cpp56
-rw-r--r--protocols/MSN/msn_menu.cpp20
-rw-r--r--protocols/NewsAggregator/Src/Menus.cpp12
-rw-r--r--protocols/Quotes/Forex.cpp22
-rw-r--r--protocols/Twitter/proto.cpp7
-rw-r--r--protocols/Twitter/theme.cpp5
-rw-r--r--protocols/Weather/weather_svcs.cpp28
-rw-r--r--protocols/YAMN/main.cpp6
-rw-r--r--protocols/Yahoo/services.cpp18
25 files changed, 170 insertions, 190 deletions
diff --git a/protocols/AimOscar/theme.cpp b/protocols/AimOscar/theme.cpp
index 315fd1d0e4..326401052c 100644
--- a/protocols/AimOscar/theme.cpp
+++ b/protocols/AimOscar/theme.cpp
@@ -445,18 +445,16 @@ void CAimProto::InitMainMenus(void)
mi.cbSize = sizeof(mi);
HGENMENU hRoot = MO_GetProtoRootMenu(m_szModuleName);
- if (hRoot == NULL)
- {
+ if (hRoot == NULL) {
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle("aim");
mi.ptszName = m_tszUserName;
mi.hParentMenu = HGENMENU_ROOT;
mi.popupPosition = 500090000;
mi.position = 500090000;
- hRoot = hMenuRoot = (HGENMENU)CallService(MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
- else
- {
+ else {
RemoveMainMenus();
hMenuRoot = NULL;
}
@@ -470,21 +468,21 @@ void CAimProto::InitMainMenus(void)
mi.position = 201001;
mi.icolibItem = GetIconHandle("aim");
mi.pszName = LPGEN("Manage Account");
- hMainMenu[0] = (HGENMENU)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/InstantIdle");
CreateProtoService("/InstantIdle",&CAimProto::InstantIdle);
mi.position = 201002;
mi.icolibItem = GetIconHandle("idle");
mi.pszName = LPGEN("Instant Idle");
- hMainMenu[1] = (HGENMENU)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/JoinChatRoom");
CreateProtoService("/JoinChatRoom", &CAimProto::JoinChatUI);
mi.position = 201003;
mi.icolibItem = GetIconHandle("aol");
mi.pszName = LPGEN( "Join Chat Room" );
- hMainMenu[2] = (HGENMENU)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ hMainMenu[2] = Menu_AddProtoMenuItem(&mi);
}
void CAimProto::InitContactMenus(void)
@@ -503,7 +501,7 @@ void CAimProto::InitContactMenus(void)
mi.icolibItem = GetIconHandle("away");
mi.pszName = LPGEN("Read &HTML Away Message");
mi.flags = CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_ICONFROMICOLIB;
- hHTMLAwayContextMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hHTMLAwayContextMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/GetProfile");
CreateProtoService("/GetProfile", &CAimProto::GetProfile);
@@ -511,7 +509,7 @@ void CAimProto::InitContactMenus(void)
mi.icolibItem = GetIconHandle("profile");
mi.pszName = LPGEN("Read Profile");
mi.flags = CMIF_NOTOFFLINE | CMIF_ICONFROMICOLIB;
- hReadProfileMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hReadProfileMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/AddToServerList");
CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
@@ -519,7 +517,7 @@ void CAimProto::InitContactMenus(void)
mi.icolibItem = GetIconHandle("add");
mi.pszName = LPGEN("Add To Server List");
mi.flags = CMIF_NOTONLINE | CMIF_HIDDEN | CMIF_ICONFROMICOLIB;
- hAddToServerListContextMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hAddToServerListContextMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/BlockCommand");
CreateProtoService("/BlockCommand", &CAimProto::BlockBuddy);
@@ -527,7 +525,7 @@ void CAimProto::InitContactMenus(void)
mi.icolibItem = GetIconHandle("block");
mi.pszName = LPGEN("&Block");
mi.flags = CMIF_ICONFROMICOLIB | CMIF_HIDDEN;
- hBlockContextMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hBlockContextMenuItem = Menu_AddContactMenuItem(&mi);
}
void CAimProto::RemoveMainMenus(void)
diff --git a/protocols/FacebookRM/theme.cpp b/protocols/FacebookRM/theme.cpp
index c6712c37ee..02c28a4b8e 100644
--- a/protocols/FacebookRM/theme.cpp
+++ b/protocols/FacebookRM/theme.cpp
@@ -158,40 +158,35 @@ void InitContactMenus()
mi.pszName = GetIconDescription("homepage");
mi.pszService = "FacebookProto/VisitProfile";
g_hContactMenuSvc[CMI_VISIT_PROFILE] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::VisitProfile>);
- g_hContactMenuItems[CMI_VISIT_PROFILE] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_VISIT_PROFILE] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006001;
mi.icolibItem = GetIconHandle("authRevoke");
mi.pszName = GetIconDescription("authRevoke");
mi.pszService = "FacebookProto/CancelFriendship";
g_hContactMenuSvc[CMI_AUTH_REVOKE] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::CancelFriendship>);
- g_hContactMenuItems[CMI_AUTH_REVOKE] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_AUTH_REVOKE] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006001;
mi.icolibItem = GetIconHandle("authRevokeReq");
mi.pszName = GetIconDescription("authRevokeReq");
mi.pszService = "FacebookProto/CancelFriendshipRequest";
g_hContactMenuSvc[CMI_AUTH_CANCEL] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::OnCancelFriendshipRequest>);
- g_hContactMenuItems[CMI_AUTH_CANCEL] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_AUTH_CANCEL] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006002;
mi.icolibItem = GetIconHandle("authAsk");
mi.pszName = GetIconDescription("authAsk");
mi.pszService = "FacebookProto/RequestFriendship";
g_hContactMenuSvc[CMI_AUTH_ASK] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::RequestFriendship>);
- g_hContactMenuItems[CMI_AUTH_ASK] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_AUTH_ASK] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006003;
mi.icolibItem = GetIconHandle("authGrant");
mi.pszName = GetIconDescription("authGrant");
mi.pszService = "FacebookProto/ApproveFriendship";
g_hContactMenuSvc[CMI_AUTH_GRANT] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::ApproveFriendship>);
- g_hContactMenuItems[CMI_AUTH_GRANT] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
}
void UninitContactMenus()
@@ -255,8 +250,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | ( this->isOnline() ? 0 : CMIF_GRAYED );
mi.icolibItem = GetIconHandle( "facebook" );
mi.ptszName = m_tszUserName;
- hRoot = m_hMenuRoot = reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDPROTOMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
+ hRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
} else {
if ( m_hMenuRoot )
CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )m_hMenuRoot, 0 );
@@ -271,8 +265,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.hParentMenu = hRoot;
mi.pszName = LPGEN("Mind...");
mi.icolibItem = GetIconHandle("mind");
- m_hStatusMind = reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDPROTOMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
+ m_hStatusMind = Menu_AddProtoMenuItem(&mi);
CreateProtoService(m_szModuleName,"/VisitProfile",&FacebookProto::VisitProfile,this);
strcpy(tDest,"/VisitProfile");
@@ -280,8 +273,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.pszName = LPGEN("Visit Profile");
mi.icolibItem = GetIconHandle("homepage");
// TODO RM: remember and properly free in destructor?
- /*m_hStatusMind = */reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDPROTOMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
+ /*m_hStatusMind = */Menu_AddProtoMenuItem(&mi);
return 0;
}
diff --git a/protocols/GTalkExt/menu.cpp b/protocols/GTalkExt/menu.cpp
index fc1a2f5503..26c81a165f 100644
--- a/protocols/GTalkExt/menu.cpp
+++ b/protocols/GTalkExt/menu.cpp
@@ -67,7 +67,7 @@ BOOL InitMenus(BOOL init)
cmi.hIcon = g_hPopupIcon;
cmi.ptszName = _T(OPEN_MAILBOX_ITEM_CAPTION);
cmi.pszService = MS_GTALKEXT_OPENMAILBOX;
- hOpenMailboxMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&cmi);
+ hOpenMailboxMenuItem = Menu_AddContactMenuItem(&cmi);
if (!hOpenMailboxMenuItem) {
InitMenus(FALSE);
diff --git a/protocols/Gadu-Gadu/gg.c b/protocols/Gadu-Gadu/gg.c
index 2cc361b57a..8e573ba6ce 100644
--- a/protocols/Gadu-Gadu/gg.c
+++ b/protocols/Gadu-Gadu/gg.c
@@ -317,7 +317,7 @@ static void gg_block_init(GGPROTO *gg)
mi.pszName = LPGEN("&Block");
mi.pszService = service;
mi.pszContactOwner = GG_PROTO;
- gg->hBlockMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ gg->hBlockMenuItem = Menu_AddContactMenuItem(&mi);
gg->hPrebuildMenuHook = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, gg_prebuildcontactmenu);
}
@@ -345,7 +345,7 @@ void gg_menus_init(GGPROTO *gg)
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_GG);
- hGCRoot = hCLRoot = hRoot = gg->hMenuRoot = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ hGCRoot = hCLRoot = hRoot = gg->hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else
{
@@ -355,12 +355,12 @@ void gg_menus_init(GGPROTO *gg)
mi.ptszName = LPGENT("Conference");
mi.position = 200001;
mi.icolibItem = GetIconHandle(IDI_CONFERENCE);
- hGCRoot = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ hGCRoot = Menu_AddProtoMenuItem(&mi);
mi.ptszName = LPGENT("Contact list");
mi.position = 200002;
mi.icolibItem = GetIconHandle(IDI_LIST);
- hCLRoot = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ hCLRoot = Menu_AddProtoMenuItem(&mi);
if (gg->hMenuRoot)
CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)gg->hMenuRoot, 0);
diff --git a/protocols/Gadu-Gadu/groupchat.c b/protocols/Gadu-Gadu/groupchat.c
index 9ead102cf8..ddeea1a7cf 100644
--- a/protocols/Gadu-Gadu/groupchat.c
+++ b/protocols/Gadu-Gadu/groupchat.c
@@ -79,7 +79,7 @@ void gg_gc_menus_init(GGPROTO *gg, HGENMENU hRoot)
mi.icolibItem = GetIconHandle(IDI_CONFERENCE);
mi.pszName = LPGEN("Open &conference...");
mi.pszService = service;
- gg->hMainMenu[0] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
// Clear ignored conferences
mir_snprintf(service, sizeof(service), GGS_CLEAR_IGNORED, GG_PROTO);
@@ -88,7 +88,7 @@ void gg_gc_menus_init(GGPROTO *gg, HGENMENU hRoot)
mi.icolibItem = GetIconHandle(IDI_CLEAR_CONFERENCE);
mi.pszName = LPGEN("&Clear ignored conferences");
mi.pszService = service;
- gg->hMainMenu[1] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
}
}
diff --git a/protocols/Gadu-Gadu/image.c b/protocols/Gadu-Gadu/image.c
index fa32fedee9..b04bb758b4 100644
--- a/protocols/Gadu-Gadu/image.c
+++ b/protocols/Gadu-Gadu/image.c
@@ -82,7 +82,7 @@ int gg_img_init(GGPROTO *gg)
mi.pszName = LPGEN("&Image");
mi.pszService = service;
mi.pszContactOwner = GG_PROTO;
- gg->hImageMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mi);
+ gg->hImageMenuItem = Menu_AddContactMenuItem(&mi);
// Receive image
mir_snprintf(service, sizeof(service), GGS_RECVIMAGE, GG_PROTO);
diff --git a/protocols/Gadu-Gadu/import.c b/protocols/Gadu-Gadu/import.c
index 43a0367402..460c417a0e 100644
--- a/protocols/Gadu-Gadu/import.c
+++ b/protocols/Gadu-Gadu/import.c
@@ -630,7 +630,7 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot)
mi.icolibItem = GetIconHandle(IDI_IMPORT_SERVER);
mi.pszName = LPGEN("Import List From &Server");
mi.pszService = service;
- gg->hMainMenu[2] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[2] = Menu_AddProtoMenuItem(&mi);
// Import from textfile
mir_snprintf(service, sizeof(service), GGS_IMPORT_TEXT, GG_PROTO);
@@ -639,7 +639,7 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot)
mi.icolibItem = GetIconHandle(IDI_IMPORT_TEXT);
mi.pszName = LPGEN("Import List From &Text File...");
mi.pszService = service;
- gg->hMainMenu[3] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[3] = Menu_AddProtoMenuItem(&mi);
// Remove from server
mir_snprintf(service, sizeof(service), GGS_REMOVE_SERVER, GG_PROTO);
@@ -648,7 +648,7 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot)
mi.icolibItem = GetIconHandle(IDI_REMOVE_SERVER);
mi.pszName = LPGEN("&Remove List From Server");
mi.pszService = service;
- gg->hMainMenu[4] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[4] = Menu_AddProtoMenuItem(&mi);
// Export to server
mir_snprintf(service, sizeof(service), GGS_EXPORT_SERVER, GG_PROTO);
@@ -657,7 +657,7 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot)
mi.icolibItem = GetIconHandle(IDI_EXPORT_SERVER);
mi.pszName = LPGEN("Export List To &Server");
mi.pszService = service;
- gg->hMainMenu[5] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[5] = Menu_AddProtoMenuItem(&mi);
// Export to textfile
mir_snprintf(service, sizeof(service), GGS_EXPORT_TEXT, GG_PROTO);
@@ -666,5 +666,5 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot)
mi.icolibItem = GetIconHandle(IDI_EXPORT_TEXT);
mi.pszName = LPGEN("Export List To &Text File...");
mi.pszService = service;
- gg->hMainMenu[6] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[6] = Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/Gadu-Gadu/sessions.c b/protocols/Gadu-Gadu/sessions.c
index 39348fef61..d5ea8b5577 100644
--- a/protocols/Gadu-Gadu/sessions.c
+++ b/protocols/Gadu-Gadu/sessions.c
@@ -441,5 +441,5 @@ void gg_sessions_menus_init(GGPROTO* gg, HGENMENU hRoot)
mi.icolibItem = GetIconHandle(IDI_SESSIONS);
mi.ptszName = LPGENT("Concurrent &sessions");
mi.pszService = service;
- CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/IRCG/services.cpp b/protocols/IRCG/services.cpp
index 5d9e7d068f..745ebe80d6 100644
--- a/protocols/IRCG/services.cpp
+++ b/protocols/IRCG/services.cpp
@@ -41,7 +41,7 @@ void CIrcProto::InitMainMenus(void)
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_MAIN);
- hRoot = hMenuRoot = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
if (hMenuRoot)
@@ -55,7 +55,7 @@ void CIrcProto::InitMainMenus(void)
strcpy( d, IRC_QUICKCONNECT );
mi.position = 201001;
mi.hParentMenu = hRoot;
- hMenuQuick = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuQuick = Menu_AddProtoMenuItem(&mi);
if (m_iStatus != ID_STATUS_OFFLINE) mi.flags |= CMIF_GRAYED;
@@ -63,26 +63,26 @@ void CIrcProto::InitMainMenus(void)
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN);//GetIconHandle(IDI_JOIN);
strcpy( d, IRC_JOINCHANNEL );
mi.position = 201002;
- hMenuJoin = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuJoin = Menu_AddProtoMenuItem(&mi);
mi.pszName = LPGEN("&Change your nickname");
mi.icolibItem = GetIconHandle(IDI_RENAME);
strcpy( d, IRC_CHANGENICK );
mi.position = 201003;
- hMenuNick = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuNick = Menu_AddProtoMenuItem(&mi);
mi.pszName = LPGEN("Show the &list of available channels");
mi.icolibItem = GetIconHandle(IDI_LIST);
strcpy( d, IRC_SHOWLIST );
mi.position = 201004;
- hMenuList = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuList = Menu_AddProtoMenuItem(&mi);
if (m_useServer) mi.flags &= ~CMIF_GRAYED;
mi.pszName = LPGEN("&Show the server window");
mi.icolibItem = GetIconHandle(IDI_SERVER);
strcpy( d, IRC_SHOWSERVER );
mi.position = 201005;
- hMenuServer = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuServer = Menu_AddProtoMenuItem(&mi);
}
}
@@ -157,28 +157,28 @@ void InitContactMenus(void)
mi.icolibItem = GetIconHandle(IDI_MANAGER);
strcpy(d, IRC_UM_CHANSETTINGS);
mi.popupPosition = 500090002;
- hUMenuChanSettings = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hUMenuChanSettings = Menu_AddContactMenuItem(&mi);
hMenuChanSettings = CreateServiceFunction(temp, IrcMenuChanSettings);
mi.pszName = LPGEN("&WhoIs info");
mi.icolibItem = GetIconHandle(IDI_WHOIS);
strcpy(d, IRC_UM_WHOIS);
mi.popupPosition = 500090001;
- hUMenuWhois = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hUMenuWhois = Menu_AddContactMenuItem(&mi);
hMenuWhois = CreateServiceFunction(temp, IrcMenuWhois);
mi.pszName = LPGEN("Di&sconnect");
mi.icolibItem = GetIconHandle(IDI_DELETE);
strcpy(d, IRC_UM_DISCONNECT);
mi.popupPosition = 500090001;
- hUMenuDisconnect = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hUMenuDisconnect = Menu_AddContactMenuItem(&mi);
hMenuDisconnect = CreateServiceFunction(temp, IrcMenuDisconnect);
mi.pszName = LPGEN("&Add to ignore list");
mi.icolibItem = GetIconHandle(IDI_BLOCK);
strcpy(d, IRC_UM_IGNORE);
mi.popupPosition = 500090002;
- hUMenuIgnore = (HGENMENU)CallService( MS_CLIST_ADDCONTACTMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hUMenuIgnore = Menu_AddContactMenuItem(&mi);
hMenuIgnore = CreateServiceFunction( temp, IrcMenuIgnore );
hPreBuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, IrcPrebuildContactMenu);
diff --git a/protocols/IcqOscarJ/icq_menu.cpp b/protocols/IcqOscarJ/icq_menu.cpp
index 7b62c370f7..f6aeb99161 100644
--- a/protocols/IcqOscarJ/icq_menu.cpp
+++ b/protocols/IcqOscarJ/icq_menu.cpp
@@ -143,7 +143,7 @@ void g_MenuInit(void)
mi.position = 1000030000;
mi.icolibItem = hStaticIcons[ISI_AUTH_REQUEST]->Handle();
strcpy(pszDest, MS_REQ_AUTH);
- g_hContactMenuItems[ICMI_AUTH_REQUEST] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_AUTH_REQUEST] = CreateServiceFunction( str, IcqMenuHandleRequestAuth );
// "Grant authorization"
@@ -151,7 +151,7 @@ void g_MenuInit(void)
mi.position = 1000029999;
mi.icolibItem = hStaticIcons[ISI_AUTH_GRANT]->Handle();
strcpy(pszDest, MS_GRANT_AUTH);
- g_hContactMenuItems[ICMI_AUTH_GRANT] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_AUTH_GRANT] = CreateServiceFunction(mi.pszService, IcqMenuHandleGrantAuth);
// "Revoke authorization"
@@ -159,7 +159,7 @@ void g_MenuInit(void)
mi.position = 1000029998;
mi.icolibItem = hStaticIcons[ISI_AUTH_REVOKE]->Handle();
strcpy(pszDest, MS_REVOKE_AUTH);
- g_hContactMenuItems[ICMI_AUTH_REVOKE] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_AUTH_REVOKE] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_AUTH_REVOKE] = CreateServiceFunction(mi.pszService, IcqMenuHandleRevokeAuth);
// "Add to server list"
@@ -167,7 +167,7 @@ void g_MenuInit(void)
mi.position = -2049999999;
mi.icolibItem = hStaticIcons[ISI_ADD_TO_SERVLIST]->Handle();
strcpy(pszDest, MS_ICQ_ADDSERVCONTACT);
- g_hContactMenuItems[ICMI_ADD_TO_SERVLIST] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_ADD_TO_SERVLIST] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_ADD_TO_SERVLIST] = CreateServiceFunction(mi.pszService, IcqMenuHandleAddServContact);
// "Show custom status details"
@@ -175,14 +175,14 @@ void g_MenuInit(void)
mi.position = -2000004999;
mi.flags = 0;
strcpy(pszDest, MS_XSTATUS_SHOWDETAILS);
- g_hContactMenuItems[ICMI_XSTATUS_DETAILS] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_XSTATUS_DETAILS] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_XSTATUS_DETAILS] = CreateServiceFunction(mi.pszService, IcqMenuHandleXStatusDetails);
// "Open ICQ profile"
mi.pszName = LPGEN("Open ICQ profile");
mi.position = 1000029997;
strcpy(pszDest, MS_OPEN_PROFILE);
- g_hContactMenuItems[ICMI_OPEN_PROFILE] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_OPEN_PROFILE] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_OPEN_PROFILE] = CreateServiceFunction(mi.pszService, IcqMenuHandleOpenProfile);
}
diff --git a/protocols/IcqOscarJ/icq_xstatus.cpp b/protocols/IcqOscarJ/icq_xstatus.cpp
index 9a1abb5df5..44bd02157c 100644
--- a/protocols/IcqOscarJ/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/icq_xstatus.cpp
@@ -1057,7 +1057,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
mi.pszService = srvFce;
mi.pszContactOwner = m_szModuleName;
- hXStatusItems[i] = (HANDLE)CallService(MS_CLIST_ADDSTATUSMENUITEM, (WPARAM)&hXStatusRoot, (LPARAM)&mi);
+ hXStatusItems[i] = Menu_AddStatusMenuItem(&mi);
// CMIF_HIDDEN does not work for adding services
CListShowMenuItem(hXStatusItems[i], !(m_bHideXStatusUI || m_bHideXStatusMenu));
diff --git a/protocols/JabberG/jabber_menu.cpp b/protocols/JabberG/jabber_menu.cpp
index 6d7616db10..4ddfaa7ea6 100644
--- a/protocols/JabberG/jabber_menu.cpp
+++ b/protocols/JabberG/jabber_menu.cpp
@@ -232,7 +232,7 @@ void g_MenuInit( void )
mi.position = -2000001000;
mi.icolibItem = g_GetIconHandle( IDI_REQUEST );
mi.pszService = "Jabber/ReqAuth";
- g_hMenuRequestAuth = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuRequestAuth = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuHandleRequestAuth ));
// "Grant authorization"
@@ -240,7 +240,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Grant authorization");
mi.position = -2000001001;
mi.icolibItem = g_GetIconHandle( IDI_GRANT );
- g_hMenuGrantAuth = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuGrantAuth = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuHandleGrantAuth ));
// Revoke auth
@@ -248,7 +248,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Revoke authorization");
mi.position = -2000001002;
mi.icolibItem = g_GetIconHandle( IDI_AUTHREVOKE );
- g_hMenuRevokeAuth = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuRevokeAuth = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuRevokeAuth ));
// "Convert Chat/Contact"
@@ -256,7 +256,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Convert");
mi.position = -1999901004;
mi.icolibItem = g_GetIconHandle( IDI_USER2ROOM );
- g_hMenuConvert = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuConvert = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuConvertChatContact ));
// "Add to roster"
@@ -264,7 +264,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Add to roster");
mi.position = -1999901005;
mi.icolibItem = g_GetIconHandle( IDI_ADDROSTER );
- g_hMenuRosterAdd = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuRosterAdd = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuRosterAdd ));
// "Add to Bookmarks"
@@ -272,7 +272,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Add to Bookmarks");
mi.position = -1999901006;
mi.icolibItem = g_GetIconHandle( IDI_BOOKMARKS);
- g_hMenuAddBookmark = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuAddBookmark = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuBookmarkAdd ));
// Login/logout
@@ -280,7 +280,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Login/logout");
mi.position = -1999901007;
mi.icolibItem = g_GetIconHandle( IDI_LOGIN );
- g_hMenuLogin = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuLogin = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuTransportLogin ));
// Retrieve nicks
@@ -288,7 +288,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Resolve nicks");
mi.position = -1999901008;
mi.icolibItem = g_GetIconHandle( IDI_REFRESH );
- g_hMenuRefresh = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuTransportResolve ));
// Run Commands
@@ -296,7 +296,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Commands");
mi.position = -1999901009;
mi.icolibItem = g_GetIconHandle( IDI_COMMAND );
- g_hMenuCommands = ( HGENMENU )JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuCommands = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberContactMenuRunCommands ));
// Send Note
@@ -304,7 +304,7 @@ void g_MenuInit( void )
mi.pszName = LPGEN("Send Note");
mi.position = -1999901010;
mi.icolibItem = g_GetIconHandle( IDI_SEND_NOTE);
- g_hMenuSendNote = ( HGENMENU )JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuSendNote = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuSendNote ));
// Direct Presence
@@ -313,7 +313,7 @@ void g_MenuInit( void )
mi.position = -1999901011;
mi.pszPopupName = (char *)-1;
mi.icolibItem = g_GetIconHandle( IDI_NOTES );
- g_hMenuDirectPresence[0] = ( HGENMENU )JCallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
mi.flags |= CMIF_ROOTHANDLE;
mi.flags &= ~CMIF_ICONFROMICOLIB;
@@ -327,7 +327,7 @@ void g_MenuInit( void )
mi.position = -1999901000;
mi.hParentMenu = g_hMenuDirectPresence[0];
mi.icolibItem = LoadSkinnedIcon(PresenceModeArray[i].icon);
- g_hMenuDirectPresence[i+1] = ( HGENMENU )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuDirectPresence[i+1] = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleDirectPresence, PresenceModeArray[i].mode ));
}
@@ -340,7 +340,7 @@ void g_MenuInit( void )
mi.position = -1999901011;
mi.pszPopupName = (char *)-1;
mi.icolibItem = g_GetIconHandle( IDI_JABBER );
- g_hMenuResourcesRoot = ( HGENMENU )JCallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuResourcesRoot = Menu_AddContactMenuItem(&mi);
mi.pszService = "Jabber/UseResource_last";
mi.pszName = LPGEN("Last Active");
@@ -348,7 +348,7 @@ void g_MenuInit( void )
mi.hParentMenu = g_hMenuResourcesRoot;
mi.icolibItem = g_GetIconHandle( IDI_JABBER );
mi.flags |= CMIF_ROOTHANDLE;
- g_hMenuResourcesActive = ( HGENMENU )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuResourcesActive = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleResource, MENUITEM_LASTSEEN ));
mi.pszService = "Jabber/UseResource_server";
@@ -356,7 +356,7 @@ void g_MenuInit( void )
mi.position = -1999901000;
mi.pszPopupName = (char *)g_hMenuResourcesRoot;
mi.icolibItem = g_GetIconHandle( IDI_NODE_SERVER );
- g_hMenuResourcesServer = ( HGENMENU )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuResourcesServer = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleResource, MENUITEM_SERVER ));
}
@@ -483,7 +483,7 @@ int CJabberProto::OnPrebuildContactMenu( WPARAM wParam, LPARAM )
mi.pszName = "";
mi.position = i;
mi.pszPopupName = (char *)g_hMenuResourcesRoot;
- m_phMenuResourceItems[i] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ m_phMenuResourceItems[i] = Menu_AddContactMenuItem(&mi);
}
if ( i < item->resourceCount ) {
CLISTMENUITEM clmi = {0};
@@ -720,7 +720,7 @@ void CJabberProto::MenuInit()
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle( IDI_JABBER );
- hJabberRoot = m_hMenuRoot = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi );
+ hJabberRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
if ( m_hMenuRoot )
@@ -736,7 +736,7 @@ void CJabberProto::MenuInit()
mi.pszName = LPGEN("Bookmarks");
mi.position = 200001;
mi.icolibItem = GetIconHandle( IDI_BOOKMARKS );
- m_hMenuBookmarks = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuBookmarks = Menu_AddProtoMenuItem(&mi);
// "Options..."
JCreateService( "/Options", &CJabberProto::OnMenuOptions );
@@ -744,14 +744,14 @@ void CJabberProto::MenuInit()
mi.pszName = LPGEN("Options...");
mi.position = 200002;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
- JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddProtoMenuItem(&mi);
// "Services..."
mi.pszName = LPGEN("Services...");
strcpy( tDest, "/Services" );
mi.position = 200003;
mi.icolibItem = GetIconHandle( IDI_SERVICE_DISCOVERY );
- HGENMENU hMenuServicesRoot = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ HGENMENU hMenuServicesRoot = Menu_AddProtoMenuItem(&mi);
// "Service Discovery..."
JCreateService( "/ServiceDiscovery", &CJabberProto::OnMenuHandleServiceDiscovery );
@@ -761,35 +761,35 @@ void CJabberProto::MenuInit()
mi.position = 2000050001;
mi.icolibItem = GetIconHandle( IDI_SERVICE_DISCOVERY );
mi.hParentMenu = hMenuServicesRoot;
- m_hMenuServiceDiscovery = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuServiceDiscovery = Menu_AddProtoMenuItem(&mi);
JCreateService( "/SD/MyTransports", &CJabberProto::OnMenuHandleServiceDiscoveryMyTransports );
strcpy( tDest, "/SD/MyTransports" );
mi.pszName = LPGEN("Registered Transports");
mi.position = 2000050003;
mi.icolibItem = GetIconHandle( IDI_TRANSPORTL );
- m_hMenuSDMyTransports = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuSDMyTransports = Menu_AddProtoMenuItem(&mi);
JCreateService( "/SD/Transports", &CJabberProto::OnMenuHandleServiceDiscoveryTransports );
strcpy( tDest, "/SD/Transports" );
mi.pszName = LPGEN("Local Server Transports");
mi.position = 2000050004;
mi.icolibItem = GetIconHandle( IDI_TRANSPORT );
- m_hMenuSDTransports = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuSDTransports = Menu_AddProtoMenuItem(&mi);
JCreateService( "/SD/Conferences", &CJabberProto::OnMenuHandleServiceDiscoveryConferences );
strcpy( tDest, "/SD/Conferences" );
mi.pszName = LPGEN("Browse Chatrooms");
mi.position = 2000050005;
mi.icolibItem = GetIconHandle( IDI_GROUP );
- m_hMenuSDConferences = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuSDConferences = Menu_AddProtoMenuItem(&mi);
JCreateService( "/Groupchat", &CJabberProto::OnMenuHandleJoinGroupchat );
strcpy( tDest, "/Groupchat" );
mi.pszName = LPGEN("Create/Join groupchat");
mi.position = 2000050006;
mi.icolibItem = GetIconHandle( IDI_GROUP );
- m_hMenuGroupchat = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuGroupchat = Menu_AddProtoMenuItem(&mi);
// "Change Password..."
JCreateService( "/ChangePassword", &CJabberProto::OnMenuHandleChangePassword );
@@ -797,7 +797,7 @@ void CJabberProto::MenuInit()
mi.pszName = LPGEN("Change Password");
mi.position = 2000050007;
mi.icolibItem = GetIconHandle( IDI_KEYS );
- m_hMenuChangePassword = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuChangePassword = Menu_AddProtoMenuItem(&mi);
// "Roster editor"
JCreateService( "/RosterEditor", &CJabberProto::OnMenuHandleRosterControl );
@@ -805,7 +805,7 @@ void CJabberProto::MenuInit()
mi.pszName = LPGEN("Roster editor");
mi.position = 2000050009;
mi.icolibItem = GetIconHandle( IDI_AGENTS );
- m_hMenuRosterControl = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuRosterControl = Menu_AddProtoMenuItem(&mi);
// "XML Console"
JCreateService( "/XMLConsole", &CJabberProto::OnMenuHandleConsole );
@@ -813,14 +813,14 @@ void CJabberProto::MenuInit()
mi.pszName = LPGEN("XML Console");
mi.position = 2000050010;
mi.icolibItem = GetIconHandle( IDI_CONSOLE );
- JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddProtoMenuItem(&mi);
JCreateService( "/Notes", &CJabberProto::OnMenuHandleNotes );
strcpy( tDest, "/Notes" );
mi.pszName = LPGEN("Notes");
mi.position = 2000050011;
mi.icolibItem = GetIconHandle( IDI_NOTES);
- m_hMenuNotes = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuNotes = Menu_AddProtoMenuItem(&mi);
BuildPrivacyMenu();
if ( m_menuItemsStatus )
@@ -837,7 +837,7 @@ void CJabberProto::MenuInit()
mi.hParentMenu = hJabberRoot;
mi.pszName = LPGEN("Resource priority");
mi.flags = CMIF_ROOTPOPUP | CMIF_HIDDEN;
- m_hMenuPriorityRoot = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuPriorityRoot = Menu_AddProtoMenuItem(&mi);
char szName[128], srvFce[MAX_PATH + 64], *svcName = srvFce+strlen( m_szModuleName );
mi.pszService = srvFce;
@@ -867,7 +867,7 @@ void CJabberProto::MenuInit()
JCreateServiceParam(svcName, &CJabberProto::OnMenuSetPriority, (LPARAM)steps[i]);
mi.position++;
- CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddProtoMenuItem(&mi);
}
UpdatePriorityMenu((short)JGetWord(NULL, "Priority", 0));
diff --git a/protocols/JabberG/jabber_privacy.cpp b/protocols/JabberG/jabber_privacy.cpp
index 5a8d1b7de6..ada79a9c52 100644
--- a/protocols/JabberG/jabber_privacy.cpp
+++ b/protocols/JabberG/jabber_privacy.cpp
@@ -2263,7 +2263,7 @@ void CJabberProto::BuildPrivacyMenu()
mi.flags = CMIF_ROOTPOPUP | CMIF_CHILDPOPUP | CMIF_ICONFROMICOLIB | CMIF_HIDDEN;
mi.pszName = LPGEN("Privacy Lists");
mi.hParentMenu = MO_GetProtoRootMenu( m_szModuleName );
- m_hPrivacyMenuRoot = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hPrivacyMenuRoot = Menu_AddProtoMenuItem(&mi);
JCreateService( "/PrivacyLists", &CJabberProto::OnMenuHandlePrivacyLists );
char srvFce[MAX_PATH + 64];
@@ -2274,7 +2274,7 @@ void CJabberProto::BuildPrivacyMenu()
mi.icolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
mi.ptszName = LPGENT("List Editor...");
mi.hParentMenu = m_hPrivacyMenuRoot;
- CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddProtoMenuItem(&mi);
}
void CJabberProto::BuildPrivacyListsMenu( bool bDeleteOld )
@@ -2308,7 +2308,7 @@ void CJabberProto::BuildPrivacyListsMenu( bool bDeleteOld )
SKINICON_OTHER_SMALLDOT :
SKINICON_OTHER_EMPTYBLOB);
mi.ptszName = LPGENT("<none>");
- m_hPrivacyMenuItems.insert(( HANDLE )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi ));
+ m_hPrivacyMenuItems.insert( Menu_AddProtoMenuItem(&mi));
for ( CPrivacyList *pList = m_privacyListManager.GetFirstList(); pList; pList = pList->GetNext()) {
++i;
@@ -2325,7 +2325,7 @@ void CJabberProto::BuildPrivacyListsMenu( bool bDeleteOld )
SKINICON_OTHER_SMALLDOT :
SKINICON_OTHER_EMPTYBLOB);
mi.ptszName = pList->GetListName();
- m_hPrivacyMenuItems.insert(( HANDLE )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi ));
+ m_hPrivacyMenuItems.insert( Menu_AddProtoMenuItem(&mi));
}
m_privacyListManager.Unlock();
diff --git a/protocols/JabberG/jabber_xstatus.cpp b/protocols/JabberG/jabber_xstatus.cpp
index 28e1c63096..fdd7a44e2e 100644
--- a/protocols/JabberG/jabber_xstatus.cpp
+++ b/protocols/JabberG/jabber_xstatus.cpp
@@ -498,7 +498,7 @@ void CPepGuiService::RebuildMenu()
mi.icolibItem = m_hIcolibItem;
mi.ptszName = m_szText ? m_szText : _T("<advanced status slot>");
- m_hMenuItem = ( HANDLE )CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ m_hMenuItem = Menu_AddProtoMenuItem(&mi);
} }
bool CPepGuiService::LaunchSetGui(BYTE bQuiet)
diff --git a/protocols/MRA/Mra.h b/protocols/MRA/Mra.h
index c888e8f78c..3f5a1f1394 100644
--- a/protocols/MRA/Mra.h
+++ b/protocols/MRA/Mra.h
@@ -399,7 +399,7 @@ DWORD ProtoBroadcastAckAsynchEx (const char *szModule,HANDLE hC
void MraUserAPCThreadProc (LPVOID lpParameter);
DWORD CreateBlobFromContact (HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwRequestReasonSize,LPBYTE lpbBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet);
-void CListCreateMenu (LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,LPSTR lpszCListMenuType,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult);
+void CListCreateMenu (LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,BOOL bIsStatus,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult);
void CListDestroyMenu (const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount);
void CListShowMenuItem (HANDLE hMenuItem,BOOL bShow);
int ExtraSetIcon (HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType);
diff --git a/protocols/MRA/Mra_functions.cpp b/protocols/MRA/Mra_functions.cpp
index bb88dc3dcd..1cd2630f1c 100644
--- a/protocols/MRA/Mra_functions.cpp
+++ b/protocols/MRA/Mra_functions.cpp
@@ -1393,7 +1393,7 @@ return(dwRetErrorCode);
-void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,LPSTR lpszCListMenuType,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult)
+void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,BOOL bIsMain,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult)
{
if (pgdiItems && hIcoLibIcons && dwCount && hResult)
{
@@ -1423,7 +1423,7 @@ void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR p
mi.flags=(CMIF_UNICODE);
}
- hResult[i]=(HANDLE)CallService(lpszCListMenuType,0,(LPARAM)&mi);
+ hResult[i] = (bIsMain) ? Menu_AddMainMenuItem(&mi) : Menu_AddContactMenuItem(&mi);
if (i==0 && hMainIcon)
{
diff --git a/protocols/MRA/Mra_svcs.cpp b/protocols/MRA/Mra_svcs.cpp
index fa996b1e0c..cb194fb575 100644
--- a/protocols/MRA/Mra_svcs.cpp
+++ b/protocols/MRA/Mra_svcs.cpp
@@ -30,8 +30,7 @@ INT_PTR LoadServices(void)
pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
// Service creation
- for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++)
- {
+ for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++) {
memmove(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
CreateServiceFunction(szServiceFunction,siPluginServices[i].lpFunc);
}
@@ -67,28 +66,24 @@ INT_PTR LoadModules(void)
// Main menu initialization
- CListCreateMenu(2000060000,500085000,(HANDLE)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(IDI_MRA),IMAGE_ICON,0,0,LR_SHARED),NULL,MS_CLIST_ADDMAINMENUITEM,gdiMenuItems,masMraSettings.hMainMenuIcons,SIZEOF(gdiMenuItems),masMraSettings.hMainMenuItems);
+ CListCreateMenu(2000060000,500085000,(HANDLE)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(IDI_MRA),IMAGE_ICON,0,0,LR_SHARED),NULL,TRUE,gdiMenuItems,masMraSettings.hMainMenuIcons,SIZEOF(gdiMenuItems),masMraSettings.hMainMenuItems);
// Contact menu initialization
- CListCreateMenu(2000060000,-500050000,NULL,NULL,MS_CLIST_ADDCONTACTMENUITEM,gdiContactMenuItems,masMraSettings.hContactMenuIcons,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)),masMraSettings.hContactMenuItems);
+ CListCreateMenu(2000060000,-500050000,NULL,NULL,FALSE,gdiContactMenuItems,masMraSettings.hContactMenuIcons,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)),masMraSettings.hContactMenuItems);
// xstatus menu
- if (ServiceExists(MS_CLIST_ADDSTATUSMENUITEM))
- {
- InitXStatusIcons();
- for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++)
- {
- mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
- CreateServiceFunctionParam(szServiceFunction,MraXStatusMenu,i);
- }
+ InitXStatusIcons();
+ for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++) {
+ mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
+ CreateServiceFunctionParam(szServiceFunction,MraXStatusMenu,i);
+ }
- masMraSettings.bHideXStatusUI=FALSE;
- masMraSettings.dwXStatusMode=DB_Mra_GetByte(NULL,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
- if (IsXStatusValid(masMraSettings.dwXStatusMode)==FALSE) masMraSettings.dwXStatusMode=MRA_MIR_XSTATUS_NONE;
+ masMraSettings.bHideXStatusUI=FALSE;
+ masMraSettings.dwXStatusMode=DB_Mra_GetByte(NULL,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
+ if (IsXStatusValid(masMraSettings.dwXStatusMode)==FALSE) masMraSettings.dwXStatusMode=MRA_MIR_XSTATUS_NONE;
- masMraSettings.hHookRebuildStatusMenu=HookEvent(ME_CLIST_PREBUILDSTATUSMENU,MraRebuildStatusMenu);
- MraRebuildStatusMenu(0,0);
- }
+ masMraSettings.hHookRebuildStatusMenu=HookEvent(ME_CLIST_PREBUILDSTATUSMENU,MraRebuildStatusMenu);
+ MraRebuildStatusMenu(0,0);
MraExtraIconsRebuild(0,0);
@@ -119,19 +114,19 @@ void UnloadModules()
}
// xstatus menu destroy
- if (ServiceExists(MS_CLIST_ADDSTATUSMENUITEM))
- {
- if (masMraSettings.hHookRebuildStatusMenu) {UnhookEvent(masMraSettings.hHookRebuildStatusMenu); masMraSettings.hHookRebuildStatusMenu=NULL;}
+ if (masMraSettings.hHookRebuildStatusMenu) {
+ UnhookEvent(masMraSettings.hHookRebuildStatusMenu);
+ masMraSettings.hHookRebuildStatusMenu=NULL;
+ }
- bzero(masMraSettings.hXStatusMenuItems,sizeof(masMraSettings.hXStatusMenuItems));
- // Service deletion
- for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++)
- {
- mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
- DestroyServiceFunction(szServiceFunction);
- }
- DestroyXStatusIcons();
+ bzero(masMraSettings.hXStatusMenuItems,sizeof(masMraSettings.hXStatusMenuItems));
+
+ // Service deletion
+ for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++) {
+ mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
+ DestroyServiceFunction(szServiceFunction);
}
+ DestroyXStatusIcons();
// Main menu destroy
CListDestroyMenu(gdiMenuItems,SIZEOF(gdiMenuItems));
@@ -943,7 +938,6 @@ int MraRebuildStatusMenu(WPARAM wParam,LPARAM lParam)
{
CHAR szServiceFunction[MAX_PATH*2],*pszServiceFunctionName,szValueName[MAX_PATH];
WCHAR szItem[MAX_PATH+64],szStatusTitle[STATUS_TITLE_MAX+4];
- HANDLE hXStatusRoot;
CLISTMENUITEM mi={0};
memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
@@ -979,7 +973,7 @@ int MraRebuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.ptszName=lpcszXStatusNameDef[i];
mi.hIcon=NULL;
}
- masMraSettings.hXStatusMenuItems[i]=(HANDLE)CallService(MS_CLIST_ADDSTATUSMENUITEM,(WPARAM)&hXStatusRoot,(LPARAM)&mi);
+ masMraSettings.hXStatusMenuItems[i] = Menu_AddStatusMenuItem(&mi);
}
return(0);
}
diff --git a/protocols/MSN/msn_menu.cpp b/protocols/MSN/msn_menu.cpp
index bcd88543be..e90480fb32 100644
--- a/protocols/MSN/msn_menu.cpp
+++ b/protocols/MSN/msn_menu.cpp
@@ -306,7 +306,7 @@ void CMsnProto::MsnInitMainMenu(void)
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_MSN);
mi.ptszName = m_tszUserName;
- hRoot = mainMenuRoot = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hRoot = mainMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else
{
@@ -323,35 +323,35 @@ void CMsnProto::MsnInitMainMenu(void)
mi.position = 201001;
mi.icolibItem = GetIconHandle(IDI_MSN);
mi.pszName = LPGEN("Set &Nickname");
- menuItemsMain[0] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[0] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MSN_INVITE);
CreateProtoService(MSN_INVITE, &CMsnProto::MsnInviteCommand);
mi.position = 201002;
mi.icolibItem = GetIconHandle(IDI_INVITE);
mi.pszName = LPGEN("Create &Chat");
- menuItemsMain[0] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[0] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_GOTO_INBOX);
CreateProtoService(MS_GOTO_INBOX, &CMsnProto::MsnGotoInbox);
mi.position = 201003;
mi.icolibItem = GetIconHandle(IDI_INBOX);
mi.pszName = LPGEN("Display &Hotmail Inbox");
- menuItemsMain[1] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[1] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_EDIT_PROFILE);
CreateProtoService(MS_EDIT_PROFILE, &CMsnProto::MsnEditProfile);
mi.position = 201004;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
mi.pszName = LPGEN("View &Profile");
- menuItemsMain[2] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[2] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_EDIT_ALERTS);
CreateProtoService(MS_EDIT_ALERTS, &CMsnProto::MsnSetupAlerts);
mi.position = 201004;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
mi.pszName = LPGEN("Setup Live &Alerts");
- menuItemsMain[3] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[3] = Menu_AddProtoMenuItem(&mi);
MSN_EnableMenuItems(m_iStatus >= ID_STATUS_ONLINE);
}
@@ -467,14 +467,14 @@ void MSN_InitContactMenu(void)
mi.position = -500050000;
mi.icolibItem = GetIconHandle(IDI_MSNBLOCK);
mi.pszName = LPGEN("&Block");
- hBlockMenuItem = (HGENMENU)MSN_CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hBlockMenuItem = Menu_AddContactMenuItem(&mi);
strcpy(tDest, MSN_VIEW_PROFILE);
hViewProfile = CreateServiceFunction(servicefunction, MsnMenuViewProfile);
mi.position = -500050003;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
mi.pszName = LPGEN("View &Profile");
- hLiveSpaceMenuItem = (HGENMENU)MSN_CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hLiveSpaceMenuItem = Menu_AddContactMenuItem(&mi);
strcpy(tDest, MSN_NETMEETING);
hNetMeeting = CreateServiceFunction(servicefunction, MsnMenuSendNetMeeting);
@@ -482,7 +482,7 @@ void MSN_InitContactMenu(void)
mi.position = -500050002;
mi.icolibItem = GetIconHandle(IDI_NETMEETING);
mi.pszName = LPGEN("&Start Netmeeting");
- hNetmeetingMenuItem = (HGENMENU)MSN_CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hNetmeetingMenuItem = Menu_AddContactMenuItem(&mi);
strcpy(tDest, "/SendHotmail");
hSendHotMail = CreateServiceFunction(servicefunction, MsnMenuSendHotmail);
@@ -490,7 +490,7 @@ void MSN_InitContactMenu(void)
mi.flags = CMIF_ICONFROMICOLIB | CMIF_HIDDEN;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SENDEMAIL);
mi.pszName = LPGEN("Open &Hotmail Inbox");
- hOpenInboxMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mi);
+ hOpenInboxMenuItem = Menu_AddContactMenuItem(&mi);
hPrebuildMenuHook = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MSN_OnPrebuildContactMenu);
}
diff --git a/protocols/NewsAggregator/Src/Menus.cpp b/protocols/NewsAggregator/Src/Menus.cpp
index 2ff20ce596..62a5da045d 100644
--- a/protocols/NewsAggregator/Src/Menus.cpp
+++ b/protocols/NewsAggregator/Src/Menus.cpp
@@ -36,39 +36,39 @@ VOID InitMenu()
mi.icolibItem = GetIconHandle("main");
mi.ptszName = LPGENT("Check All Feeds");
mi.pszService = MS_NEWSAGGR_CHECKALLFEEDS;
- hService2[0] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hService2[0] = Menu_AddMainMenuItem(&mi);
mi.position=10100002;
mi.icolibItem = GetIconHandle("addfeed");
mi.ptszName = LPGENT("Add Feed");
mi.pszService = MS_NEWSAGGR_ADDFEED;
- hService2[1] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hService2[1] = Menu_AddMainMenuItem(&mi);
mi.position=10100003;
mi.icolibItem = GetIconHandle("importfeeds");
mi.ptszName = LPGENT("Import Feeds");
mi.pszService = MS_NEWSAGGR_IMPORTFEEDS;
- hService2[2] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hService2[2] = Menu_AddMainMenuItem(&mi);
mi.position=10100004;
mi.icolibItem = GetIconHandle("exportfeeds");
mi.ptszName = LPGENT("Export Feeds");
mi.pszService = MS_NEWSAGGR_EXPORTFEEDS;
- hService2[3] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hService2[3] = Menu_AddMainMenuItem(&mi);
// adding contact menu items
mi.position=-0x7FFFFFFA;
mi.icolibItem = GetIconHandle("checkfeed");
mi.ptszName = LPGENT("Check feed");
mi.pszService = MS_NEWSAGGR_CHECKFEED;
- hService2[4] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hService2[4] = Menu_AddContactMenuItem(&mi);
// adding contact menu items
mi.position=-0x7FFFFFFA;
//mi.icolibItem = GetIconHandle("checkfeed");
mi.ptszName = LPGENT("Change feed");
mi.pszService = MS_NEWSAGGR_CHANGEFEED;
- hService2[5] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hService2[5] = Menu_AddContactMenuItem(&mi);
ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
diff --git a/protocols/Quotes/Forex.cpp b/protocols/Quotes/Forex.cpp
index e0df9c34fd..62f2c6af28 100644
--- a/protocols/Quotes/Forex.cpp
+++ b/protocols/Quotes/Forex.cpp
@@ -86,7 +86,7 @@ namespace
mi.ptszName = _T("Quotes");
mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_ROOTPOPUP;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
- HGENMENU hMenuRoot = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenuRoot);
mi.ptszName = _T("Refresh All Quotes\\Rates");
@@ -95,7 +95,7 @@ namespace
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
mi.pszService = "Quotes/RefreshAll";
mi.hParentMenu = hMenuRoot;
- HGENMENU hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ HGENMENU hMenu = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenu);
HANDLE h = CreateServiceFunction(mi.pszService, QuotesMenu_RefreshAll);
g_ahServices.push_back(h);
@@ -105,7 +105,7 @@ namespace
//mi.position = 0x0FFFFFFF;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_CURRENCY_CONVERTER);
mi.pszService = "Quotes/CurrencyConverter";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_CurrencyConverter);
g_ahServices.push_back(h);
@@ -115,7 +115,7 @@ namespace
//mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_ROOTHANDLE;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_EXPORT);
mi.pszService = "Quotes/ExportAll";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_ExportAll);
g_ahServices.push_back(h);
@@ -124,13 +124,13 @@ namespace
//mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_ROOTHANDLE;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_IMPORT);
mi.pszService = "Quotes/ImportAll";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_ImportAll);
g_ahServices.push_back(h);
#endif
- bool bSubGroups = 1 == ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM);
+ bool bSubGroups = 1 == ServiceExists(MS_CLIST_MENUBUILDSUBGROUP);
h = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,Quotes_PrebuildContactMenu);
g_ahEvents.push_back(h);
@@ -148,7 +148,7 @@ namespace
mi.ptszName = const_cast<TCHAR*>(sProtocolName.c_str());//A2T(QUOTES_PROTOCOL_NAME);
mi.position = 0;
- hMenuRoot = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenuRoot = Menu_AddContactMenuItem(&mi);
}
mi.flags = CMIF_TCHAR;
@@ -163,7 +163,7 @@ namespace
mi.flags |= CMIF_ICONFROMICOLIB;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_REFRESH);
mi.pszService = "Quotes/RefreshContact";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddContactMenuItem(&mi);
g_hMenuRefresh = hMenu;
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_RefreshContact);
@@ -173,7 +173,7 @@ namespace
mi.popupPosition = 1;
mi.icolibItem = NULL;
mi.pszService = "Quotes/OpenLogFile";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddContactMenuItem(&mi);
g_hMenuOpenLogFile = hMenu;
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_OpenLogFile);
@@ -184,7 +184,7 @@ namespace
mi.popupPosition = 2;
mi.icolibItem = NULL;
mi.pszService = "Quotes/Chart";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddContactMenuItem(&mi);
g_hMenuChart = hMenu;
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_Chart);
@@ -199,7 +199,7 @@ namespace
#endif
mi.icolibItem = NULL;
mi.pszService = "Quotes/EditSettings";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddContactMenuItem(&mi);
g_hMenuEditSettings = hMenu;
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_EditSettings);
diff --git a/protocols/Twitter/proto.cpp b/protocols/Twitter/proto.cpp
index a3d9b24e07..6f23a185a4 100644
--- a/protocols/Twitter/proto.cpp
+++ b/protocols/Twitter/proto.cpp
@@ -341,8 +341,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.flags = CMIF_ICONFROMICOLIB|CMIF_ROOTHANDLE;
mi.position = 1001;
- HANDLE m_hMenuRoot = reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDSTATUSMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
+ HANDLE m_hMenuRoot = Menu_AddStatusMenuItem(&mi);
// TODO: Disable this menu item when offline
// "Send Tweet..."
@@ -351,9 +350,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.pszName = LPGEN("Send Tweet...");
mi.popupPosition = 200001;
mi.icolibItem = GetIconHandle("tweet");
- HANDLE m_hMenuBookmarks = reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDSTATUSMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
-
+ HANDLE m_hMenuBookmarks = Menu_AddStatusMenuItem(&mi);
return 0;
}
diff --git a/protocols/Twitter/theme.cpp b/protocols/Twitter/theme.cpp
index 5afb3b7e36..d6f0be38bb 100644
--- a/protocols/Twitter/theme.cpp
+++ b/protocols/Twitter/theme.cpp
@@ -143,7 +143,7 @@ void InitContactMenus()
mi.pszName = LPGEN("Reply...");
mi.pszService = "Twitter/ReplyToTweet";
g_hMenuEvts[1] = CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::ReplyToTweet>);
- g_hMenuItems[0] = reinterpret_cast<HANDLE>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hMenuItems[0] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006000;
mi.icolibItem = GetIconHandle("homepage");
@@ -151,8 +151,7 @@ void InitContactMenus()
mi.pszService = "Twitter/VisitHomepage";
g_hMenuEvts[2] = CreateServiceFunction(mi.pszService,
GlobalService<&TwitterProto::VisitHomepage>);
- g_hMenuItems[1] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hMenuItems[1] = Menu_AddContactMenuItem(&mi);
}
void UninitContactMenus()
diff --git a/protocols/Weather/weather_svcs.cpp b/protocols/Weather/weather_svcs.cpp
index 23cb105d3b..30559334b1 100644
--- a/protocols/Weather/weather_svcs.cpp
+++ b/protocols/Weather/weather_svcs.cpp
@@ -25,8 +25,8 @@ building/changing the weather menu items.
#include "weather.h"
-static int hEnableDisablePopupMenu;
-static int hEnableDisableMenu;
+static HGENMENU hEnableDisablePopupMenu;
+static HGENMENU hEnableDisableMenu;
static HANDLE hService[27];
@@ -354,49 +354,49 @@ void AddMenuItems(void)
mi.icolibItem = GetIconHandle("update");
mi.pszName="Update Weather";
mi.pszService = MS_WEATHER_UPDATE;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[16] = CreateServiceFunction(MS_WEATHER_REFRESH, UpdateSingleRemove);
mi.position=-0x7FFFFFF9;
mi.icolibItem = GetIconHandle("update2");
mi.pszName="Remove Old Data then Update";
mi.pszService = MS_WEATHER_REFRESH;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[17] = CreateServiceFunction(MS_WEATHER_BRIEF, BriefInfoSvc);
mi.position=-0x7FFFFFF8;
mi.icolibItem = GetIconHandle("brief");
mi.pszName="Brief Information";
mi.pszService = MS_WEATHER_BRIEF;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[18] = CreateServiceFunction(MS_WEATHER_COMPLETE, LoadForecast);
mi.position=-0x7FFFFFF7;
mi.icolibItem = GetIconHandle("read");
mi.pszName="Read Complete Forecast";
mi.pszService = MS_WEATHER_COMPLETE;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[19] = CreateServiceFunction(MS_WEATHER_MAP, WeatherMap);
mi.position=-0x7FFFFFF6;
mi.icolibItem = GetIconHandle("map");
mi.pszName="Weather Map";
mi.pszService = MS_WEATHER_MAP;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[20] = CreateServiceFunction(MS_WEATHER_LOG, ViewLog);
mi.position=-0x7FFFFFF5;
mi.icolibItem = GetIconHandle("log");
mi.pszName="View Log";
mi.pszService = MS_WEATHER_LOG;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[21] = CreateServiceFunction(MS_WEATHER_EDIT, EditSettings);
mi.position=-0x7FFFFFF4;
mi.icolibItem = GetIconHandle("edit");
mi.pszName="Edit Settings";
mi.pszService = MS_WEATHER_EDIT;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
// adding main menu items
mi.pszPopupName = "Weather";
@@ -407,7 +407,7 @@ void AddMenuItems(void)
mi.icolibItem = GetIconHandle("main");
mi.position=10100001;
mi.pszService = MS_WEATHER_ENABLED;
- hEnableDisableMenu = CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hEnableDisableMenu = Menu_AddMainMenuItem(&mi);
UpdateMenu(opt.AutoUpdate);
hService[23] = CreateServiceFunction(MS_WEATHER_UPDATEALL, UpdateAllInfo);
@@ -415,14 +415,14 @@ void AddMenuItems(void)
mi.icolibItem = GetIconHandle("update");
mi.pszName="Update All Weather";
mi.pszService = MS_WEATHER_UPDATEALL;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
hService[24] = CreateServiceFunction(MS_WEATHER_REFRESHALL, UpdateAllRemove);
mi.position=20100002;
mi.icolibItem = GetIconHandle("update2");
mi.pszName="Remove Old Data then Update All";
mi.pszService = MS_WEATHER_REFRESHALL;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// only run if popup service exists
if (ServiceExists(MS_POPUP_ADDPOPUP)) {
@@ -432,7 +432,7 @@ void AddMenuItems(void)
mi.position = 0;
mi.pszPopupName = "PopUps";
mi.pszService = WEATHERPROTONAME "/PopupMenu";
- hEnableDisablePopupMenu = CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hEnableDisablePopupMenu = Menu_AddMainMenuItem(&mi);
UpdatePopupMenu(opt.UsePopup);
}
@@ -443,6 +443,6 @@ void AddMenuItems(void)
mi.flags = 0;
mi.pszName = "Display in a frame";
mi.pszService = "Weather/mwin_menu";
- hMwinMenu = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hMwinMenu = Menu_AddContactMenuItem(&mi);
}
}
diff --git a/protocols/YAMN/main.cpp b/protocols/YAMN/main.cpp
index 6076a49c51..20a4adc20b 100644
--- a/protocols/YAMN/main.cpp
+++ b/protocols/YAMN/main.cpp
@@ -242,18 +242,18 @@ int SystemModulesLoaded(WPARAM, LPARAM)
mi.pszName = "Check &mail (All Account)";
mi.pszPopupName = NULL;//YAMN_DBMODULE;
mi.pszService = MS_YAMN_FORCECHECK;
- hMenuItemMain = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemMain = Menu_AddMainMenuItem(&mi);
mi.pszName = "Check &mail (This Account)";
mi.pszContactOwner = YAMN_DBMODULE;
mi.pszService = MS_YAMN_CLISTCONTEXT;
- hMenuItemCont = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemCont = Menu_AddContactMenuItem(&mi);
mi.icolibItem = g_GetIconHandle(4);
mi.pszName = "Launch application";
mi.pszContactOwner = YAMN_DBMODULE;
mi.pszService = MS_YAMN_CLISTCONTEXTAPP;
- hMenuItemContApp = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemContApp = Menu_AddContactMenuItem(&mi);
CheckMenuItems();
diff --git a/protocols/Yahoo/services.cpp b/protocols/Yahoo/services.cpp
index 8bf397ce95..a6e7fa5012 100644
--- a/protocols/Yahoo/services.cpp
+++ b/protocols/Yahoo/services.cpp
@@ -389,7 +389,7 @@ void CYahooProto::MenuMainInit( void )
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle( IDI_YAHOO );
mi.ptszName = m_tszUserName;
- hRoot = mainMenuRoot = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hRoot = mainMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
if ( mainMenuRoot )
@@ -408,7 +408,7 @@ void CYahooProto::MenuMainInit( void )
mi.icolibItem = GetIconHandle( IDI_SET_STATUS );
mi.pszName = LPGEN( "Set &Custom Status" );
- menuItemsAll[0] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi );
+ menuItemsAll[0] = Menu_AddProtoMenuItem(&mi);
// Edit My profile
lstrcpyA( tDest, YAHOO_EDIT_MY_PROFILE );
@@ -417,7 +417,7 @@ void CYahooProto::MenuMainInit( void )
mi.position = 290005;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
mi.pszName = LPGEN( "&Edit My Profile" );
- menuItemsAll[1] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[1] = Menu_AddProtoMenuItem(&mi);
// Show My profile
lstrcpyA( tDest, YAHOO_SHOW_MY_PROFILE );
@@ -426,7 +426,7 @@ void CYahooProto::MenuMainInit( void )
mi.position = 290006;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
mi.pszName = LPGEN( "&My Profile" );
- menuItemsAll[2] = ( HGENMENU ) YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[2] = Menu_AddProtoMenuItem(&mi);
// Show Yahoo mail
strcpy( tDest, YAHOO_YAHOO_MAIL );
@@ -435,7 +435,7 @@ void CYahooProto::MenuMainInit( void )
mi.position = 290010;
mi.icolibItem = GetIconHandle( IDI_INBOX );
mi.pszName = LPGEN( "&Yahoo Mail" );
- menuItemsAll[3] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[3] = Menu_AddProtoMenuItem(&mi);
// Show Address Book
strcpy( tDest, YAHOO_AB );
@@ -444,7 +444,7 @@ void CYahooProto::MenuMainInit( void )
mi.position = 290015;
mi.icolibItem = GetIconHandle( IDI_YAB );
mi.pszName = LPGEN( "&Address Book" );
- menuItemsAll[4] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[4] = Menu_AddProtoMenuItem(&mi);
// Show Calendar
strcpy( tDest, YAHOO_CALENDAR );
@@ -453,7 +453,7 @@ void CYahooProto::MenuMainInit( void )
mi.position = 290017;
mi.icolibItem = GetIconHandle( IDI_CALENDAR );
mi.pszName = LPGEN( "&Calendar" );
- menuItemsAll[5] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[5] = Menu_AddProtoMenuItem(&mi);
// Show Refresh
/*strcpy( tDest, YAHOO_REFRESH );
@@ -462,7 +462,7 @@ void CYahooProto::MenuMainInit( void )
mi.position = 500090015;
mi.icolibItem = GetIconHandle( IDI_REFRESH );
mi.pszName = LPGEN( "&Refresh" );
- menuItemsAll[6] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[6] = Menu_AddProtoMenuItem(&mi);
*/
}
@@ -485,7 +485,7 @@ void CYahooProto::MenuContactInit( void )
mi.position = -2000006000;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
mi.pszName = LPGEN( "&Show Profile" );
- hShowProfileMenuItem = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ hShowProfileMenuItem = Menu_AddContactMenuItem(&mi);
}