diff options
Diffstat (limited to 'protocols')
37 files changed, 198 insertions, 316 deletions
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 4b770d1fdf..45ca9a9694 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -869,45 +869,39 @@ int __cdecl CAimProto::UserIsTyping(HANDLE hContact, int type) int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
- switch (eventType)
- {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(0, 0);
-
-// case EV_PROTO_ONEXIT:
-// return OnPreShutdown(0, 0);
+ switch (eventType) {
+ case EV_PROTO_ONLOAD:
+ return OnModulesLoaded(0, 0);
- case EV_PROTO_ONMENU:
- InitMainMenus();
- break;
+ case EV_PROTO_ONMENU:
+ InitMainMenus();
+ break;
- case EV_PROTO_ONOPTIONS:
- return OnOptionsInit(wParam, lParam);
+ case EV_PROTO_ONOPTIONS:
+ return OnOptionsInit(wParam, lParam);
- case EV_PROTO_ONERASE:
+ case EV_PROTO_ONERASE:
{
char szDbsettings[64];
mir_snprintf(szDbsettings, sizeof(szDbsettings), "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
- break;
}
+ break;
- case EV_PROTO_ONRENAME:
- if (hMenuRoot)
- {
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- clmi.ptszName = m_tszUserName;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuRoot, (LPARAM)&clmi);
- }
- break;
+ case EV_PROTO_ONRENAME:
+ if (hMenuRoot) {
+ CLISTMENUITEM clmi = { sizeof(clmi) };
+ clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ clmi.ptszName = m_tszUserName;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuRoot, (LPARAM)&clmi);
+ }
+ break;
- case EV_PROTO_ONCONTACTDELETED:
- return OnContactDeleted(wParam, lParam);
+ case EV_PROTO_ONCONTACTDELETED:
+ return OnContactDeleted(wParam, lParam);
- case EV_PROTO_DBSETTINGSCHANGED:
- return OnDbSettingChanged(wParam, lParam);
+ case EV_PROTO_DBSETTINGSCHANGED:
+ return OnDbSettingChanged(wParam, lParam);
}
return 1;
}
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index e31cc5d664..c496c2482e 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -259,11 +259,8 @@ int CAimProto::OnPreBuildContactMenu(WPARAM wParam,LPARAM /*lParam*/) HANDLE hContact = (HANDLE)wParam;
bool isChatRoom = getByte(hContact, "ChatRoom", 0) != 0;
- CLISTMENUITEM mi;
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
-
//see if we should add the html away message context menu items
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE;
if (getWord(hContact, AIM_KEY_ST, ID_STATUS_OFFLINE) != ID_STATUS_AWAY || isChatRoom)
mi.flags |= CMIF_HIDDEN;
@@ -315,8 +312,7 @@ void CAimProto::InitMainMenus(void) //Do not put any services below HTML get away message!!!
char service_name[200];
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
HGENMENU hRoot = MO_GetProtoRootMenu(m_szModuleName);
if (hRoot == NULL) {
@@ -364,8 +360,7 @@ void CAimProto::InitContactMenus(void) //Do not put any services below HTML get away message!!!
char service_name[200];
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = service_name;
mi.pszContactOwner = m_szModuleName;
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 5d7c002398..021e8a6fcc 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -200,8 +200,7 @@ void UninitContactMenus() void EnableMenuItem(HANDLE hMenuItem, bool enable)
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
if (!enable)
clmi.flags |= CMIF_HIDDEN;
@@ -236,13 +235,11 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) strcpy(text,m_szModuleName);
char *tDest = text+strlen(text);
- HGENMENU hRoot;
CLISTMENUITEM mi = {sizeof(mi)};
mi.pszService = text;
- hRoot = MO_GetProtoRootMenu(m_szModuleName);
- if (hRoot == NULL)
- {
+ HGENMENU hRoot = MO_GetProtoRootMenu(m_szModuleName);
+ if (hRoot == NULL) {
mi.popupPosition = 500085000;
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | ( this->isOnline() ? 0 : CMIF_GRAYED );
@@ -311,8 +308,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) void FacebookProto::ToggleStatusMenuItems( BOOL bEnable )
{
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ CLISTMENUITEM clmi = {sizeof(clmi)};
clmi.flags = CMIM_FLAGS | (( bEnable ) ? 0 : CMIF_GRAYED);
CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )m_hMenuRoot, ( LPARAM )&clmi );
diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp index 26c81a165f..bf81e0f5dd 100644 --- a/protocols/GTalkExt/src/menu.cpp +++ b/protocols/GTalkExt/src/menu.cpp @@ -41,8 +41,7 @@ INT_PTR OpenMailboxMenuHandler(WPARAM wParam, LPARAM lParam) int OnPrebuildMenu(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM cmi = {0};
- cmi.cbSize = sizeof(cmi);
+ CLISTMENUITEM cmi = { sizeof(cmi) };
cmi.flags = CMIM_FLAGS;
if (!DBGetContactSettingByte((HANDLE)wParam, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0))
cmi.flags |= CMIF_HIDDEN;
@@ -61,8 +60,7 @@ BOOL InitMenus(BOOL init) extern HICON g_hPopupIcon;
- CLISTMENUITEM cmi = {0};
- cmi.cbSize = sizeof(cmi);
+ CLISTMENUITEM cmi = { sizeof(cmi) };
cmi.flags = CMIF_TCHAR;
cmi.hIcon = g_hPopupIcon;
cmi.ptszName = _T(OPEN_MAILBOX_ITEM_CAPTION);
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index a27b781590..2019872ee3 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -232,13 +232,11 @@ static GGPROTO* gg_getprotoinstance(HANDLE hContact) static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam)
{
const HANDLE hContact = (HANDLE)wParam;
- CLISTMENUITEM mi = {0};
GGPROTO* gg = gg_getprotoinstance(hContact);
-
if (gg == NULL)
return 0;
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIM_FLAGS | CMIF_ICONFROMICOLIB;
if ( db_get_dw(hContact, gg->m_szModuleName, GG_KEY_UIN, 0) == db_get_b(NULL, gg->m_szModuleName, GG_KEY_UIN, 0) ||
db_get_b(hContact, gg->m_szModuleName, "ChatRoom", 0) ||
@@ -246,7 +244,6 @@ static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam) mi.flags |= CMIF_HIDDEN;
mi.pszName = db_get_b(hContact, gg->m_szModuleName, GG_KEY_BLOCK, 0) ? LPGEN("&Unblock") : LPGEN("&Block");
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)gg->hBlockMenuItem, (LPARAM)&mi);
-
return 0;
}
@@ -267,14 +264,12 @@ INT_PTR GGPROTO::blockuser(WPARAM wParam, LPARAM lParam) #define GGS_BLOCKUSER "%s/BlockUser"
void GGPROTO::block_init()
{
- CLISTMENUITEM mi = {0};
char service[64];
-
- mi.cbSize = sizeof(mi);
- mi.flags = CMIF_ICONFROMICOLIB;
-
mir_snprintf(service, sizeof(service), GGS_BLOCKUSER, m_szModuleName);
createObjService(service, &GGPROTO::blockuser);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_ICONFROMICOLIB;
mi.position = -500050000;
mi.icolibItem = GetIconHandle(IDI_BLOCK);
mi.pszName = LPGEN("&Block");
@@ -298,12 +293,10 @@ void GGPROTO::block_uninit() // Menus initialization
void GGPROTO::menus_init()
{
- HGENMENU hGCRoot, hCLRoot, hRoot = MO_GetProtoRootMenu(m_szModuleName);
- CLISTMENUITEM mi = {0};
+ CLISTMENUITEM mi = { sizeof(mi) };
- mi.cbSize = sizeof(mi);
- if (hRoot == NULL)
- {
+ HGENMENU hGCRoot, hCLRoot, hRoot = MO_GetProtoRootMenu(m_szModuleName);
+ if (hRoot == NULL) {
mi.ptszName = m_tszUserName;
mi.position = 500090000;
mi.hParentMenu = HGENMENU_ROOT;
@@ -311,8 +304,7 @@ void GGPROTO::menus_init() mi.icolibItem = GetIconHandle(IDI_GG);
hGCRoot = hCLRoot = hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
- else
- {
+ else {
mi.hParentMenu = hRoot;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE | CMIF_TCHAR;
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 541b4832a6..8911110ccf 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -841,8 +841,7 @@ int GGPROTO::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) case EV_PROTO_ONRENAME:
if (hMenuRoot) {
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.ptszName = m_tszUserName;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuRoot, (LPARAM)&mi);
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 118a674439..c9e56fc777 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -61,12 +61,10 @@ int GGPROTO::gc_init() void GGPROTO::gc_menus_init(HGENMENU hRoot)
{
- if (gc_enabled)
- {
- CLISTMENUITEM mi = {0};
+ if (gc_enabled) {
char service[64];
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
mi.hParentMenu = hRoot;
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 22d1f7fe14..0400891ba7 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -68,15 +68,13 @@ int gg_img_remove(GGIMAGEDLGDATA *dat); int GGPROTO::img_init()
{
- CLISTMENUITEM mi = {0};
char service[64];
-
- mi.cbSize = sizeof(mi);
- mi.flags = CMIF_ICONFROMICOLIB;
-
- // Send image contact menu item
mir_snprintf(service, sizeof(service), GGS_SENDIMAGE, m_szModuleName);
createObjService(service, &GGPROTO::img_sendimg);
+
+ // Send image contact menu item
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_ICONFROMICOLIB;
mi.position = -2000010000;
mi.icolibItem = GetIconHandle(IDI_IMAGE);
mi.pszName = LPGEN("&Image");
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 1bb5725222..7fd3d73b59 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -597,16 +597,14 @@ INT_PTR GGPROTO::export_server(WPARAM wParam, LPARAM lParam) void GGPROTO::import_init(HGENMENU hRoot)
{
- CLISTMENUITEM mi = {0};
+ // Import from server item
char service[64];
+ mir_snprintf(service, sizeof(service), GGS_IMPORT_SERVER, m_szModuleName);
+ createObjService(service, &GGPROTO::import_server);
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
mi.hParentMenu = hRoot;
-
- // Import from server item
- mir_snprintf(service, sizeof(service), GGS_IMPORT_SERVER, m_szModuleName);
- createObjService(service, &GGPROTO::import_server);
mi.position = 2000500001;
mi.icolibItem = GetIconHandle(IDI_IMPORT_SERVER);
mi.pszName = LPGEN("Import List From &Server");
@@ -616,6 +614,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Import from textfile
mir_snprintf(service, sizeof(service), GGS_IMPORT_TEXT, m_szModuleName);
createObjService(service, &GGPROTO::import_text);
+
mi.position = 2000500002;
mi.icolibItem = GetIconHandle(IDI_IMPORT_TEXT);
mi.pszName = LPGEN("Import List From &Text File...");
@@ -625,6 +624,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Remove from server
mir_snprintf(service, sizeof(service), GGS_REMOVE_SERVER, m_szModuleName);
createObjService(service, &GGPROTO::remove_server);
+
mi.position = 2000500003;
mi.icolibItem = GetIconHandle(IDI_REMOVE_SERVER);
mi.pszName = LPGEN("&Remove List From Server");
@@ -634,6 +634,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Export to server
mir_snprintf(service, sizeof(service), GGS_EXPORT_SERVER, m_szModuleName);
createObjService(service, &GGPROTO::export_server);
+
mi.position = 2005000001;
mi.icolibItem = GetIconHandle(IDI_EXPORT_SERVER);
mi.pszName = LPGEN("Export List To &Server");
@@ -643,6 +644,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Export to textfile
mir_snprintf(service, sizeof(service), GGS_EXPORT_TEXT, m_szModuleName);
createObjService(service, &GGPROTO::export_text);
+
mi.position = 2005000002;
mi.icolibItem = GetIconHandle(IDI_EXPORT_TEXT);
mi.pszName = LPGEN("Export List To &Text File...");
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index 50a8a6ac54..7cc0c37215 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -44,7 +44,6 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam) list_t l = g_Instances;
GGPROTO *gg = NULL;
uin_t uin;
- CLISTMENUITEM mi = {0};
int items = 0;
if (list_count(l) == 0)
@@ -64,20 +63,18 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam) if (!uin)
return 1;
- for (mi.cbSize = sizeof(mi); l; l = l->next)
- {
+ for (; l; l = l->next) {
GGPROTO *gginst = (GGPROTO*)l->data;
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
- if (gginst->m_iStatus > ID_STATUS_OFFLINE)
- {
+ if (gginst->m_iStatus > ID_STATUS_OFFLINE) {
++items;
gg = (GGPROTO*)l->data;
mi.flags |= CMIM_ICON;
mi.hIcon = LoadSkinnedProtoIcon(gg->m_szModuleName, gg->m_iStatus);
}
- else
- {
+ else {
mi.flags |= CMIF_HIDDEN;
mi.hIcon = NULL;
}
@@ -87,8 +84,7 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam) Skin_ReleaseIcon(mi.hIcon);
}
- if (items > 1)
- {
+ if (items > 1) {
ListParam param = {0};
HMENU hMenu = CreatePopupMenu();
POINT pt;
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index 2888b5136f..48c460e432 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -425,19 +425,14 @@ BOOL GGPROTO::sessions_closedlg() void GGPROTO::sessions_menus_init(HGENMENU hRoot)
{
- CLISTMENUITEM mi = {0};
char service[64];
+ mir_snprintf(service, sizeof(service), GGS_CONCUR_SESS, m_szModuleName);
+ createObjService(service, &GGPROTO::sessions_view);
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE | CMIF_TCHAR;
mi.hParentMenu = hRoot;
-
- mir_snprintf(service, sizeof(service), GGS_CONCUR_SESS, m_szModuleName);
- createObjService(service, &GGPROTO::sessions_view);
- if (hMenuRoot)
- mi.position = 2050000001;
- else
- mi.position = 200003;
+ mi.position = (hMenuRoot) ? 2050000001 : 200003;
mi.icolibItem = GetIconHandle(IDI_SESSIONS);
mi.ptszName = LPGENT("Concurrent &sessions");
mi.pszService = service;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index b176a01f00..83bbd9689e 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -2331,12 +2331,11 @@ void CIrcProto::OnIrcDisconnected() memcpy( m_nick, m_pNick, sizeof( m_nick ));
setTString( "Nick", m_pNick );
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( clmi );
- clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuJoin, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuList, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuNick, ( LPARAM )&clmi );
+ 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 );
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -2362,12 +2361,11 @@ bool CIrcProto::DoOnConnect( const CIrcMessage* ) bPerformDone = true;
nickflag = true;
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( clmi );
- clmi.flags = CMIM_FLAGS;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuJoin, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuList, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuNick, ( LPARAM )&clmi );
+ 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 );
int Temp = m_iStatus;
m_iStatus = ID_STATUS_ONLINE;
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index eb40452d47..3331c9aa93 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -1058,11 +1058,10 @@ int __cdecl CIrcProto::OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM case EV_PROTO_ONRENAME:
if ( hMenuRoot ) {
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- clmi.ptszName = m_tszUserName;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuRoot, ( LPARAM )&clmi );
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.ptszName = m_tszUserName;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuRoot, ( LPARAM )&mi );
}
break;
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 25fcc1a971..1bde54a395 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -797,13 +797,11 @@ void CConnectPrefsDlg::OnApply() m_proto->m_oldStyleModes = m_oldStyle.GetState();
m_proto->m_useServer = m_useServer.GetState();
- CLISTMENUITEM clmi;
- memset( &clmi, 0, sizeof( clmi ));
- clmi.cbSize = sizeof( clmi );
- clmi.flags = CMIM_FLAGS;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS;
if ( !m_proto->m_useServer )
- clmi.flags |= CMIF_GRAYED;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )m_proto->hMenuServer, ( LPARAM )&clmi );
+ mi.flags |= CMIF_GRAYED;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )m_proto->hMenuServer, ( LPARAM )&mi );
m_proto->m_joinOnInvite = m_autoJoin.GetState();
m_proto->m_hideServerWindow = !m_showServer.GetState();
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 78aa938026..e1987e9e0f 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -28,8 +28,7 @@ void CIrcProto::InitMainMenus(void) char temp[ MAXMODULELABELLENGTH ];
char *d = temp + sprintf( temp, m_szModuleName );
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof( mi );
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = temp;
if ( bChatInstalled ) {
@@ -130,14 +129,13 @@ static INT_PTR IrcMenuIgnore(WPARAM wParam, LPARAM lParam) int IrcPrebuildContactMenu( WPARAM wParam, LPARAM lParam )
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_FLAGS | CMIF_HIDDEN;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuChanSettings, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuWhois, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuDisconnect, ( LPARAM )&clmi );
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuIgnore, ( LPARAM )&clmi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuChanSettings, ( LPARAM )&mi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuWhois, ( LPARAM )&mi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuDisconnect, ( LPARAM )&mi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuIgnore, ( LPARAM )&mi );
CIrcProto* ppro = IrcGetInstanceByHContact((HANDLE)wParam);
return (ppro) ? ppro->OnMenuPreBuild(wParam, lParam) : 0;
@@ -148,8 +146,7 @@ void InitContactMenus(void) char temp[MAXMODULELABELLENGTH];
char *d = temp + sprintf(temp, "IRC");
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = temp;
mi.flags = CMIF_ICONFROMICOLIB;
@@ -1014,47 +1011,46 @@ int __cdecl CIrcProto::OnMenuPreBuild(WPARAM wParam, LPARAM) if ( !hContact )
return 0;
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof( clmi );
- clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIM_ICON;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS | CMIM_NAME | CMIM_ICON;
char *szProto = ( char* ) CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) wParam, 0);
if ( szProto && !lstrcmpiA(szProto, m_szModuleName)) {
bool bIsOnline = getWord(hContact, "Status", ID_STATUS_OFFLINE)== ID_STATUS_OFFLINE ? false : true;
if ( getByte(hContact, "ChatRoom", 0) == GCW_CHATROOM) {
// context menu for chatrooms
- clmi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuChanSettings, ( LPARAM )&clmi );
+ mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuChanSettings, ( LPARAM )&mi );
}
else if ( !getTString( hContact, "Default", &dbv )) {
// context menu for contact
BYTE bDcc = getByte( hContact, "DCC", 0) ;
- clmi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuChanSettings, ( LPARAM )&clmi );
+ mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuChanSettings, ( LPARAM )&mi );
- clmi.flags = CMIM_FLAGS;
+ mi.flags = CMIM_FLAGS;
if ( bDcc ) {
// for DCC contact
- clmi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuDisconnect, ( LPARAM )&clmi );
+ mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuDisconnect, ( LPARAM )&mi );
}
else {
// for normal contact
- clmi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE;
+ mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE;
if ( !IsConnected())
- clmi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuWhois, ( LPARAM )&clmi );
+ mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuWhois, ( LPARAM )&mi );
if (bIsOnline) {
DBVARIANT dbv3;
if ( !getString( hContact, "Host", &dbv3)) {
if (dbv3.pszVal[0] == 0)
- clmi.flags = CMIM_FLAGS | CMIF_HIDDEN;
+ mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
DBFreeVariant( &dbv3 );
}
}
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuIgnore, ( LPARAM )&clmi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hUMenuIgnore, ( LPARAM )&mi );
}
DBFreeVariant( &dbv );
} }
diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp index 6694b6145b..a5d3d684e5 100644 --- a/protocols/IcqOscarJ/src/icq_menu.cpp +++ b/protocols/IcqOscarJ/src/icq_menu.cpp @@ -92,8 +92,7 @@ static INT_PTR IcqMenuHandleOpenProfile(WPARAM wParam, LPARAM lParam) static void sttEnableMenuItem( HANDLE hMenuItem, bool bEnable )
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
if ( !bEnable )
clmi.flags |= CMIF_HIDDEN;
@@ -126,8 +125,7 @@ void g_MenuInit(void) char str[MAXMODULELABELLENGTH], *pszDest = str + 3;
strcpy( str, "ICQ" );
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = str;
mi.flags = CMIF_ICONFROMICOLIB;
@@ -238,9 +236,7 @@ int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM) sttEnableMenuItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], m_bHideXStatusUI ? 0 : bXStatus != 0);
if (bXStatus && !m_bHideXStatusUI) {
- CLISTMENUITEM clmi = {0};
-
- clmi.cbSize = sizeof(clmi);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON;
if (bXStatus > 0 && bXStatus <= XSTATUS_COUNT)
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index f5b659d867..89b530e607 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -789,12 +789,10 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet)
{
- CLISTMENUITEM mi = {0};
BYTE bOldXStatus = getSettingByte(NULL, DBSETTING_XSTATUS_ID, 0);
- mi.cbSize = sizeof(mi);
-
if (!m_bHideXStatusUI) {
+ CLISTMENUITEM mi = { sizeof(mi) };
if (bOldXStatus <= XSTATUS_COUNT) {
mi.flags = CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hXStatusItems[bOldXStatus], (LPARAM)&mi);
@@ -854,8 +852,7 @@ INT_PTR CIcqProto::menuXStatus(WPARAM wParam,LPARAM lParam,LPARAM fParam) void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
{
- CLISTMENUITEM mi;
- int i = 0, len = strlennull(m_szModuleName);
+ int len = strlennull(m_szModuleName);
char srvFce[MAX_PATH + 64];
char szItem[MAX_PATH + 64];
int bXStatusMenuBuilt = 0;
@@ -873,12 +870,13 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) return;
null_snprintf(szItem, sizeof(szItem), Translate("%s Custom Status"), m_szModuleName);
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszPopupName = szItem;
mi.popupPosition = 500084000;
mi.position = 2000040000;
- for (i = 0; i <= XSTATUS_COUNT; i++) {
+ for (int i = 0; i <= XSTATUS_COUNT; i++) {
null_snprintf(srvFce, sizeof(srvFce), "%s/menuXStatus%d", m_szModuleName, i);
mi.position++;
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index 6ee98fa8bb..de4c5ff4be 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -147,9 +147,7 @@ extern "C" int __declspec(dllexport) Unload(void) void CListShowMenuItem(HANDLE hMenuItem, BYTE bShow)
{
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
if (bShow)
mi.flags = CMIM_FLAGS;
else
@@ -160,11 +158,8 @@ void CListShowMenuItem(HANDLE hMenuItem, BYTE bShow) static void CListSetMenuItemIcon(HANDLE hMenuItem, HICON hIcon)
{
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIM_ICON;
-
mi.hIcon = hIcon;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&mi);
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 1a490f1eb9..95c0ee8b36 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -166,8 +166,7 @@ static INT_PTR JabberMenuHandleDirectPresence(WPARAM wParam, LPARAM lParam, LPAR static void sttEnableMenuItem(HANDLE hMenuItem, BOOL bEnable)
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
if ( !bEnable)
clmi.flags |= CMIF_HIDDEN;
@@ -219,8 +218,7 @@ void g_MenuInit(void) //////////////////////////////////////////////////////////////////////////////////////
// Contact menu initialization
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
// "Request authorization"
mi.pszName = LPGEN("Request authorization");
@@ -389,9 +387,9 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) DBVARIANT dbv;
if ( !JGetStringT(hContact, bIsChatRoom?(char*)"ChatRoomID":(char*)"jid", &dbv)) {
db_free(&dbv);
- CLISTMENUITEM clmi = { 0 };
sttEnableMenuItem(g_hMenuConvert, TRUE);
- clmi.cbSize = sizeof(clmi);
+
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.pszName = bIsChatRoom ? (char *)LPGEN("&Convert to Contact") : (char *)LPGEN("&Convert to Chat Room");
clmi.flags = CMIM_NAME | CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hMenuConvert, (LPARAM)&clmi);
@@ -403,8 +401,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) sttEnableMenuItem(g_hMenuDirectPresence[0], TRUE);
for (int i = 0; i < SIZEOF(PresenceModeArray); ++i)
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON|CMIM_FLAGS;
clmi.hIcon = (HICON)LoadSkinnedProtoIcon(m_szModuleName, PresenceModeArray[i].mode);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hMenuDirectPresence[i+1], (LPARAM)&clmi);
@@ -446,8 +443,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) if (item->resourceCount >= 1) {
sttEnableMenuItem(g_hMenuResourcesRoot, TRUE);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON|CMIM_FLAGS;
mi.icolibItem = GetIconHandle(IDI_JABBER);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hMenuResourcesRoot, (LPARAM)&mi);
@@ -464,7 +460,6 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) size_t nModuleNameLength = strlen(text);
char* tDest = text + nModuleNameLength;
- mi.cbSize = sizeof(CLISTMENUITEM);
mi.flags = CMIF_CHILDPOPUP;
mi.position = 0;
mi.icolibItem = GetIconHandle(IDI_REQUEST);
@@ -482,8 +477,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) m_phMenuResourceItems[i] = Menu_AddContactMenuItem(&mi);
}
if (i < item->resourceCount) {
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME|CMIM_FLAGS | CMIF_CHILDPOPUP|CMIF_TCHAR;
if ((item->resourceMode == RSMODE_MANUAL) && (item->manualResource == i))
clmi.flags |= CMIF_CHECKED;
@@ -503,14 +497,11 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) else sttEnableMenuItem(m_phMenuResourceItems[i], FALSE);
}
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(CLISTMENUITEM);
-
- mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP|CMIF_ICONFROMICOLIB |
+ mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP | CMIF_ICONFROMICOLIB |
((item->resourceMode == RSMODE_LASTSEEN) ? CMIF_CHECKED : 0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hMenuResourcesActive, (LPARAM)&mi);
- mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP|CMIF_ICONFROMICOLIB |
+ mi.flags = CMIM_FLAGS | CMIF_CHILDPOPUP | CMIF_ICONFROMICOLIB |
((item->resourceMode == RSMODE_SERVER) ? CMIF_CHECKED : 0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hMenuResourcesServer, (LPARAM)&mi);
@@ -699,12 +690,11 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM wParam, LPARAM) void CJabberProto::MenuInit()
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(CLISTMENUITEM);
-
char text[ 200 ];
strcpy(text, m_szModuleName);
char* tDest = text + strlen(text);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
HGENMENU hJabberRoot = MO_GetProtoRootMenu(m_szModuleName);
@@ -894,11 +884,11 @@ void CJabberProto::UpdatePriorityMenu(short priority) return;
TCHAR szName[128];
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ mir_sntprintf(szName, SIZEOF(szName), TranslateT("Resource priority [%d]"), (int)priority);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR | CMIM_NAME;
mi.ptszName = szName;
- mir_sntprintf(szName, SIZEOF(szName), TranslateT("Resource priority [%d]"), (int)priority);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)m_hMenuPriorityRoot, (LPARAM)&mi);
m_priorityMenuVal = priority;
@@ -1024,8 +1014,7 @@ void CJabberProto::EnableMenuItems(BOOL bEnable) void CJabberProto::CheckMenuItems()
{
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
if ( !m_menuItemsStatus)
clmi.flags |= CMIF_GRAYED;
@@ -1280,8 +1269,7 @@ CJabberProto *JabberChooseInstance(bool bIsLink) return g_Instances[i];
}
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
int nItems = 0, lastItemId = 0;
for (int i = 0; i < g_Instances.getCount(); ++i) {
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 15a10b143b..c2ec58912e 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2250,8 +2250,7 @@ INT_PTR __cdecl CJabberProto::menuSetPrivacyList(WPARAM, LPARAM, LPARAM iList) void CJabberProto::BuildPrivacyMenu()
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 200005;
mi.pszContactOwner = m_szModuleName;
mi.icolibItem = GetIconHandle(IDI_AGENTS);
@@ -2285,8 +2284,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) i = 0;
char srvFce[MAX_PATH + 64], *svcName = srvFce+strlen(m_szModuleName);
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 2000040000;
mi.flags = CMIF_CHILDPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.hParentMenu = m_hPrivacyMenuRoot;
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 0e4417f961..e7e19cf2e2 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -475,8 +475,7 @@ void CPepGuiService::RebuildMenu() char szService[128];
mir_snprintf(szService, SIZEOF(szService), "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name);
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hParentMenu = hJabberRoot;
mi.pszService = szService;
mi.position = 200010;
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index f24ffb42f3..be4790745f 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -168,8 +168,7 @@ void CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMain strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
pszServiceFunctionName = szServiceFunction + strlen(m_szModuleName);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -1999901008;
HGENMENU (*fnAddFunc)(CLISTMENUITEM*);
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index eb6497f506..37e8e60f0c 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -1144,11 +1144,10 @@ DWORD CMraProto::CreateBlobFromContact(HANDLE hContact, LPWSTR lpwszRequestReaso void CMraProto::CListShowMenuItem(HANDLE hMenuItem, BOOL bShow)
{
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
- if (bShow == FALSE) mi.flags |= CMIF_HIDDEN;
+ if (bShow == FALSE)
+ mi.flags |= CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&mi);
}
@@ -1286,7 +1285,6 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP WCHAR szBuff[STATUS_TITLE_MAX+STATUS_DESC_MAX];
size_t dwBuffSize;
WNDPROC OldMessageEditProc;
- CLISTMENUITEM mi = {0};
SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)0);
@@ -1314,7 +1312,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP dat->ppro->mraSetStringExW(NULL, szValueName, szBuff, dwBuffSize);
dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff, dwBuffSize);
- mi.cbSize = sizeof(mi);
+ 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);
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 46175c5bfc..d221ec848b 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -661,8 +661,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM wParam, LPARAM lParam) WCHAR szItem[MAX_PATH+64], szStatusTitle[STATUS_TITLE_MAX+4];
mir_sntprintf(szItem, SIZEOF(szItem), L"%s Custom Status", m_tszUserName);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 2000060000;
mi.popupPosition = 500085000;
mi.ptszPopupName = szItem;
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index 1d8c813377..25ffe6447f 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -140,18 +140,16 @@ int CMsnProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) const HANDLE hContact = (HANDLE)wParam;
char szEmail[MSN_MAX_EMAIL_LEN];
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
-
- if (!MSN_IsMyContact(hContact)) return 0;
+ if ( !MSN_IsMyContact(hContact))
+ return 0;
bool isMe = MSN_IsMeByContact(hContact, szEmail);
- if (szEmail[0])
- {
+ if (szEmail[0]) {
int listId = Lists_GetMask(szEmail);
bool noChat = !(listId & LIST_FL) || isMe || getByte(hContact, "ChatRoom", 0);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIM_FLAGS | CMIF_ICONFROMICOLIB;
if (noChat) mi.flags |= CMIF_HIDDEN;
mi.pszName = (char*)((listId & LIST_BL) ? "&Unblock" : "&Block");
@@ -295,12 +293,10 @@ void CMsnProto::MsnInitMainMenu(void) strcpy(servicefunction, m_szModuleName);
char* tDest = servicefunction + strlen(servicefunction);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
HGENMENU hRoot = MO_GetProtoRootMenu(m_szModuleName);
- if (hRoot == NULL)
- {
+ if (hRoot == NULL) {
mi.popupPosition = 500085000;
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
@@ -308,8 +304,7 @@ void CMsnProto::MsnInitMainMenu(void) mi.ptszName = m_tszUserName;
hRoot = mainMenuRoot = Menu_AddProtoMenuItem(&mi);
}
- else
- {
+ else {
MsnRemoveMainMenus();
mainMenuRoot = NULL;
}
@@ -364,20 +359,16 @@ void CMsnProto::MsnRemoveMainMenus(void) void CMsnProto::MSN_EnableMenuItems(bool bEnable)
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
if (!bEnable)
mi.flags |= CMIF_GRAYED;
for (unsigned i=0; i < SIZEOF(menuItemsMain); i++)
- {
if (menuItemsMain[i] != NULL)
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)menuItemsMain[i], (LPARAM)&mi);
- }
- if (bEnable)
- {
+ if (bEnable) {
mi.flags = CMIM_FLAGS;
if (!emailEnabled) mi.flags |= CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)menuItemsMain[1], (LPARAM)&mi);
@@ -425,8 +416,7 @@ static INT_PTR MsnMenuSendHotmail(WPARAM wParam, LPARAM lParam) static void sttEnableMenuItem(HANDLE hMenuItem, bool bEnable)
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
if (!bEnable)
clmi.flags |= CMIF_HIDDEN;
@@ -457,8 +447,7 @@ void MSN_InitContactMenu(void) strcpy(servicefunction, "MSN");
char* tDest = servicefunction + strlen(servicefunction);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.pszService = servicefunction;
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 229aaf3673..1d92edf44f 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -1219,10 +1219,8 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l }
case EV_PROTO_ONRENAME:
- if (mainMenuRoot)
- {
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ if (mainMenuRoot) {
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
clmi.ptszName = m_tszUserName;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)mainMenuRoot, (LPARAM)&clmi);
diff --git a/protocols/Tlen/src/jabber_iqid.cpp b/protocols/Tlen/src/jabber_iqid.cpp index 49df5a88be..3cf0e0f2ae 100644 --- a/protocols/Tlen/src/jabber_iqid.cpp +++ b/protocols/Tlen/src/jabber_iqid.cpp @@ -241,14 +241,11 @@ void JabberIqResultRoster(TlenProtocol *proto, XmlNode *iqNode) }
///////////////////////////////////////
{
- CLISTMENUITEM clmi;
- memset(&clmi, 0, sizeof(CLISTMENUITEM));
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto->hMenuMUC, (LPARAM) &clmi);
- if (proto->hMenuChats != NULL){
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto->hMenuChats, (LPARAM) &clmi);
- }
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto->hMenuMUC, (LPARAM) &mi);
+ if (proto->hMenuChats != NULL)
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto->hMenuChats, (LPARAM)&mi);
}
proto->isOnline = TRUE;
diff --git a/protocols/Tlen/src/jabber_svc.cpp b/protocols/Tlen/src/jabber_svc.cpp index 0c4ba468e5..450446f640 100644 --- a/protocols/Tlen/src/jabber_svc.cpp +++ b/protocols/Tlen/src/jabber_svc.cpp @@ -1213,11 +1213,10 @@ int __cdecl TlenProtocol::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPAR case EV_PROTO_ONEXIT: return TlenPreShutdown(this, 0, 0 );
case EV_PROTO_ONRENAME:
{
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof( CLISTMENUITEM );
- clmi.flags = CMIM_NAME | CMIF_TCHAR;
- clmi.ptszName = m_tszUserName;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuRoot, ( LPARAM )&clmi );
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_NAME | CMIF_TCHAR;
+ mi.ptszName = m_tszUserName;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuRoot, ( LPARAM )&mi );
/* FIXME: Rename network user as well */
}
}
diff --git a/protocols/Tlen/src/jabber_thread.cpp b/protocols/Tlen/src/jabber_thread.cpp index 291d1208a5..6daf6ce0f3 100644 --- a/protocols/Tlen/src/jabber_thread.cpp +++ b/protocols/Tlen/src/jabber_thread.cpp @@ -114,11 +114,9 @@ void __cdecl JabberServerThread(ThreadData *info) int numRetry;
int reconnectTime;
char *str;
- CLISTMENUITEM clmi;
int loginErr = 0;
JabberLog(info->proto, "Thread started");
-
// Normal server connection, we will fetch all connection parameters
// e.g. username, password, etc. from the database.
@@ -353,13 +351,11 @@ void __cdecl JabberServerThread(ThreadData *info) info->proto->isOnline = FALSE;
info->proto->isConnected = FALSE;
- memset(&clmi, 0, sizeof(CLISTMENUITEM));
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->proto->hMenuMUC, (LPARAM) &clmi);
- if (info->proto->hMenuChats != NULL){
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->proto->hMenuChats, (LPARAM) &clmi);
- }
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS | CMIF_GRAYED;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->proto->hMenuMUC, (LPARAM) &mi);
+ if (info->proto->hMenuChats != NULL)
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->proto->hMenuChats, (LPARAM) &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 d8a0a00652..05c76957f5 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -156,10 +156,9 @@ int TlenPrebuildContactMenu(void *ptr, WPARAM wParam, LPARAM lParam) {
HANDLE hContact;
DBVARIANT dbv;
- CLISTMENUITEM clmi = {0};
+ CLISTMENUITEM clmi = { sizeof(clmi) };
JABBER_LIST_ITEM *item;
TlenProtocol *proto = (TlenProtocol *)ptr;
- clmi.cbSize = sizeof(CLISTMENUITEM);
if ((hContact=(HANDLE) wParam) != NULL && proto->isOnline) {
if (!DBGetContactSetting(hContact, proto->m_szModuleName, "jid", &dbv)) {
if ((item=JabberListGetItemPtr(proto, LIST_ROSTER, dbv.pszVal)) != NULL) {
@@ -353,13 +352,9 @@ int TlenPreShutdown(void *ptr, WPARAM wParam, LPARAM lParam) static void initMenuItems(TlenProtocol *proto)
{
-
char text[_MAX_PATH];
- CLISTMENUITEM mi, clmi;
- memset(&mi, 0, sizeof(CLISTMENUITEM));
- mi.cbSize = sizeof(CLISTMENUITEM);
- memset(&clmi, 0, sizeof(CLISTMENUITEM));
- clmi.cbSize = sizeof(CLISTMENUITEM);
+
+ CLISTMENUITEM mi = { sizeof(mi) }, clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
mi.pszContactOwner = proto->m_szModuleName;
@@ -411,7 +406,6 @@ static void initMenuItems(TlenProtocol *proto) mi.hParentMenu = NULL;
-
// "Send picture"
sprintf(text, "%s/SendPicture", proto->m_szModuleName);
CreateServiceFunction_Ex(text, proto, TlenContactMenuHandleSendPicture);
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index bf13f01c76..5cfb37a568 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -322,11 +322,11 @@ int TwitterProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) if (hRoot == NULL)
return 0;
- CLISTMENUITEM mi = {sizeof(mi)};
-
char text[200];
strcpy(text,m_szModuleName);
char *tDest = text+strlen(text);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
mi.hParentMenu = hRoot;
diff --git a/protocols/Xfire/src/Xfire_game.cpp b/protocols/Xfire/src/Xfire_game.cpp index 835c8e6aa0..196584b580 100644 --- a/protocols/Xfire/src/Xfire_game.cpp +++ b/protocols/Xfire/src/Xfire_game.cpp @@ -431,19 +431,17 @@ void Xfire_game::writeToDB(unsigned dbid) //erzeugt ein menüpunkt
void Xfire_game::createMenuitem(unsigned int pos,int dbid)
{
- CLISTMENUITEM mi = { 0 };
char servicefunction[100];
+ strcpy(servicefunction, protocolname);
+ strcat(servicefunction, "StartGame%d");
if(dbid<0)
dbid=pos;
- memset(&mi,0,sizeof(CLISTMENUITEM));
- strcpy(servicefunction, protocolname);
- strcat(servicefunction, "StartGame%d");
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.popupPosition = 500084000;
mi.pszPopupName = Translate("Start game");
mi.pszContactOwner=protocolname;
- mi.cbSize = sizeof( mi );
sprintf(temp,servicefunction,this->id);
//wenn die servicefunktion schon exisitert vernichten, hehe
@@ -475,13 +473,12 @@ void Xfire_game::refreshMenuitem() {
if(menuhandle!=NULL)
{
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof( clmi );
- clmi.flags = CMIM_FLAGS;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS;
if(this->notinstartmenu)
- clmi.flags|= CMIF_HIDDEN;
+ mi.flags|= CMIF_HIDDEN;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )menuhandle, ( LPARAM )&clmi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )menuhandle, ( LPARAM )&mi );
}
}
\ No newline at end of file diff --git a/protocols/Xfire/src/Xfire_gamelist.cpp b/protocols/Xfire/src/Xfire_gamelist.cpp index 3496a2e3f1..c4fb12ee20 100644 --- a/protocols/Xfire/src/Xfire_gamelist.cpp +++ b/protocols/Xfire/src/Xfire_gamelist.cpp @@ -246,16 +246,14 @@ void Xfire_gamelist::clearGamelist() { //erstellt ein dummyeintrag
void Xfire_gamelist::createDummyMenuItem()
{
- CLISTMENUITEM midummy = { 0 };
- midummy.cbSize = sizeof( midummy );
- midummy.position = 500090001;
- midummy.pszName = Translate("Please wait ...");
- //midummy.flags = CMIF_GRAYED; geht nicht bei 0.8.1
- midummy.hIcon = LoadIcon(hinstance,MAKEINTRESOURCE(ID_OP));
- midummy.popupPosition = 500084000;
- midummy.pszPopupName = Translate("Start game");
- midummy.pszContactOwner=protocolname;
- dummymenuitem=Menu_AddMainMenuItem(&midummy);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 500090001;
+ mi.pszName = Translate("Please wait ...");
+ mi.hIcon = LoadIcon(hinstance,MAKEINTRESOURCE(ID_OP));
+ mi.popupPosition = 500084000;
+ mi.pszPopupName = Translate("Start game");
+ mi.pszContactOwner=protocolname;
+ dummymenuitem = Menu_AddMainMenuItem(&mi);
}
//entfernt dummymenueintrag
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 9b6af47d47..2add029050 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -1215,9 +1215,7 @@ extern "C" __declspec(dllexport) int Load(void) CreateDirectory(AvatarsFolder,NULL);
//erweiterte Kontextmenüpunkte
- CLISTMENUITEM mi = { 0 };
- memset(&mi,0,sizeof(CLISTMENUITEM));
- mi.cbSize = sizeof( mi );
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszPopupName = protocolname;
//gotoprofilemenüpunkt
@@ -2256,6 +2254,7 @@ static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam) int RebuildContactMenu( WPARAM wParam, LPARAM lParam )
{
+ // !!!!!!!! check it later
CLISTMENUITEM clmi = { 0 };
clmi.cbSize = sizeof( clmi );
CLISTMENUITEM clmi2 = { 0 };
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp index 8e9517a036..e7d1137c30 100644 --- a/protocols/Xfire/src/searching4games.cpp +++ b/protocols/Xfire/src/searching4games.cpp @@ -149,7 +149,6 @@ void Scan4Games( LPVOID lparam ) BOOL multiexe=FALSE;
BOOL somethingfound=TRUE;
int i3=0;
- CLISTMENUITEM mi = { 0 };
DWORD gpps=1;
DWORD last_gpps=0;
static BOOL searching=FALSE;
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 6d42641ec4..124048995f 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -755,11 +755,10 @@ int __cdecl CYahooProto::OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARA case EV_PROTO_ONRENAME:
if ( mainMenuRoot ) {
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- clmi.ptszName = m_tszUserName;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )mainMenuRoot, ( LPARAM )&clmi );
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.ptszName = m_tszUserName;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)mainMenuRoot, (LPARAM)&mi );
}
break;
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index 40166100ed..641b4e609c 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -378,8 +378,7 @@ void CYahooProto::MenuMainInit( void ) lstrcpyA( servicefunction, m_szModuleName );
char* tDest = servicefunction + lstrlenA( servicefunction );
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof( mi );
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = servicefunction;
HGENMENU hRoot = MO_GetProtoRootMenu( m_szModuleName );
@@ -480,8 +479,7 @@ void CYahooProto::MenuContactInit( void ) lstrcpyA( servicefunction, m_szModuleName );
char* tDest = servicefunction + lstrlenA( servicefunction );
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof( mi );
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.pszService = servicefunction;
mi.pszContactOwner = m_szModuleName;
@@ -507,24 +505,19 @@ void CYahooProto::MenuUninit( void ) int __cdecl CYahooProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
{
- const HANDLE hContact = (HANDLE)wParam;
-
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
-
+ const HANDLE hContact = (HANDLE)wParam;
if (!IsMyContact(hContact)) {
DebugLog("[OnPrebuildContactMenu] Not a Yahoo Contact!!!");
return 0;
}
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
-
- if (GetWord( hContact, "yprotoid", 0) != 0)
+ if (GetWord( hContact, "yprotoid", 0) != 0)
mi.flags |= CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowProfileMenuItem, (LPARAM)&mi);
- return 0;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowProfileMenuItem, (LPARAM)&mi);
+ return 0;
}
|