summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
commit30707c980d1560b358dbf2671a4d2a26a1e8173c (patch)
tree74aee5adaaac976e1398274ca64c5461a60f1feb /plugins
parent335ec43a4bfdcbbd0b2257037f1f3e0553d89076 (diff)
various menu initialization quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AddContactPlus/src/main.cpp8
-rw-r--r--plugins/Alarms/src/frame.cpp5
-rw-r--r--plugins/Alarms/src/options.cpp3
-rw-r--r--plugins/AuthState/src/main.cpp9
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp33
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp7
-rw-r--r--plugins/AvatarHistory/src/icolib.cpp4
-rw-r--r--plugins/BasicHistory/src/BasicHistory.cpp13
-rw-r--r--plugins/Boltun/src/boltun.cpp20
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp7
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp9
-rw-r--r--plugins/ClientChangeNotify/src/ClientChangeNotify.cpp7
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_cluiframes.cpp40
-rw-r--r--plugins/Clist_modern/src/modern_groupmenu.cpp88
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp26
-rw-r--r--plugins/Clist_mw/src/clisttray.cpp5
-rw-r--r--plugins/Clist_mw/src/groupmenu.cpp42
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp36
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp54
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/movetogroup.cpp39
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp31
-rw-r--r--plugins/Console/src/Console.cpp8
-rw-r--r--plugins/ContactsPlus/src/main.cpp82
-rw-r--r--plugins/CrashDumper/src/crshdmp.cpp5
-rw-r--r--plugins/CyrTranslit/src/MirandaContact.cpp3
-rw-r--r--plugins/DbEditorPP/src/main.cpp3
-rw-r--r--plugins/DbEditorPP/src/options.cpp7
-rw-r--r--plugins/Db_autobackups/src/main.cpp3
-rw-r--r--plugins/Dbx_mmap_SA/src/dialogs.cpp36
-rw-r--r--plugins/FTPFileYM/src/ftpfile.cpp16
-rw-r--r--plugins/FavContacts/src/main.cpp3
-rw-r--r--plugins/FileAsMessage/src/main.cpp1
-rw-r--r--plugins/FloatingContacts/src/main.cpp21
-rw-r--r--plugins/Gender/src/main.cpp33
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist.cpp18
-rw-r--r--plugins/Import/src/main.cpp4
-rw-r--r--plugins/LangMan/src/main.cpp3
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp12
-rw-r--r--plugins/MenuItemEx/src/main.cpp18
-rw-r--r--plugins/MetaContacts/src/icons.cpp42
-rw-r--r--plugins/MetaContacts/src/meta_menu.cpp3
-rw-r--r--plugins/MetaContacts/src/meta_services.cpp6
-rw-r--r--plugins/MirOTR/MirOTR/src/svcs_menu.cpp12
-rwxr-xr-xplugins/Msg_Export/src/main.cpp4
-rw-r--r--plugins/MyDetails/src/frame.cpp23
-rw-r--r--plugins/MyDetails/src/mydetails.cpp5
-rw-r--r--plugins/NewEventNotify/src/menuitem.cpp30
-rw-r--r--plugins/NewEventNotify/src/options.cpp4
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp6
-rwxr-xr-xplugins/New_GPG/src/init.cpp4
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp8
-rw-r--r--plugins/NewsAggregator/Src/Menus.cpp3
-rw-r--r--plugins/NoHistory/src/dllmain.cpp7
-rw-r--r--plugins/NotesAndReminders/src/main.cpp128
-rw-r--r--plugins/Nudge/src/main.cpp3
-rw-r--r--plugins/Nudge/src/nudge.cpp5
-rw-r--r--plugins/OpenFolder/src/openFolder.cpp3
-rw-r--r--plugins/PackUpdater/Src/PackUpdater.cpp7
-rw-r--r--plugins/PasteIt/src/PasteIt.cpp22
-rw-r--r--plugins/Ping/src/menu.cpp109
-rw-r--r--plugins/Ping/src/pingthread.cpp4
-rw-r--r--plugins/PluginUpdater/src/PluginUpdater.cpp3
-rw-r--r--plugins/Popup/src/main.cpp15
-rw-r--r--plugins/ProfileManager/src/pmanagerEx.cpp7
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp4
-rw-r--r--plugins/Quotes/src/Forex.cpp6
-rw-r--r--plugins/Quotes/src/QuoteInfoDlg.cpp7
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp7
-rw-r--r--plugins/Scriver/src/chat/clist.cpp3
-rw-r--r--plugins/Scriver/src/chat/main.cpp2
-rw-r--r--plugins/Scriver/src/msgs.cpp8
-rw-r--r--plugins/SecureIM/src/main.cpp33
-rw-r--r--plugins/SecureIM/src/svcs_clist.cpp53
-rw-r--r--plugins/SendScreenshotPlus/src/Main.cpp10
-rw-r--r--plugins/Sessions/Src/Main.cpp4
-rw-r--r--plugins/SimpleAR/src/Main.cpp34
-rw-r--r--plugins/SimpleStatusMsg/src/awaymsg.cpp7
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp3
-rw-r--r--plugins/SmileyAdd/src/main.cpp3
-rw-r--r--plugins/SmileyAdd/src/services.cpp24
-rw-r--r--plugins/SplashScreen/src/main.cpp5
-rw-r--r--plugins/StatusPlugins/StartupStatus/profiles.cpp4
-rwxr-xr-xplugins/StopSpamMod/src/init.cpp6
-rw-r--r--plugins/StopSpamPlus/src/stopspam.cpp6
-rw-r--r--plugins/TabSRMM/src/chat/clist.cpp3
-rw-r--r--plugins/TabSRMM/src/chat/services.cpp3
-rw-r--r--plugins/TabSRMM/src/globals.cpp29
-rw-r--r--plugins/TabSRMM/src/mim.cpp8
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp10
-rw-r--r--plugins/TrafficCounter/src/TrafficCounter.c5
-rw-r--r--plugins/UserGuide/src/main.cpp6
-rw-r--r--plugins/UserInfoEx/src/mir_menuitems.cpp24
-rw-r--r--plugins/UserInfoEx/src/svc_email.cpp18
-rw-r--r--plugins/UserInfoEx/src/svc_homepage.cpp14
-rw-r--r--plugins/UserInfoEx/src/svc_refreshci.cpp8
-rw-r--r--plugins/VersionInfo/src/main.cpp3
-rw-r--r--plugins/Weather/src/weather_mwin.cpp4
-rw-r--r--plugins/WhenWasIt/src/hooked_events.cpp1
-rw-r--r--plugins/WhoUsesMyFiles/src/wumfplug.c52
-rw-r--r--plugins/YAMN/src/main.cpp6
-rw-r--r--plugins/YAPP/src/services.cpp6
-rw-r--r--plugins/ZeroNotification/src/main.cpp35
105 files changed, 602 insertions, 1104 deletions
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp
index 23d349ade8..6f4c69cab3 100644
--- a/plugins/AddContactPlus/src/main.cpp
+++ b/plugins/AddContactPlus/src/main.cpp
@@ -70,12 +70,10 @@ INT_PTR AddContactPlusDialog(WPARAM, LPARAM)
static int OnIconsChanged(WPARAM, LPARAM)
{
- CLISTMENUITEM mi = {0};
-
if (!hMainMenuItem)
return 0;
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.icolibItem = hIconLibItem;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMainMenuItem, (LPARAM)&mi);
@@ -99,12 +97,10 @@ static int OnAccListChanged(WPARAM, LPARAM)
if (iAccCount)
{
- CLISTMENUITEM mi = {0};
-
if (hMainMenuItem)
return 0;
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 500020001;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.icolibItem = hIconLibItem;
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp
index cdcb4b755a..b3937eb85c 100644
--- a/plugins/Alarms/src/frame.cpp
+++ b/plugins/Alarms/src/frame.cpp
@@ -453,8 +453,7 @@ int ReloadFont(WPARAM wParam, LPARAM lParam)
void FixMainMenu()
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
if (options.hide_with_clist || options.auto_showhide)
mi.flags = CMIM_FLAGS | CMIF_GRAYED;
@@ -555,7 +554,7 @@ int CreateFrame()
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ALL;
- mi.hIcon=hIconMenuShowHide;
+ mi.hIcon = hIconMenuShowHide;
mi.pszName = LPGEN("Show Reminders");
mi.pszService = MODULE "/ShowHideReminders";
mi.pszPopupName = LPGEN("Alarms");
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp
index 2c1bb60950..9670795a4e 100644
--- a/plugins/Alarms/src/options.cpp
+++ b/plugins/Alarms/src/options.cpp
@@ -692,8 +692,7 @@ void AddMenuItem()
{
if (hMainMenuItem) return;
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ALL;
mi.hIcon = hIconMenuSet;
mi.pszName = "Set Alarm";
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp
index b65de865f4..9a4ff8ae2d 100644
--- a/plugins/AuthState/src/main.cpp
+++ b/plugins/AuthState/src/main.cpp
@@ -143,10 +143,10 @@ INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam)
int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
char *proto = GetContactProto((HANDLE)wParam);
- if (!proto) return 0;
+ if (!proto)
+ return 0;
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
if (!DBGetContactSettingByte((HANDLE)wParam,proto,"Auth",0) && !DBGetContactSettingByte((HANDLE)wParam,proto,"Grant",0) && DBGetContactSettingWord((HANDLE)wParam,proto,"ServerId",0))
mi.flags = CMIF_TCHAR | CMIM_FLAGS | CMIF_HIDDEN;
@@ -252,8 +252,7 @@ extern "C" int __declspec(dllexport) Load(void)
{
hAuthMenuSelected = CreateServiceFunction("AuthState/MenuItem", onAuthMenuSelected);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -1999901005;
mi.flags = CMIF_TCHAR;
mi.ptszName = _T("Enable AuthState icons");
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index 2131c768aa..4c980117f2 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -439,31 +439,28 @@ extern HANDLE hActiveIcon,hInactiveIcon;
void SetShutdownMenuItem(BOOL fActive)
{
- CLISTMENUITEM cmi;
- ZeroMemory(&cmi,sizeof(cmi));
- cmi.cbSize=sizeof(cmi);
-
/* main menu */
- cmi.position=2001090000;
- cmi.icolibItem=fActive?hActiveIcon:hInactiveIcon;
- cmi.ptszName=fActive?_T("Stop automatic &shutdown"):_T("Automatic &shutdown..."); /* autotranslated */
- cmi.pszService="AutoShutdown/MenuCommand";
- cmi.flags=CMIF_TCHAR|CMIF_ICONFROMICOLIB;
- if(hMainMenuItem!=NULL) {
- cmi.flags|=CMIM_NAME|CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMainMenuItem,(LPARAM)&cmi);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 2001090000;
+ mi.icolibItem = fActive?hActiveIcon:hInactiveIcon;
+ mi.ptszName = fActive?_T("Stop automatic &shutdown"):_T("Automatic &shutdown..."); /* autotranslated */
+ mi.pszService = "AutoShutdown/MenuCommand";
+ mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB;
+ if (hMainMenuItem != NULL) {
+ mi.flags |= CMIM_NAME|CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMainMenuItem,(LPARAM)&mi);
}
- else hMainMenuItem = Menu_AddMainMenuItem(&cmi);
+ else hMainMenuItem = Menu_AddMainMenuItem(&mi);
/* tray menu */
- cmi.position=899999;
+ mi.position = 899999;
if(hTrayMenuItem!=NULL) {
- cmi.flags|=CMIM_NAME|CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hTrayMenuItem,(LPARAM)&cmi);
+ mi.flags|=CMIM_NAME|CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hTrayMenuItem,(LPARAM)&mi);
}
- else hTrayMenuItem = Menu_AddTrayMenuItem(&cmi);
+ else hTrayMenuItem = Menu_AddTrayMenuItem(&mi);
- Skin_ReleaseIcon(cmi.hIcon);
+ Skin_ReleaseIcon(mi.hIcon);
}
static INT_PTR MenuItemCommand(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index f499fcb8ee..de344a5929 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -526,8 +526,7 @@ int CleanupAvatarPic(HWND hwnd)
int PreBuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(clmi);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
char *proto = GetContactProto((HANDLE)wParam);
@@ -541,11 +540,9 @@ int PreBuildContactMenu(WPARAM wParam,LPARAM lParam)
void InitMenuItem()
{
- CLISTMENUITEM mi = {0};
-
hServices[2] = CreateServiceFunction(MS_AVATARHISTORY_SHOWDIALOG, ShowDialogSvc);
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.ptszName = LPGENT("View Avatar History");
mi.flags = CMIF_TCHAR;
mi.position = 1000090010;
diff --git a/plugins/AvatarHistory/src/icolib.cpp b/plugins/AvatarHistory/src/icolib.cpp
index acc5d642c3..508c683686 100644
--- a/plugins/AvatarHistory/src/icolib.cpp
+++ b/plugins/AvatarHistory/src/icolib.cpp
@@ -46,9 +46,7 @@ static void ReleaseIconEx(HICON hIcon)
static void IcoLibUpdateMenus()
{
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIM_ICON;
mi.hIcon = createDefaultOverlayedIcon(FALSE);
CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenu, ( LPARAM )&mi );
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp
index fe7c4d9f68..41e666436a 100644
--- a/plugins/BasicHistory/src/BasicHistory.cpp
+++ b/plugins/BasicHistory/src/BasicHistory.cpp
@@ -82,8 +82,8 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
int count = EventList::GetContactMessageNumber((HANDLE)wParam);
bool isInList = HistoryWindow::IsInList(GetForegroundWindow());
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
if (!count) mi.flags |= CMIF_HIDDEN;
@@ -114,8 +114,7 @@ int ToolbarModuleLoaded(WPARAM wParam,LPARAM lParam)
void InitMenuItems()
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1000090000;
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_HISTORY);
@@ -141,8 +140,7 @@ void InitTaskMenuItems()
{
if(Options::instance->taskOptions.size() > 0)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
if(hTaskMainMenu == NULL)
{
mi.position = 500060005;
@@ -189,8 +187,7 @@ void InitTaskMenuItems()
}
else if(hTaskMainMenu != NULL)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_ROOTPOPUP | CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hTaskMainMenu, (LPARAM)&mi);
}
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp
index 25968b15a7..42149db57a 100644
--- a/plugins/Boltun/src/boltun.cpp
+++ b/plugins/Boltun/src/boltun.cpp
@@ -587,14 +587,12 @@ static INT_PTR ContactClickStartChatting(WPARAM wParam, LPARAM lParam)
static int MessagePrebuild(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM clmi;
- HANDLE hContact = (HANDLE)wParam;
+ CLISTMENUITEM clmi = { sizeof(clmi) };
+ HANDLE hContact = (HANDLE)wParam;
if (!blInit || (DBGetContactSettingByte(hContact,"CList","NotOnList",0) == 1))
{
- ZeroMemory(&clmi, sizeof(clmi));
- clmi.cbSize = sizeof(clmi);
- clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
+ clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemAutoChat, (LPARAM)&clmi);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemNotToChat, (LPARAM)&clmi);
@@ -603,8 +601,7 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam)
{
BOOL boltunautochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
BOOL boltunnottochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
- ZeroMemory(&clmi, sizeof(clmi));
- clmi.cbSize = sizeof(clmi);
+
clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunautochat ? CMIF_CHECKED : 0);
clmi.hIcon = LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE((boltunautochat ? IDI_TICK : IDI_NOTICK)));
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemAutoChat, (LPARAM)&clmi);
@@ -650,14 +647,8 @@ extern "C" int __declspec(dllexport) Load(void)
CreateServiceFunction(SERV_CONTACT_NOT_TO_CHAT, ContactClickNotToChat);
CreateServiceFunction(SERV_CONTACT_START_CHATTING, ContactClickStartChatting);
{
- CLISTMENUITEM mi;
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -50010002; //TODO: check the warning
- mi.flags = 0;
- mi.hIcon = NULL;
- mi.pszContactOwner = NULL;
mi.pszName = BOLTUN_AUTO_CHAT;
mi.pszService = SERV_CONTACT_AUTO_CHAT;
hMenuItemAutoChat = Menu_AddContactMenuItem(&mi);
@@ -674,6 +665,7 @@ extern "C" int __declspec(dllexport) Load(void)
mi.pszService = SERV_CONTACT_START_CHATTING;
hMenuItemStartChatting = Menu_AddContactMenuItem(&mi);
}
+
int line;
blInit = LoadMind(Config.MindFileName, line);
if (!blInit)
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index ac6b4c457c..fc198b6820 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -618,11 +618,10 @@ static int GenMenuInit(WPARAM wParam, LPARAM lParam) // Modify menu item text be
{
if (g_hMenuItem)
{
- CLISTMENUITEM mi = {0};
TCHAR buf[128] = {0};
mir_sntprintf(buf, SIZEOF(buf), _T("%s [%s]"), TranslateT("Hide"), GetBossKeyText());
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_TCHAR | CMIM_NAME;
mi.ptszName = buf;
@@ -633,9 +632,7 @@ static int GenMenuInit(WPARAM wParam, LPARAM lParam) // Modify menu item text be
void BossKeyMenuItemInit(void) // Add menu item
{
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.position = 2000100000;
mi.pszPopupName = 0;
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index e89114cb97..af22f743d6 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -466,10 +466,10 @@ INT_PTR MenuMissYouClick(WPARAM wParam, LPARAM lParam)
int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
char *proto = GetContactProto((HANDLE)wParam);
- if (!proto) return 0;
+ if (!proto)
+ return 0;
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
if (db_get_b((HANDLE)wParam, proto, "ChatRoom", 0) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
@@ -717,8 +717,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
if (options.enableMissYou) {
hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.icolibItem = hDisabledIcon;
mi.position = 200000;
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
index cee91395de..1a39c15b82 100644
--- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
+++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
@@ -336,8 +336,7 @@ static int PrebuildMainMenu(WPARAM wParam, LPARAM lParam)
{
// we have to use ME_CLIST_PREBUILDMAINMENU instead of updating menu items only on settings change, because "popup_enabled" and "popup_disabled" icons are not always available yet in ModulesLoaded
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR | CMIM_NAME | CMIM_ICON;
if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY)) {
mi.ptszName = LPGENT("Disable c&lient change notification");
@@ -388,8 +387,8 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam)
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
hServices.AddElem(CreateServiceFunction(MS_CCN_TOGGLEPOPUPS, srvTogglePopups));
hHooks.AddElem(HookEvent(ME_CLIST_PREBUILDMAINMENU, PrebuildMainMenu));
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
mi.ptszName = LPGENT("Disable c&lient change notification");
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index ba4e787b02..0c6175e7cc 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -75,7 +75,6 @@ static HANDLE hOnContactMenuBuild_FAV = NULL;
static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
BOOL NeedFree = FALSE;
BYTE bContactRate = db_get_b((HANDLE)wParam, "CList", "Rate",0);
//if (hFavoriteContactMenu)
@@ -103,9 +102,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
int i;
TCHAR * name = NULL;
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hIcon = CLUI_LoadIconFromExternalFile("clisticons.dll",8,TRUE,TRUE,iconsName[bContactRate],"Contact List",Translate(iconsName[bContactRate]),-IDI_FAVORITE_0 - bContactRate, &NeedFree);
mi.pszPopupName = (char *)-1;
mi.position = 0;
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 4ac629d55b..03414ab7f9 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -641,10 +641,7 @@ void InitTrayMenus(void)
{
//add exit command to menu
- CLISTMENUITEM mi;
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 900000;
mi.pszService = "CloseAction";
mi.pszName = LPGEN("E&xit");
@@ -673,7 +670,6 @@ void InitTrayMenus(void)
AddTrayMenuItem(0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
-
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 300000;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index b0a9ffee51..6892cbf104 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -100,10 +100,10 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam)
TCHAR cls[128];
HANDLE hItem;
HWND hwndClist = GetFocus();
- CLISTMENUITEM mi;
+
if (MirandaExiting()) return 0;
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
GetClassName(hwndClist,cls,SIZEOF(cls));
hwndClist = (!lstrcmp(CLISTCONTROL_CLASS,cls))?hwndClist:pcli->hwndContactList;
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp
index 2b78349096..37c0a574e0 100644
--- a/plugins/Clist_modern/src/modern_cluiframes.cpp
+++ b/plugins/Clist_modern/src/modern_cluiframes.cpp
@@ -837,8 +837,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGEN
if (_fCluiFramesModuleNotStarted)
return NULL;
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.pszPopupName = (char *)root;
mi.popupPosition = frameid;
@@ -1006,15 +1005,12 @@ static int ModifyMItem(WPARAM wParam,LPARAM lParam)
static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
{
- int pos;
- CLISTMENUITEM mi;
/* HOOK */
if (MirandaExiting()) return 0;
if (_fCluiFramesModuleNotStarted) return -1;
- pos = id2pos(wParam);
+ int pos = id2pos(wParam);
if (pos >= 0 && pos < g_nFramesCount) {
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
if (g_pfwFrames[pos].visible) mi.flags |= CMIF_CHECKED;
mi.ptszName = g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
@@ -1061,18 +1057,12 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
{
//hiword(wParam) = frameid,loword(wParam) = flag
- int pos;
- CLISTMENUITEM mi;
- //TMO_MenuItem tmi;
-
if (_fCluiFramesModuleNotStarted) return -1;
-
- pos = id2pos(wParam);
+ int pos = id2pos(wParam);
if (pos >= 0 && pos < g_nFramesCount) {
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
if (g_pfwFrames[pos].visible) mi.flags |= CMIF_CHECKED;
mi.ptszName = g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
@@ -1108,23 +1098,6 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
if (g_pfwFrames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignBottom,(LPARAM)&mi);
- /*
- mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
- if (Frames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
- ModifyMItem((WPARAM)contMIAlignTop,(LPARAM)&mi);
-
- mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|CMIF_GRAYED;
- if (Frames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
- ModifyMItem((WPARAM)contMIAlignClient,(LPARAM)&mi);
-
- mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
- if (Frames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
- ModifyMItem((WPARAM)contMIAlignBottom,(LPARAM)&mi);
-
- */
-
-
-
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].collapsed) mi.flags |= CMIF_CHECKED;
if ((!g_pfwFrames[pos].visible) || g_pfwFrames[pos].Locked || (pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
@@ -1768,9 +1741,8 @@ static int CLUIFramesLoadMainMenu()
_hmiRoot = (HGENMENU)-1;
}
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
// create root menu
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
mi.position = 3000090000;
diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp
index d11337f3ed..e9c5d5791d 100644
--- a/plugins/Clist_modern/src/modern_groupmenu.cpp
+++ b/plugins/Clist_modern/src/modern_groupmenu.cpp
@@ -214,11 +214,9 @@ INT_PTR CreateGroupHelper(WPARAM wParam,LPARAM lParam)
static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
- if (MirandaExiting()) return 0;
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ if (MirandaExiting()) return 0;
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
@@ -238,27 +236,24 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableGroupsMenuItem, (LPARAM)&mi);
return 0;
-};
+}
int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
{
- HICON hicon;
- CLISTMENUITEM clmi = {0};
+ if (MirandaExiting()) return 0;
+
BOOL needFree;
- if (MirandaExiting()) return 0;
- hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,&needFree);
+ HICON hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,&needFree);
NewGroupIconidx = ImageList_ReplaceIcon(hCListImages,NewGroupIconidx,hicon);
if (needFree) DestroyIcon_protect(hicon);
- clmi.cbSize = sizeof(clmi);
+
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON;
clmi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewSubGroupMenuItem,(LPARAM)&clmi);
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewGroupMenuItem,(LPARAM)&clmi);
- //
-
-
return 0;
-};
+}
void GroupMenus_Init(void)
{
@@ -309,13 +304,10 @@ void GroupMenus_Init(void)
op.Value = (INT_PTR)"CLISTMENUSGroup/GroupMenuonAddService";
CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
- {
//add exit command to menu
- CLISTMENUITEM mi;
GroupMenuParam gmp;
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1900000;
mi.pszService = "CloseAction";
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_EXIT);
@@ -344,7 +336,6 @@ void GroupMenus_Init(void)
AddGroupMenuItem(0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
-
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 300000;
@@ -411,7 +402,6 @@ void GroupMenus_Init(void)
mi.pszName = LPGEN("Hide &Offline Users out here");
hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 100003;
@@ -420,8 +410,6 @@ void GroupMenus_Init(void)
mi.pszName = LPGEN("Hide &Empty Groups");
hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
-
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 100004;
@@ -430,12 +418,7 @@ void GroupMenus_Init(void)
mi.pszName = LPGEN("Disable &Groups");
hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
-
- //MS_CLIST_GROUPCREATE
-
- };
}
//////////////////////////////END Group MENU/////////////////////////
@@ -470,34 +453,31 @@ static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
- BOOL gray1 = FALSE;
- BOOL gray2 = FALSE;
- BOOL showOfflineinGroup = FALSE;
-
-
+ BOOL gray1 = FALSE;
+ BOOL gray2 = FALSE;
+ BOOL showOfflineinGroup = FALSE;
+
ClcGroup *group = (ClcGroup *)wParam;
if (wParam == 0) return 0;
- if (MirandaExiting()) return 0;
+ if (MirandaExiting()) return 0;
//contact->group
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
- showOfflineinGroup = CLCItems_IsShowOfflineGroup(group);
- gray1 = (showOfflineinGroup != FALSE);
- gray2 = (group->hideOffline != FALSE);
-
- if (gray1 && gray2) gray1 = FALSE; //should not be cause CLCItems_IsShowOfflineGroup return false if group->hideOffline
-
- mi.flags = CMIM_FLAGS | ((group->hideOffline && !gray1)?CMIF_CHECKED:0)| (gray1?CMIF_GRAYED:0);
+ showOfflineinGroup = CLCItems_IsShowOfflineGroup(group);
+ gray1 = (showOfflineinGroup != FALSE);
+ gray2 = (group->hideOffline != FALSE);
+
+ if (gray1 && gray2) gray1 = FALSE; //should not be cause CLCItems_IsShowOfflineGroup return false if group->hideOffline
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS | ((group->hideOffline && !gray1)?CMIF_CHECKED:0)| (gray1?CMIF_GRAYED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
-
- mi.flags = CMIM_FLAGS | ((showOfflineinGroup && !gray2) ? CMIF_CHECKED:0)| (gray2?CMIF_GRAYED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowOfflineUsersHereMenuItem, (LPARAM)&mi);
-
+
+ mi.flags = CMIM_FLAGS | ((showOfflineinGroup && !gray2) ? CMIF_CHECKED:0)| (gray2?CMIF_GRAYED:0);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowOfflineUsersHereMenuItem, (LPARAM)&mi);
return 0;
-};
+}
+
INT_PTR BuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
ListParam param = { 0 };
@@ -695,11 +675,9 @@ void InitSubGroupMenus(void)
CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
//add exit command to menu
- CLISTMENUITEM mi;
GroupMenuParam gmp;
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1000;
mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
@@ -708,8 +686,6 @@ void InitSubGroupMenus(void)
hNewSubGroupMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 1001;
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
@@ -718,8 +694,6 @@ void InitSubGroupMenus(void)
gmp.wParam = POPUP_GROUPHIDEOFFLINE;
hHideOfflineUsersHereMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 1002;
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
@@ -739,8 +713,6 @@ void InitSubGroupMenus(void)
AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.position = 900002;
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_DELETE);
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
index 7c9381f7cc..0326de4745 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
@@ -629,13 +629,10 @@ int CLUIFramesGetalClientFrame(void)
HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
- CLISTMENUITEM mi;
HANDLE menuid;
int framepos = id2pos(frameid);
- ZeroMemory(&mi,sizeof(mi));
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hIcon = LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_CLIENTMIRANDA));
mi.pszPopupName = (char *)root;
mi.popupPosition = frameid;
@@ -807,16 +804,11 @@ INT_PTR ModifyMItem(WPARAM wParam,LPARAM lParam)
static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
{
- int pos;
- CLISTMENUITEM mi;
- //TMO_MenuItem tmi;
-
lockfrm();
- pos = id2pos(wParam);
+ int pos = id2pos(wParam);
if (pos >= 0 && pos < nFramescount) {
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
ModifyMItem((WPARAM)contMITitle,(LPARAM)&mi);
@@ -868,8 +860,7 @@ INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
int pos = id2pos(wParam);
if (pos >= 0 && pos < nFramescount) {
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MITitle,(LPARAM)&mi);
@@ -1415,14 +1406,11 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam)
static int CLUIFramesLoadMainMenu()
{
- CLISTMENUITEM mi;
int i,separator;
if ( !(ServiceExists(MS_CLIST_REMOVEMAINMENUITEM))) {
- //hmm new menu system not used..so display only two items and warning message
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
// create "show all frames" menu
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_MIRANDA));
mi.flags = CMIF_GRAYED;
mi.position = 10000000;
@@ -1455,10 +1443,8 @@ static int CLUIFramesLoadMainMenu()
MainMIRoot = (HGENMENU)-1;
}
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
-
// create root menu
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hIcon = LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_CLIENTMIRANDA));
mi.flags = CMIF_ROOTPOPUP;
mi.position = 3000090000;
diff --git a/plugins/Clist_mw/src/clisttray.cpp b/plugins/Clist_mw/src/clisttray.cpp
index d18e90f443..af0f210e14 100644
--- a/plugins/Clist_mw/src/clisttray.cpp
+++ b/plugins/Clist_mw/src/clisttray.cpp
@@ -225,10 +225,7 @@ void InitTrayMenus(void)
{
//add exit command to menu
- CLISTMENUITEM mi;
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 900000;
mi.pszService = "CloseAction";
mi.pszName = LPGEN("E&xit");
diff --git a/plugins/Clist_mw/src/groupmenu.cpp b/plugins/Clist_mw/src/groupmenu.cpp
index ecf2c4aeeb..118d66a463 100644
--- a/plugins/Clist_mw/src/groupmenu.cpp
+++ b/plugins/Clist_mw/src/groupmenu.cpp
@@ -213,37 +213,27 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
mi.flags = CMIM_FLAGS | ( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT,0,0)?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersOutHereMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideEmptyGroupsMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableGroupsMenuItem, (LPARAM)&mi);
-
return 0;
}
int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
{
- HICON hicon;
- CLISTMENUITEM clmi = {0};
-
- hicon = LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP,0);
+ HICON hicon = LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP,0);
NewGroupIconidx = ImageList_ReplaceIcon(hCListImages,NewGroupIconidx,hicon);
- clmi.cbSize = sizeof(clmi);
- clmi.flags = CMIM_ICON;
- clmi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewSubGroupMenuItem,(LPARAM)&clmi);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewGroupMenuItem,(LPARAM)&clmi);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON;
+ mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewSubGroupMenuItem,(LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewGroupMenuItem,(LPARAM)&mi);
return 0;
}
@@ -296,11 +286,9 @@ void InitGroupMenus(void)
{
//add exit command to menu
- CLISTMENUITEM mi;
GroupMenuParam gmp;
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1900000;
mi.pszService = "CloseAction";
mi.pszName = LPGEN("E&xit");
@@ -439,19 +427,16 @@ static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
ClcGroup *group = (ClcGroup *)wParam;
if (wParam == 0) return 0;
//contact->group
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (group->hideOffline?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
-
return 0;
}
+
static INT_PTR BuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
int tick;
@@ -596,13 +581,10 @@ void InitSubGroupMenus(void)
op.Value = (INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuonAddService";
CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
- {
//add exit command to menu
- CLISTMENUITEM mi;
GroupMenuParam gmp;
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1000;
mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
@@ -638,10 +620,6 @@ void InitSubGroupMenus(void)
mi.pszName = LPGEN("&Delete Group");
gmp.lParam = 0;gmp.wParam = POPUP_DELETEGROUP;
AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
-
- //MS_CLIST_SubGroupCREATE
-
- }
}
//////////////////////////////END SubGroup MENU/////////////////////////
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index cf91ea9106..477edd5345 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -636,16 +636,13 @@ int CLUIFramesGetalClientFrame(void)
HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
- CLISTMENUITEM mi;
- //TMO_MenuItem tmi;
HANDLE menuid;
int framepos = id2pos(frameid);
- if (FramesSysNotStarted) return NULL;
-
- ZeroMemory(&mi, sizeof(mi));
+ if (FramesSysNotStarted)
+ return NULL;
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA); //LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_MIRANDA));
mi.pszPopupName = (char *)root;
mi.popupPosition = frameid;
@@ -835,18 +832,14 @@ int ModifyMItem(WPARAM wParam, LPARAM lParam)
static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM lParam)
{
- int pos;
- CLISTMENUITEM mi;
-
if (FramesSysNotStarted)
return -1;
lockfrm();
- pos = id2pos((INT_PTR)wParam);
+ int pos = id2pos((INT_PTR)wParam);
if (pos >= 0 && pos < nFramescount) {
- memset(&mi, 0, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIF_CHILDPOPUP | CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
ModifyMItem((WPARAM)contMITitle, (LPARAM)&mi);
@@ -899,18 +892,14 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM lParam)
INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam, LPARAM lParam)
{
- int pos;
- CLISTMENUITEM mi;
-
if (FramesSysNotStarted)
return -1;
lockfrm();
- pos = id2pos((INT_PTR)wParam);
+ int pos = id2pos((INT_PTR)wParam);
if (pos >= 0 && pos < nFramescount) {
- memset(&mi, 0, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIF_CHILDPOPUP | CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MITitle, (LPARAM)&mi);
@@ -1599,9 +1588,6 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM lParam)
static int CLUIFramesLoadMainMenu()
{
- CLISTMENUITEM mi;
- int i, separator;
-
if (FramesSysNotStarted)
return -1;
@@ -1610,10 +1596,8 @@ static int CLUIFramesLoadMainMenu()
MainMIRoot = (HANDLE) - 1;
}
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
-
// create root menu
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA); //LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_MIRANDA));
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
mi.position = (int)3000090000;
@@ -1623,8 +1607,8 @@ static int CLUIFramesLoadMainMenu()
MainMIRoot = Menu_AddMainMenuItem(&mi);
// create frames menu
- separator = (int)3000200000;
- for (i = 0;i < nFramescount;i++) {
+ int separator = (int)3000200000;
+ for (int i=0; i < nFramescount; i++) {
mi.hIcon = Frames[i].TitleBar.hicon;
mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP | CMIF_TCHAR;
mi.position = separator;
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
index 8d11eddac5..7d6e67b063 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
@@ -223,64 +223,40 @@ INT_PTR HideOfflineRootHelper(WPARAM wParam,LPARAM lParam)
!SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0),CLM_GETHIDEOFFLINEROOT,0,0),
0);
return 0;
-};
+}
static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
-
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (cfg::getByte("CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT,0,0)?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersOutHereMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideEmptyGroupsMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableGroupsMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hGroupMainMenuItemProxy, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAppearanceMenuItemProxy, (LPARAM)&mi);
-
return 0;
-};
+}
int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
{
- HICON hicon;
- CLISTMENUITEM clmi={0};
-
- //hicon=LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP);
- NewGroupIconidx=ImageList_ReplaceIcon(hCListImages,NewGroupIconidx,hicon);
-
- clmi.cbSize=sizeof(clmi);
- clmi.flags=CMIM_ICON;
- clmi.hIcon=ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewSubGroupMenuItem,(LPARAM)&clmi);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewGroupMenuItem,(LPARAM)&clmi);
- //
-
-
+ CLISTMENUITEM clmi = { sizeof(clmi) };
+ clmi.flags = CMIM_ICON;
+ clmi.hIcon = ImageList_GetIcon(hCListImages, NewGroupIconidx, 0);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hNewSubGroupMenuItem, (LPARAM)&clmi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hNewGroupMenuItem, (LPARAM)&clmi);
return 0;
-};
+}
void InitGroupMenus(void)
{
@@ -330,11 +306,9 @@ void InitGroupMenus(void)
{
//add exit command to menu
- CLISTMENUITEM mi;
GroupMenuParam gmp;
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position=1900000;
mi.pszService="CloseAction";
mi.pszName=LPGEN("E&xit");
@@ -387,7 +361,6 @@ void InitGroupMenus(void)
AddGroupMenuItem(0,(LPARAM)&mi);
-
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=500000;
@@ -482,8 +455,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
return 0;
//contact->group
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (group->hideOffline?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
@@ -657,11 +629,9 @@ void InitSubGroupMenus(void)
{
//add exit command to menu
- CLISTMENUITEM mi;
GroupMenuParam gmp;
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position=1000;
mi.hIcon=ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
diff --git a/plugins/Clist_nicer/src/CLUIFrames/movetogroup.cpp b/plugins/Clist_nicer/src/CLUIFrames/movetogroup.cpp
index ee867b0a48..7daa97cf9d 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/movetogroup.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/movetogroup.cpp
@@ -5,41 +5,28 @@ HANDLE hPriorityItem = 0, hFloatingItem = 0;
static int OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
- BYTE bSetting;
-
- // Menu Item - Floating Contact
- bSetting = cfg::getByte("CList", "flt_enabled", 0);
- if (bSetting && !hFloatingItem)
- {
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
+ BYTE bSetting = cfg::getByte("CList", "flt_enabled", 0);
+ if (bSetting && !hFloatingItem) {
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position=200000;
mi.pszPopupName=(char *)-1;
mi.pszService="CList/SetContactFloating";
mi.pszName=LPGEN("&Floating Contact");
- if (pcli)
- {
- if (SendMessage(pcli->hwndContactTree, CLM_QUERYFLOATINGCONTACT, wParam, 0))
- mi.flags=CMIF_CHECKED;
- }
+ if (SendMessage(pcli->hwndContactTree, CLM_QUERYFLOATINGCONTACT, wParam, 0))
+ mi.flags = CMIF_CHECKED;
+
hFloatingItem = Menu_AddContactMenuItem(&mi);
}
- else if ( !bSetting && hFloatingItem)
- {
+ else if ( !bSetting && hFloatingItem) {
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hFloatingItem, 0);
hFloatingItem = 0;
}
- else
- {
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.flags=CMIM_FLAGS;
- if (pcli)
- {
- if (SendMessage(pcli->hwndContactTree, CLM_QUERYFLOATINGCONTACT, wParam, 0))
- mi.flags |= CMIF_CHECKED;
- }
+ else {
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS;
+ if (SendMessage(pcli->hwndContactTree, CLM_QUERYFLOATINGCONTACT, wParam, 0))
+ mi.flags |= CMIF_CHECKED;
+
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hFloatingItem, (LPARAM)&mi);
}
return 0;
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index fdd5c3e9f2..bfabb68c49 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -398,27 +398,24 @@ int InitCustomMenus(void)
CreateServiceFunction("CloseAction",CloseAction);
CreateServiceFunction("CList/SetContactFloating", SetContactFloating);
CreateServiceFunction("CList/SetContactIgnore", SetContactIgnore);
- {
- //FYR: Visibility and ignore item moved back to clist_nicer from core
- HANDLE hIgnoreItem = 0; // FYR: moved from global it is never used globally
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof( mi );
-
- if ( !hIgnoreItem ) {
- mi.position = 200000;
- mi.pszPopupName = ( char* )-1;
- mi.pszService = "CList/SetContactIgnore";
- mi.pszName = LPGEN("&Contact list settings...");
- hIgnoreItem = Menu_AddContactMenuItem(&mi);
- }
- }
- hMainStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
- hMainMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ {
+ //FYR: Visibility and ignore item moved back to clist_nicer from core
+ HANDLE hIgnoreItem = 0; // FYR: moved from global it is never used globally
+ if ( !hIgnoreItem ) {
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 200000;
+ mi.pszPopupName = ( char* )-1;
+ mi.pszService = "CList/SetContactIgnore";
+ mi.pszName = LPGEN("&Contact list settings...");
+ hIgnoreItem = Menu_AddContactMenuItem(&mi);
+ }
+ }
+ hMainStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ hMainMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
return 0;
}
void UninitCustomMenus(void)
{
-
}
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index c52b574648..3d0da48591 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -187,9 +187,7 @@ static void ShowConsole(int show)
if (hMenu)
{
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.ptszName = (show) ? _T("Hide Console") : _T("Show Console");
mi.flags = CMIM_NAME | CMIF_TCHAR;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenu, (LPARAM)&mi);
@@ -1271,9 +1269,9 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
if (hwndConsole && IsWindow(hwndConsole))
{
- CLISTMENUITEM mi = {0};
HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded);
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.hIcon = hIcons[0];
mi.ptszPopupName = _T("&Help");
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index 585575f77b..c64acaf38a 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -154,60 +154,54 @@ static bool CheckContactsServiceSupport(const char* szProto)
static int HookPreBuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
- char* szProto =GetContactProto(hContact);
- int bVisible = FALSE;
-
- if (szProto && CheckContactsServiceSupport(szProto))
- { // known protocol, protocol supports contacts sending
- // check the selected contact if it supports contacts receive
- if (CallProtoService(szProto, PS_GETCAPS, PFLAG_MAXCONTACTSPERPACKET, (LPARAM)hContact))
- bVisible = TRUE;
- }
-
- { // update contact menu item's visibility
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
- if (bVisible)
- mi.flags = CMIM_FLAGS;
- else
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuItem, (LPARAM)&mi);
- }
-
- return 0;
+ HANDLE hContact = (HANDLE)wParam;
+ char* szProto =GetContactProto(hContact);
+ int bVisible = FALSE;
+
+ if (szProto && CheckContactsServiceSupport(szProto)) {
+ // known protocol, protocol supports contacts sending
+ // check the selected contact if it supports contacts receive
+ if (CallProtoService(szProto, PS_GETCAPS, PFLAG_MAXCONTACTSPERPACKET, (LPARAM)hContact))
+ bVisible = TRUE;
+ }
+
+ // update contact menu item's visibility
+ CLISTMENUITEM mi = { sizeof(mi) };
+ if (bVisible)
+ mi.flags = CMIM_FLAGS;
+ else
+ mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
+
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuItem, (LPARAM)&mi);
+ return 0;
}
static int HookModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char* modules[2] = {0};
- WCHAR tmp[MAX_PATH];
+ char* modules[2] = {0};
+ WCHAR tmp[MAX_PATH];
- modules[0] = MODULENAME;
- CallService("DBEditorpp/RegisterModule",(WPARAM)modules,(LPARAM)1);
+ modules[0] = MODULENAME;
+ CallService("DBEditorpp/RegisterModule",(WPARAM)modules,(LPARAM)1);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
- mi.ptszName = SRCTranslateT("Contacts", tmp);
- mi.position = -2000009990; //position in menu
- mi.flags = CMIF_KEEPUNTRANSLATED;
- if (g_UnicodeCore)
- mi.flags |= CMIF_UNICODE;
- mi.pszService = MS_CONTACTS_SEND;
- mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS));
- hContactMenuItem = Menu_AddContactMenuItem(&mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.ptszName = SRCTranslateT("Contacts", tmp);
+ mi.position = -2000009990; //position in menu
+ mi.flags = CMIF_KEEPUNTRANSLATED;
+ if (g_UnicodeCore)
+ mi.flags |= CMIF_UNICODE;
+ mi.pszService = MS_CONTACTS_SEND;
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS));
+ hContactMenuItem = Menu_AddContactMenuItem(&mi);
- hHookPreBuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, HookPreBuildContactMenu);
+ hHookPreBuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, HookPreBuildContactMenu);
- ghSendWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
- ghRecvWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
+ ghSendWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
+ ghRecvWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
-
- ProcessUnreadEvents();
- return 0;
+ ProcessUnreadEvents();
+ return 0;
}
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp
index 18f78be3eb..047f93a7ef 100644
--- a/plugins/CrashDumper/src/crshdmp.cpp
+++ b/plugins/CrashDumper/src/crshdmp.cpp
@@ -269,10 +269,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
UploadInit();
- CLISTMENUITEM mi = { 0 };
-
- mi.cbSize = sizeof(mi);
-
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.popupPosition = 2000089999;
mi.position = 2000089999;
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
diff --git a/plugins/CyrTranslit/src/MirandaContact.cpp b/plugins/CyrTranslit/src/MirandaContact.cpp
index 750ee9ffbc..045199f45d 100644
--- a/plugins/CyrTranslit/src/MirandaContact.cpp
+++ b/plugins/CyrTranslit/src/MirandaContact.cpp
@@ -65,8 +65,7 @@ void MirandaContact::save(HANDLE hContact, bool bValue)
void MirandaContact::addMenuItem()
{
- CLISTMENUITEM mi;
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszName = MENU_ITEM_TEXT;
mi.flags = 0;
mi.position = 65535;
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp
index 2d4e21c310..beb025d7d3 100644
--- a/plugins/DbEditorPP/src/main.cpp
+++ b/plugins/DbEditorPP/src/main.cpp
@@ -162,8 +162,7 @@ static int OnTTBLoaded(WPARAM wParam,LPARAM lParam)
int ModulesLoaded(WPARAM wParam,LPARAM lParam)
{
// Register menu item
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1900000001;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT));
mi.pszName = modFullname;
diff --git a/plugins/DbEditorPP/src/options.cpp b/plugins/DbEditorPP/src/options.cpp
index f7cfe921b2..a9fd40b3a8 100644
--- a/plugins/DbEditorPP/src/options.cpp
+++ b/plugins/DbEditorPP/src/options.cpp
@@ -51,7 +51,6 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case PSN_APPLY:
{
- CLISTMENUITEM mi = {0};
char mods[4096];
DBWriteContactSettingByte(NULL,modname,"ExpandSettingsOnOpen",(BYTE)IsDlgButtonChecked(hwnd,IDC_EXPANDSETTINGS));
DBWriteContactSettingByte(NULL,modname,"RestoreOnOpen",(BYTE)IsDlgButtonChecked(hwnd,IDC_RESTORESETTINGS));
@@ -65,15 +64,13 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
DBWriteContactSettingWord(NULL,modname,"PopupDelay",(WORD)GetDlgItemInt(hwnd,IDC_POPUPTIMEOUT,NULL,0));
DBWriteContactSettingDword(NULL,modname,"PopupColour",(DWORD)SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_GETCOLOUR, 0, 0));
- mi.cbSize = sizeof(mi);
-
+ CLISTMENUITEM mi = { sizeof(mi) };
if (!IsDlgButtonChecked(hwnd,IDC_MENU))
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
else
mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hUserMenu, (LPARAM) & mi);
-
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hUserMenu, (LPARAM) & mi);
}
return TRUE;
}
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp
index 75d9f71614..6e3cbd5239 100644
--- a/plugins/Db_autobackups/src/main.cpp
+++ b/plugins/Db_autobackups/src/main.cpp
@@ -82,8 +82,7 @@ static void IcoLibInit(void)
static void MenuInit(void)
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.hIcon = Skin_GetIcon("backup");
mi.ptszPopupName = LPGENT("Database");
diff --git a/plugins/Dbx_mmap_SA/src/dialogs.cpp b/plugins/Dbx_mmap_SA/src/dialogs.cpp
index c54acaa597..6a53bcbf4b 100644
--- a/plugins/Dbx_mmap_SA/src/dialogs.cpp
+++ b/plugins/Dbx_mmap_SA/src/dialogs.cpp
@@ -70,17 +70,14 @@ INT_PTR ChangePassword(WPARAM wParam, LPARAM lParam)
void xModifyMenu(HANDLE hMenu,long flags,const TCHAR* name, HICON hIcon)
{
- CLISTMENUITEM menu;
- ZeroMemory(&menu,sizeof(menu));
- menu.cbSize = sizeof(menu);
- menu.flags = CMIM_FLAGS | CMIF_TCHAR;
- menu.flags |= name ? CMIM_NAME : 0;
- menu.flags |= hIcon ? CMIM_ICON : 0;
- menu.flags |= flags;
- menu.ptszName = (TCHAR*)name;
- menu.hIcon = hIcon;
-
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenu,(LPARAM)&menu);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS | CMIF_TCHAR;
+ mi.flags |= name ? CMIM_NAME : 0;
+ mi.flags |= hIcon ? CMIM_ICON : 0;
+ mi.flags |= flags;
+ mi.ptszName = (TCHAR*)name;
+ mi.hIcon = hIcon;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenu,(LPARAM)&mi);
}
int InitMenus(WPARAM, LPARAM)
@@ -106,15 +103,14 @@ int InitMenus(WPARAM, LPARAM)
HANDLE hIcon = Skin_AddIcon(&sid);
// main menu item
- CLISTMENUITEM menu = {0};
- menu.cbSize = sizeof(menu);
- menu.flags = CMIM_ALL | CMIF_TCHAR | CMIF_ICONFROMICOLIB;
- menu.icolibItem = hIcon;
- menu.ptszName = (g_Db->m_bEncoding) ? LPGENT("Change password") : LPGENT("Set password");
- menu.ptszPopupName = LPGENT("Database");
- menu.pszService = MS_DB_CHANGEPASSWORD;
- menu.position = 500100000;
- hSetPwdMenu = Menu_AddMainMenuItem(&menu);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ALL | CMIF_TCHAR | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = hIcon;
+ mi.ptszName = (g_Db->m_bEncoding) ? LPGENT("Change password") : LPGENT("Set password");
+ mi.ptszPopupName = LPGENT("Database");
+ mi.pszService = MS_DB_CHANGEPASSWORD;
+ mi.position = 500100000;
+ hSetPwdMenu = Menu_AddMainMenuItem(&mi);
return 0;
}
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp
index dea3d4457f..3ca4573d00 100644
--- a/plugins/FTPFileYM/src/ftpfile.cpp
+++ b/plugins/FTPFileYM/src/ftpfile.cpp
@@ -124,11 +124,9 @@ static void InitIcolib()
void InitMenuItems()
{
- CLISTMENUITEM mi = {0};
- CLISTMENUITEM mi2 = {0};
TCHAR stzName[256];
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.icolibItem = hIconlibItem[ServerList::FTP_COUNT];
mi.position = 3000090001;
@@ -141,7 +139,7 @@ void InitMenuItems()
mi.cbSize = sizeof(mi);
mi.ptszName = stzName;
- mi2.cbSize = sizeof(mi2);
+ CLISTMENUITEM mi2 = { sizeof(mi2) };
mi2.flags = CMIF_CHILDPOPUP | CMIF_ROOTHANDLE | CMIF_TCHAR;
mi2.pszService = MS_FTPFILE_CONTACTMENU;
@@ -256,8 +254,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
bHideRoot = false;
}
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
if (opt.bUseSubmenu)
@@ -287,11 +284,8 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
void PrebuildMainMenu()
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
-
- for (int i = 0; i < ServerList::FTP_COUNT; i++)
- {
+ CLISTMENUITEM mi = { sizeof(mi) };
+ for (int i=0; i < ServerList::FTP_COUNT; i++) {
mi.flags = CMIM_FLAGS;
if (!ftpList[i]->bEnabled)
mi.flags |= opt.bHideInactive ? CMIF_HIDDEN : CMIF_GRAYED;
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index 733a890bd0..767a870174 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -343,8 +343,7 @@ extern "C" __declspec(dllexport) int Load(void)
LoadHttpApi();
#ifdef _DEBUG
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
mi.position = 1900000000;
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp
index 197e59309f..a9f4cb17d9 100644
--- a/plugins/FileAsMessage/src/main.cpp
+++ b/plugins/FileAsMessage/src/main.cpp
@@ -226,7 +226,6 @@ int OnModulesLoaded(WPARAM wparam,LPARAM lparam)
hHookSkinIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnSkinIconsChanged);
CLISTMENUITEM mi = { sizeof(mi) };
- mi.cbSize = sizeof(CLISTMENUITEM);
mi.position = 200011;
mi.hIcon = hIcons[ICON_MAIN];
mi.pszName = LPGEN("File As Message...");
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index 5faf1c177b..df6aa4320b 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -513,11 +513,8 @@ static int OnStatusModeChange( WPARAM wParam, LPARAM lParam )
static int OnPrebuildContactMenu( WPARAM wParam, LPARAM lParam )
{
ThumbInfo *pThumb = thumbList.FindThumbByContact( (HANDLE) wParam );
- CLISTMENUITEM clmi;
-
- ZeroMemory( &clmi, sizeof( clmi ));
- clmi.cbSize = sizeof( clmi );
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = ( pThumb == NULL ) ? CMIM_FLAGS | CMIF_HIDDEN : CMIM_FLAGS &~CMIF_HIDDEN;
CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemRemove, (LPARAM)&clmi );
@@ -1060,8 +1057,7 @@ static void LoadMenus()
// Remove thumb menu item
hRemoveThumb = CreateServiceFunction( sModule "/RemoveThumb", OnContactMenu_Remove );
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof( mi );
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 0xFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDI_HIDE ));
@@ -1184,18 +1180,15 @@ static INT_PTR OnHotKey_HideWhenCListShow( WPARAM wParam, LPARAM lParam )
static INT_PTR OnMainMenu_HideAll( WPARAM wParam, LPARAM lParam )
{
- CLISTMENUITEM clmi = {0};
- int b;
-
fcOpt.bHideAll = !fcOpt.bHideAll;
DBWriteContactSettingByte(NULL, sModule, "HideAll", (BYTE)fcOpt.bHideAll);
OnStatusChanged();
- clmi.cbSize = sizeof( clmi );
- clmi.flags = CMIM_NAME | CMIM_ICON|CMIF_TCHAR;
- clmi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ));
- clmi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
- b = CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMainMenuItemHideAll, ( LPARAM )&clmi );
+ CLISTMENUITEM clmi = { sizeof(clmi) };
+ clmi.flags = CMIM_NAME | CMIM_ICON|CMIF_TCHAR;
+ clmi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ));
+ clmi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMainMenuItemHideAll, ( LPARAM )&clmi );
return 0;
}
diff --git a/plugins/Gender/src/main.cpp b/plugins/Gender/src/main.cpp
index 000c9d6389..88f3b6d3a1 100644
--- a/plugins/Gender/src/main.cpp
+++ b/plugins/Gender/src/main.cpp
@@ -123,13 +123,10 @@ INT_PTR GetIcon(WPARAM wParam, LPARAM lParam)
int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
char *proto = GetContactProto((HANDLE)wParam);
+ if (!proto)
+ return 0;
- if (!proto) return 0;
-
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
-
-
+ CLISTMENUITEM mi = { sizeof(mi) };
if (DBGetContactSettingByte((HANDLE)wParam, proto, "ChatRoom", 0) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
else
@@ -139,8 +136,7 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
unsigned short gender = DBGetContactSettingByte((HANDLE)wParam, proto, "Gender", DBGetContactSettingByte((HANDLE)wParam, "UserInfo", "Gender", 0));
- CLISTMENUITEM mitem = {0};
- mitem.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mitem = { sizeof(mitem) };
mitem.flags = CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuMale, (LPARAM)&mitem);
@@ -149,16 +145,15 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
mitem.flags = CMIM_FLAGS | CMIF_CHECKED;
- switch (gender)
- {
- case 77:
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuMale, (LPARAM)&mitem);
+ switch (gender) {
+ case 77:
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuMale, (LPARAM)&mitem);
break;
- case 70:
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuFemale, (LPARAM)&mitem);
+ case 70:
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuFemale, (LPARAM)&mitem);
break;
- case 0:
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuNotDef, (LPARAM)&mitem);
+ case 0:
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuNotDef, (LPARAM)&mitem);
break;
}
@@ -253,8 +248,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
{
if(ServiceExists(MS_CLIST_MENUBUILDSUBGROUP))
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.icolibItem = g_hIconMenu;
mi.pszPopupName = (char*)-1;
@@ -284,8 +278,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
}
else
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.position = 1001;
mi.ptszName = LPGENT("Set Male");
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp
index b246cdeaaf..4208fb0634 100644
--- a/plugins/HistoryLinkListPlus/src/linklist.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist.cpp
@@ -47,7 +47,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
extern "C" __declspec(dllexport) int Load(void)
{
- CLISTMENUITEM linklistmenuitem;
WNDCLASS wndclass;
@@ -71,14 +70,15 @@ extern "C" __declspec(dllexport) int Load(void)
#endif
CreateServiceFunction("Linklist/MenuCommand", LinkList_Main);
- ZeroMemory(&linklistmenuitem, sizeof(linklistmenuitem));
- linklistmenuitem.cbSize = sizeof(linklistmenuitem);
- linklistmenuitem.position = 0x00;
- linklistmenuitem.flags = CMIF_TCHAR;
- linklistmenuitem.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON));
- linklistmenuitem.ptszName = LPGENT("&Create Linklist");
- linklistmenuitem.pszService = "Linklist/MenuCommand";
- Menu_AddContactMenuItem(&linklistmenuitem);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 0x00;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON));
+ mi.ptszName = LPGENT("&Create Linklist");
+ mi.pszService = "Linklist/MenuCommand";
+ Menu_AddContactMenuItem(&mi);
+
hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp
index f16a875b3a..3de2bee115 100644
--- a/plugins/Import/src/main.cpp
+++ b/plugins/Import/src/main.cpp
@@ -115,9 +115,7 @@ extern "C" __declspec(dllexport) int Load(void)
hIcoHandle = IcoLib_Register("import_main", "Import", LPGEN("Import..."), IDI_IMPORT);
- CLISTMENUITEM mi;
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.icolibItem = hIcoHandle;
mi.pszName = LPGEN("&Import...");
mi.position = 500050000;
diff --git a/plugins/LangMan/src/main.cpp b/plugins/LangMan/src/main.cpp
index 2309bf1ec8..db222bf309 100644
--- a/plugins/LangMan/src/main.cpp
+++ b/plugins/LangMan/src/main.cpp
@@ -130,8 +130,7 @@ __declspec(dllexport) int Load(void)
/* menu item */
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 2000089999;
mi.icolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RELOAD));
mi.pszName = LPGEN("Reload langpack");
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index cea9ef9566..21326eee11 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -172,8 +172,7 @@ void UpdateGlobalStatusMenus()
{
BOOL enabled = ListeningToEnabled(NULL, TRUE);
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(clmi);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS
| (enabled ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
@@ -207,8 +206,7 @@ void RebuildMenu()
TCHAR text[512];
mir_sntprintf(text, MAX_REGS(text), TranslateT("Send to %s"), info->account);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 100000 + i;
mi.pszPopupName = (char *) hMainMenuGroup;
mi.popupPosition = 500080000 + i;
@@ -260,8 +258,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam)
TCHAR text[512];
mir_sntprintf(text, MAX_REGS(text), TranslateT("Send to %s"), info->account);
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(clmi);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
clmi.ptszName = text;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->hMenu, (LPARAM) &clmi);
@@ -767,8 +764,7 @@ INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam)
ProtocolInfo *info = GetProtoInfo(proto);
if (info != NULL)
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(clmi);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS
| (lParam ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 6450110251..c01630d821 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -896,8 +896,7 @@ INT_PTR onIgnore(WPARAM wparam,LPARAM lparam)
static HANDLE AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD flag, char* service, int pos, int param)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hParentMenu = hRoot;
mi.popupPosition = param;
mi.position = pos;
@@ -910,14 +909,13 @@ static HANDLE AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD flag
static void ModifySubmenuItem(HANDLE hItem, TCHAR* name, int checked, int hidden)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.ptszName = name;
- mi.flags = CMIM_FLAGS | CMIF_TCHAR;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.ptszName = name;
+ mi.flags = CMIM_FLAGS | CMIF_TCHAR;
if ( checked )
- mi.flags |= CMIF_CHECKED;
+ mi.flags |= CMIF_CHECKED;
if ( hidden )
- mi.flags |= CMIF_HIDDEN;
+ mi.flags |= CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hItem, (LPARAM)&mi);
}
@@ -1196,8 +1194,6 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
{
int pos = 1000, i = 0;
- CLISTMENUITEM mi;
-
IconsInit();
bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT) != 0;
@@ -1215,7 +1211,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
hServices[10] = CreateServiceFunction(MS_COPYIP,onCopyIP);
hServices[11] = CreateServiceFunction(MS_COPYMIRVER,onCopyMirVer);
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.hIcon = NULL;
mi.pszContactOwner = NULL;
diff --git a/plugins/MetaContacts/src/icons.cpp b/plugins/MetaContacts/src/icons.cpp
index e6cbc9a3a3..54f56e2a84 100644
--- a/plugins/MetaContacts/src/icons.cpp
+++ b/plugins/MetaContacts/src/icons.cpp
@@ -30,34 +30,32 @@ void ReleaseIconEx(HICON hIcon)
int ReloadIcons(WPARAM wParam, LPARAM lParam)
{
// fix menu icons
- CLISTMENUITEM menu = {0};
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON;
- menu.cbSize = sizeof(menu);
- menu.flags = CMIM_ICON;
+ mi.hIcon = LoadIconEx(Meta_IsEnabled() ? I_MENUOFF : I_MENU);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(Meta_IsEnabled() ? I_MENUOFF : I_MENU);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
-
- menu.hIcon = LoadIconEx(I_CONVERT);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_CONVERT);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(I_ADD);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_ADD);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(I_EDIT);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_EDIT);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(I_SETDEFAULT);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_SETDEFAULT);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(I_REMOVE);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_REMOVE);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
return 0;
}
diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp
index 743b25c838..0d7d82d7a7 100644
--- a/plugins/MetaContacts/src/meta_menu.cpp
+++ b/plugins/MetaContacts/src/meta_menu.cpp
@@ -394,7 +394,6 @@ INT_PTR TranslateMenuFunc(HANDLE hMeta, int contact_number) {
*/
int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM mi;
DBVARIANT dbv;
HANDLE hContact;
char *proto;
@@ -402,8 +401,8 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
int i, iconIndex;
WORD status;
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
- mi.cbSize = sizeof(CLISTMENUITEM);
if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,-1) != (DWORD)-1)
{
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp
index c837a7b1c8..d205ff9a6e 100644
--- a/plugins/MetaContacts/src/meta_services.cpp
+++ b/plugins/MetaContacts/src/meta_services.cpp
@@ -1489,9 +1489,9 @@ int Meta_CallMostOnline(WPARAM wParam, LPARAM lParam) {
}
-INT_PTR Meta_OnOff(WPARAM wParam, LPARAM lParam) {
- CLISTMENUITEM mi;
- mi.cbSize = sizeof(CLISTMENUITEM);
+INT_PTR Meta_OnOff(WPARAM wParam, LPARAM lParam)
+{
+ CLISTMENUITEM mi = { sizeof(mi) };
// just write to db - the rest is handled in the Meta_SettingChanged function
if (db_get_b(0, META_PROTO, "Enabled", 1)) {
db_set_b(0, META_PROTO, "Enabled", 0);
diff --git a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp
index 17c2d9a4b0..270eb6de60 100644
--- a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp
+++ b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp
@@ -122,15 +122,15 @@ INT_PTR SVC_ToggleHTMLOTR(WPARAM wParam, LPARAM lParam) {
return 0;
}
-void InitMenu() {
+void InitMenu()
+{
CreateServiceFunction(MS_OTR_MENUSTART, SVC_StartOTR);
CreateServiceFunction(MS_OTR_MENUSTOP, SVC_StopOTR);
CreateServiceFunction(MS_OTR_MENUREFRESH, SVC_RefreshOTR);
CreateServiceFunction(MS_OTR_MENUVERIFY, SVC_VerifyOTR);
CreateServiceFunction(MS_OTR_MENUTOGGLEHTML, SVC_ToggleHTMLOTR);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR | CMIF_ICONFROMICOLIB;
mi.position = -400000;
@@ -154,11 +154,11 @@ void DeinitMenu() {
UnhookEvent(hMenuBuildEvent);
}
-int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
+int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
+{
HANDLE hContact = (HANDLE)wParam;
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_TCHAR | CMIF_ICONFROMICOLIB;
const char *proto = contact_get_proto(hContact);
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp
index 725ad3222d..0ab02fa6f2 100755
--- a/plugins/Msg_Export/src/main.cpp
+++ b/plugins/Msg_Export/src/main.cpp
@@ -180,9 +180,7 @@ int MainInit(WPARAM /*wparam*/,LPARAM /*lparam*/)
MessageBox( NULL , LPGENT("Failed to HookEvent ME_OPT_INITIALISE") , MSG_BOX_TITEL , MB_OK );
- CLISTMENUITEM mi;
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags=0;
mi.pszContactOwner=NULL; //all contacts
mi.hIcon=LoadIcon(hInstance,MAKEINTRESOURCE(IDI_EXPORT_MESSAGE));
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp
index f2e056082b..3dca1c808a 100644
--- a/plugins/MyDetails/src/frame.cpp
+++ b/plugins/MyDetails/src/frame.cpp
@@ -317,17 +317,15 @@ int CreateFrame()
// Create menu item
- CLISTMENUITEM menu = {0};
-
- menu.cbSize=sizeof(menu);
- menu.flags = CMIF_TCHAR;
- menu.popupPosition = -0x7FFFFFFF;
- menu.ptszPopupName = LPGENT("My Details");
- menu.position = 1; // 500010000
- menu.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- menu.ptszName = LPGENT("Show My Details");
- menu.pszService= MODULE_NAME "/ShowHideMyDetails";
- hMenuShowHideFrame = Menu_AddMainMenuItem(&menu);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_TCHAR;
+ mi.popupPosition = -0x7FFFFFFF;
+ mi.ptszPopupName = LPGENT("My Details");
+ mi.position = 1; // 500010000
+ mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.ptszName = LPGENT("Show My Details");
+ mi.pszService= MODULE_NAME "/ShowHideMyDetails";
+ hMenuShowHideFrame = Menu_AddMainMenuItem(&mi);
if ( db_get_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 1) == 1) {
ShowWindow(hwnd_container, SW_SHOW);
@@ -2485,8 +2483,7 @@ INT_PTR HideFrameFunc(WPARAM wParam, LPARAM lParam)
void FixMainMenu()
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME;
if (MyDetailsFrameVisible())
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp
index 188e41e748..52b8fb2666 100644
--- a/plugins/MyDetails/src/mydetails.cpp
+++ b/plugins/MyDetails/src/mydetails.cpp
@@ -150,11 +150,10 @@ static int MainInit(WPARAM wparam,LPARAM lparam)
InitProtocolData();
// Add options to menu
- CLISTMENUITEM mi;
+ // !!!!!!!! check it later
+ CLISTMENUITEM mi = { sizeof(mi) };
if (protocols->CanSetAvatars()) {
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIF_TCHAR;
mi.popupPosition = 500050000;
mi.ptszPopupName = LPGENT("My Details");
diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp
index 6831c204a1..99e35c4740 100644
--- a/plugins/NewEventNotify/src/menuitem.cpp
+++ b/plugins/NewEventNotify/src/menuitem.cpp
@@ -1,6 +1,6 @@
/*
Name: NewEventNotify - Plugin for Miranda IM
- File: menuitem.c - Manages item(s) in the Miranda Menu
+ File: mi.c - Manages item(s) in the Miranda Menu
Version: 0.0.4
Description: Notifies you about some events
Author: icebreaker, <icebreaker@newmail.net>
@@ -24,7 +24,6 @@
#include "neweventnotify.h"
-CLISTMENUITEM menuitem;
HANDLE hMenuitemNotify;
BOOL bNotify;
@@ -40,14 +39,14 @@ static INT_PTR MenuitemNotifyCmd(WPARAM wParam,LPARAM lParam)
int MenuitemUpdate(BOOL bStatus)
{
- //menuitem.flags = CMIM_FLAGS | (bStatus ? CMIF_CHECKED : 0);
- menuitem.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(bStatus ? IDI_ENABLED : IDI_DISABLED));
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(bStatus ? IDI_ENABLED : IDI_DISABLED));
if (bStatus)
- menuitem.ptszName = TranslateT(MENUITEM_DISABLE);
+ mi.ptszName = TranslateT(MENUITEM_DISABLE);
else
- menuitem.ptszName = TranslateT(MENUITEM_ENABLE);
- menuitem.flags = CMIM_ICON | CMIM_NAME | CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuitemNotify, (LPARAM)&menuitem);
+ mi.ptszName = TranslateT(MENUITEM_ENABLE);
+ mi.flags = CMIM_ICON | CMIM_NAME | CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuitemNotify, (LPARAM)&mi);
return 0;
}
@@ -56,14 +55,13 @@ int MenuitemInit(BOOL bStatus)
{
CreateServiceFunction(MS_NEN_MENUNOTIFY, MenuitemNotifyCmd);
- ZeroMemory(&menuitem, sizeof(menuitem));
- menuitem.cbSize = sizeof(CLISTMENUITEM);
- menuitem.position = 1;
- menuitem.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ENABLED));
- menuitem.ptszPopupName = TranslateT("PopUps");
- menuitem.pszService = MS_NEN_MENUNOTIFY;
- menuitem.flags = CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
- hMenuitemNotify = Menu_AddMainMenuItem(&menuitem);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 1;
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ENABLED));
+ mi.ptszPopupName = TranslateT("PopUps");
+ mi.pszService = MS_NEN_MENUNOTIFY;
+ mi.flags = CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
+ hMenuitemNotify = Menu_AddMainMenuItem(&mi);
bNotify = bStatus;
MenuitemUpdate(bNotify);
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp
index 2e22a9f5cd..648e15c7de 100644
--- a/plugins/NewEventNotify/src/options.cpp
+++ b/plugins/NewEventNotify/src/options.cpp
@@ -263,7 +263,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, L
options->colBackOthers = SendDlgItemMessage(hWnd, IDC_COLBACK_OTHERS, CPM_GETCOLOUR, 0, 0);
options->colTextOthers = SendDlgItemMessage(hWnd, IDC_COLTEXT_OTHERS, CPM_GETCOLOUR, 0, 0);
}
- //send changes to menuitem
+ //send changes to mi
MenuitemUpdate(!options->bDisable);
//enable "Apply" button
SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0);
@@ -282,7 +282,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, L
case PSN_RESET:
OptionsRead();
- //maybe something changed with the menuitem
+ //maybe something changed with the mi
MenuitemUpdate(!options->bDisable);
break;
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index dc590828b1..23041dab04 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -1037,8 +1037,7 @@ INT_PTR EnableDisableMenuCommand(WPARAM wParam, LPARAM lParam)
opt.TempDisabled = !opt.TempDisabled;
DBWriteContactSettingByte(0, MODULE, "TempDisable", opt.TempDisabled);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_TCHAR;
if (opt.TempDisabled) {
mi.ptszName = _T("Enable status notification");
@@ -1056,8 +1055,7 @@ INT_PTR EnableDisableMenuCommand(WPARAM wParam, LPARAM lParam)
void InitMainMenuItem()
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR | CMIF_ICONFROMICOLIB;
mi.ptszPopupName = ServiceExists(MS_POPUP_ADDPOPUP) ? _T("PopUps") : NULL;
mi.pszService = MS_STATUSCHANGE_MENUCOMMAND;
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index fbfe9ad9fa..66fd9400f5 100755
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -194,8 +194,8 @@ extern "C" int __declspec(dllexport) Load()
CreateServiceFunction("/ExportGPGKeys",ExportGpGKeys);
CreateServiceFunction("/ImportGPGKeys",ImportGpGKeys);
- CLISTMENUITEM mi = {0};
- mi.cbSize=sizeof(mi);
+ // !!!!!!!! check it later
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position=-0x7FFFFFFF;
mi.flags=CMIF_TCHAR;
mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index f872bd5e7f..3effa8aa48 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -208,8 +208,8 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
setSrmmIcon(hContact);
setClistIcon(hContact);
enc = enc?0:1;
- CLISTMENUITEM mi = {0};
- mi.cbSize=sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME;
enc?mi.pszName="Turn off GPG encryption":mi.pszName="Turn on GPG encryption";
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggleEncryption, (LPARAM)&mi);
@@ -221,8 +221,8 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l)
HANDLE hContact = (HANDLE)w;
if(metaIsProtoMetaContacts(hContact))
hContact = metaGetMostOnline(hContact);
- CLISTMENUITEM mi = {0};
- mi.cbSize=sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME;
TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T(""));
if(_tcslen(tmp) < 1)
diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp
index 62a5da045d..a0217919ec 100644
--- a/plugins/NewsAggregator/Src/Menus.cpp
+++ b/plugins/NewsAggregator/Src/Menus.cpp
@@ -23,8 +23,7 @@ HANDLE hService2[6];
VOID InitMenu()
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszContactOwner = MODULE;
mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_NOTOFFLINE;
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp
index a1bb09e6ed..e2742e3fcd 100644
--- a/plugins/NoHistory/src/dllmain.cpp
+++ b/plugins/NoHistory/src/dllmain.cpp
@@ -164,9 +164,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
char *proto = GetContactProto(hContact);
bool chat_room = (proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) != 0);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
-
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS|CMIF_TCHAR;
if(chat_room) mi.flags |= CMIF_HIDDEN;
else {
@@ -307,8 +305,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
InitIcons();
// create contact menu item
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.position = -300010;
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp
index 0553a91d6d..6150abb40d 100644
--- a/plugins/NotesAndReminders/src/main.cpp
+++ b/plugins/NotesAndReminders/src/main.cpp
@@ -207,79 +207,71 @@ static void InitServices()
int OnModulesLoaded(WPARAM wparam,LPARAM lparam)
{
- CLISTMENUITEM cmi = {0};
-
// register fonts and hotkeys
-
RegisterFontServiceFonts();
RegisterKeyBindings();
// register menus
-
- cmi.cbSize = sizeof(cmi);
- cmi.pszContactOwner = NULL;
- cmi.ptszPopupName = LPGENT("Notes && Reminders");
- cmi.flags = CMIF_TCHAR | CMIF_ICONFROMICOLIB;
-
- cmi.position = 1600000000;
- cmi.icolibItem = hIconLibItem[2];
- cmi.ptszName = LPGENT("New &Note");
- cmi.pszService = MODULENAME"/MenuCommandAddNew";
- if (g_AddContListMI) Menu_AddContactMenuItem(&cmi);
- Menu_AddMainMenuItem(&cmi);
-
- cmi.position = 1600000001;
- cmi.icolibItem = hIconLibItem[0];
- cmi.ptszName = LPGENT("New &Reminder");
- cmi.pszService = MODULENAME"/MenuCommandNewReminder";
- if (g_AddContListMI) Menu_AddContactMenuItem(&cmi);
- Menu_AddMainMenuItem(&cmi);
-
- //
-
- cmi.position = 1600100000;
- cmi.icolibItem = hIconLibItem[3];
- cmi.ptszName = LPGENT("&Show / Hide Notes");
- cmi.pszService = MODULENAME"/MenuCommandShowHide";
- if (g_AddContListMI) Menu_AddContactMenuItem(&cmi);
- Menu_AddMainMenuItem(&cmi);
-
- cmi.position = 1600100001;
- cmi.icolibItem = hIconLibItem[13];
- cmi.ptszName = LPGENT("Vie&w Notes");
- cmi.pszService = MODULENAME"/MenuCommandViewNotes";
- if (g_AddContListMI) Menu_AddContactMenuItem(&cmi);
- Menu_AddMainMenuItem(&cmi);
-
- cmi.position = 1600100002;
- cmi.icolibItem = hIconLibItem[1];
- cmi.ptszName = LPGENT("&Delete All Notes");
- cmi.pszService = MODULENAME"/MenuCommandDeleteAll";
- if (g_AddContListMI) Menu_AddContactMenuItem(&cmi);
- Menu_AddMainMenuItem(&cmi);
-
- cmi.position = 1600100003;
- cmi.icolibItem = hIconLibItem[11];
- cmi.ptszName = LPGENT("&Bring All to Front");
- cmi.pszService = MODULENAME"/MenuCommandBringAllFront";
- if (g_AddContListMI) Menu_AddContactMenuItem(&cmi);
- Menu_AddMainMenuItem(&cmi);
-
- //
-
- cmi.position = 1600200000;
- cmi.icolibItem = hIconLibItem[6];
- cmi.ptszName = LPGENT("&View Reminders");
- cmi.pszService = MODULENAME"/MenuCommandViewReminders";
- if (g_AddContListMI) Menu_AddContactMenuItem(&cmi);
- Menu_AddMainMenuItem(&cmi);
-
- cmi.position = 1600200001;
- cmi.icolibItem = hIconLibItem[5];
- cmi.ptszName = LPGENT("D&elete All Reminders");
- cmi.pszService = MODULENAME"/MenuCommandDeleteReminders";
- if (g_AddContListMI) Menu_AddContactMenuItem(&cmi);
- Menu_AddMainMenuItem(&cmi);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.pszContactOwner = NULL;
+ mi.ptszPopupName = LPGENT("Notes && Reminders");
+ mi.flags = CMIF_TCHAR | CMIF_ICONFROMICOLIB;
+
+ mi.position = 1600000000;
+ mi.icolibItem = hIconLibItem[2];
+ mi.ptszName = LPGENT("New &Note");
+ mi.pszService = MODULENAME"/MenuCommandAddNew";
+ if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = 1600000001;
+ mi.icolibItem = hIconLibItem[0];
+ mi.ptszName = LPGENT("New &Reminder");
+ mi.pszService = MODULENAME"/MenuCommandNewReminder";
+ if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = 1600100000;
+ mi.icolibItem = hIconLibItem[3];
+ mi.ptszName = LPGENT("&Show / Hide Notes");
+ mi.pszService = MODULENAME"/MenuCommandShowHide";
+ if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = 1600100001;
+ mi.icolibItem = hIconLibItem[13];
+ mi.ptszName = LPGENT("Vie&w Notes");
+ mi.pszService = MODULENAME"/MenuCommandViewNotes";
+ if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = 1600100002;
+ mi.icolibItem = hIconLibItem[1];
+ mi.ptszName = LPGENT("&Delete All Notes");
+ mi.pszService = MODULENAME"/MenuCommandDeleteAll";
+ if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = 1600100003;
+ mi.icolibItem = hIconLibItem[11];
+ mi.ptszName = LPGENT("&Bring All to Front");
+ mi.pszService = MODULENAME"/MenuCommandBringAllFront";
+ if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = 1600200000;
+ mi.icolibItem = hIconLibItem[6];
+ mi.ptszName = LPGENT("&View Reminders");
+ mi.pszService = MODULENAME"/MenuCommandViewReminders";
+ if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
+ Menu_AddMainMenuItem(&mi);
+
+ mi.position = 1600200001;
+ mi.icolibItem = hIconLibItem[5];
+ mi.ptszName = LPGENT("D&elete All Reminders");
+ mi.pszService = MODULENAME"/MenuCommandDeleteReminders";
+ if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
+ Menu_AddMainMenuItem(&mi);
// register misc
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index ab9442c524..580153ada9 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -762,8 +762,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto)
newNudge->item.hIcoLibItem = Skin_AddIcon(&sid);
//Add contact menu entry
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.popupPosition = 500085000;
mi.pszContactOwner = proto->szModuleName;
mi.pszPopupName = proto->szModuleName;
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp
index 0afa6edee0..301827debb 100644
--- a/plugins/Nudge/src/nudge.cpp
+++ b/plugins/Nudge/src/nudge.cpp
@@ -30,10 +30,7 @@ void CNudge::Load(void)
int CNudgeElement::ShowContactMenu(bool show)
{
-
- CLISTMENUITEM mi;
- memset( &mi, 0, sizeof( mi ));
- mi.cbSize = sizeof( mi );
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = show? CMIM_FLAGS : CMIM_FLAGS | CMIF_HIDDEN ;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi);
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp
index 46129468cd..38fba5857b 100644
--- a/plugins/OpenFolder/src/openFolder.cpp
+++ b/plugins/OpenFolder/src/openFolder.cpp
@@ -85,8 +85,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
hotkey.DefHotKey = MAKEWORD( 'O', HOTKEYF_SHIFT | HOTKEYF_ALT );
Hotkey_Register(&hotkey);
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof( mi );
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 0x7FFFFFFF;
mi.flags = CMIF_ICONFROMICOLIB|CMIF_TCHAR;
mi.icolibItem = hIconOpenFolder;
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp
index 09ba638c9e..6622a6ba21 100644
--- a/plugins/PackUpdater/Src/PackUpdater.cpp
+++ b/plugins/PackUpdater/Src/PackUpdater.cpp
@@ -52,9 +52,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
extern "C" __declspec(dllexport) int Load(void)
{
- CLISTMENUITEM mi;
-
mir_getLP(&pluginInfoEx);
+
TCHAR* tszFolder = Utils_ReplaceVarsT(_T("%miranda_userdata%\\"DEFAULT_UPDATES_FOLDER));
lstrcpyn(tszRoot, tszFolder, SIZEOF(tszRoot));
if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
@@ -70,8 +69,8 @@ extern "C" __declspec(dllexport) int Load(void)
// Add cheking update menu item
hCheckUpdates = CreateServiceFunction(MODNAME"/CheckUpdates", MenuCommand);
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcon = Skin_GetIcon("check_update");
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp
index e2164c2492..d74ed92621 100644
--- a/plugins/PasteIt/src/PasteIt.cpp
+++ b/plugins/PasteIt/src/PasteIt.cpp
@@ -337,10 +337,10 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
bool bIsContact = false;
char *szProto = GetContactProto((HANDLE)wParam);
- if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND) bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) ? true : false;
+ if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
+ bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) ? true : false;
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
if (!bIsContact) mi.flags |= CMIF_HIDDEN;
@@ -385,10 +385,7 @@ void InitIcolib()
void InitMenuItems()
{
- CLISTMENUITEM mi = {0};
- CLISTMENUITEM mi2 = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.icolibItem = hMainIcon;
mi.position = 3000090005;
@@ -413,7 +410,7 @@ void InitMenuItems()
mi.ptszName = _T("Default web page");
HGENMENU hDefWebMenu = Menu_AddContactMenuItem(&mi);
- mi2.cbSize = sizeof(mi2);
+ CLISTMENUITEM mi2 = { sizeof(mi2) };
mi2.pszService = MS_PASTEIT_CONTACTMENU;
mi2.hParentMenu = hDefWebMenu;
for(int i = 0 ; i < PasteToWeb::pages; ++i)
@@ -431,16 +428,11 @@ void InitMenuItems()
void DefWebPageChanged()
{
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
-
- for (int i = 0; i < PasteToWeb::pages; i++)
- {
+ CLISTMENUITEM mi = { sizeof(mi) };
+ for (int i = 0; i < PasteToWeb::pages; i++) {
mi.flags = CMIM_FLAGS;
if (Options::instance->defWeb == i)
- {
mi.flags |= CMIF_CHECKED;
- }
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hWebPageMenus[i], (LPARAM)&mi);
}
diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp
index dbec0a3447..29b3d24696 100644
--- a/plugins/Ping/src/menu.cpp
+++ b/plugins/Ping/src/menu.cpp
@@ -4,95 +4,24 @@
HANDLE hMenuDisable, hMenuGraph, hMenuEdit;
HANDLE hEventMenuBuild;
-/*
-int MenuBuild(WPARAM wParam, LPARAM lParam) {
- CLISTMENUITEM menu;
- ZeroMemory(&menu,sizeof(menu));
- menu.cbSize=sizeof(menu);
-
- menu.flags = CMIM_NAME | CMIM_ICON;
- bool disable = DBGetContactSettingWord((HANDLE)wParam, PLUG, "Status", ID_STATUS_OFFLINE) != options.off_status;
- if(disable) {
- menu.hIcon = hIconDisabled;
- menu.pszName = Translate("Disable");
- } else {
- menu.hIcon = hIconEnabled;
- menu.pszName = Translate("Enable");
- }
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDisable, (LPARAM)&menu);
-
- // hide graph menu item if window displayed
- //menu.flags = CMIM_FLAGS | (DBGetContactSettingDword((HANDLE)wParam, PLUG, "WindowHandle", 0) == 0 ? 0 : CMIF_HIDDEN);
- //CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuGraph, (LPARAM)&menu);
-
- return 0;
-}
-*/
-
-void InitMenus() {
-
- CLISTMENUITEM menu;
- ZeroMemory(&menu,sizeof(menu));
- menu.cbSize=sizeof(menu);
-
+void InitMenus()
+{
// main menu
- menu.flags = CMIF_TCHAR;
- menu.popupPosition = 500099900;
- menu.ptszPopupName = LPGENT("PING");
- menu.cbSize = sizeof( menu );
- menu.position = 2000060000;
- menu.hIcon = hIconResponding;
- menu.ptszName = LPGENT("Enable All Pings");
- menu.pszService = PLUG "/EnableAll";
- Menu_AddMainMenuItem(&menu);
-
- menu.popupPosition = 500299901;
- menu.cbSize = sizeof( menu );
- menu.position = 2000060001;
- menu.popupPosition = 0;
- menu.hIcon = hIconDisabled;
- menu.ptszName = LPGENT("Disable All Pings");
- menu.pszService = PLUG "/DisableAll";
- Menu_AddMainMenuItem(&menu);
-
- /*
- // list items
- menu.flags = 0;
- menu.popupPosition = 0;
- menu.pszPopupName = 0;
- menu.cbSize = sizeof( menu );
- menu.position =-300100;
- //menu.popupPosition = 0;
- menu.hIcon = hIconDisabled;
- menu.pszName = Translate( "Disable" );
- menu.pszService = PLUG "/ToggleEnabled";
- menu.pszContactOwner = PLUG;
- hMenuDisable = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu );
-
- menu.flags = 0;
- menu.popupPosition = 0;
- menu.pszPopupName = 0;
- menu.cbSize = sizeof( menu );
- menu.position =-300090;
- //menu.popupPosition = 0;
- menu.hIcon = hIconResponding
- menu.pszName = Translate( "Graph" );
- menu.pszService = PLUG "/ShowGraph";
- menu.pszContactOwner = PLUG;
- hMenuGraph = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu );
-
- menu.flags = 0;
- menu.popupPosition = 0;
- menu.pszPopupName = 0;
- menu.cbSize = sizeof( menu );
- menu.position =-300080;
- //menu.popupPosition = 0;
- menu.hIcon = hIconResponding;
- menu.pszName = Translate( "Edit..." );
- menu.pszService = PLUG "/Edit";
- menu.pszContactOwner = PLUG;
- hMenuGraph = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu );
-
- hEventMenuBuild = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MenuBuild);
- */
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_TCHAR;
+ mi.popupPosition = 500099900;
+ mi.ptszPopupName = LPGENT("PING");
+ mi.position = 2000060000;
+ mi.hIcon = hIconResponding;
+ mi.ptszName = LPGENT("Enable All Pings");
+ mi.pszService = PLUG "/EnableAll";
+ Menu_AddMainMenuItem(&mi);
+
+ mi.popupPosition = 500299901;
+ mi.position = 2000060001;
+ mi.popupPosition = 0;
+ mi.hIcon = hIconDisabled;
+ mi.ptszName = LPGENT("Disable All Pings");
+ mi.pszService = PLUG "/DisableAll";
+ Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp
index 5db0f4322e..a5b2034e3f 100644
--- a/plugins/Ping/src/pingthread.cpp
+++ b/plugins/Ping/src/pingthread.cpp
@@ -1015,12 +1015,10 @@ void InitList() {
CreateServiceFunction(PLUG "/ShowWindow", PingPlugShowWindow);
- CLISTMENUITEM mi = {0};
-
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.popupPosition = 1000200001;
mi.ptszPopupName = LPGENT( "Ping" );
- mi.cbSize = sizeof( mi );
mi.position = 3000320001;
mi.hIcon = 0;//LoadIcon( hInst, 0);
mi.ptszName = LPGENT( "Show/Hide &Ping Window" );
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp
index 1a63de62d8..5fc6572a5d 100644
--- a/plugins/PluginUpdater/src/PluginUpdater.cpp
+++ b/plugins/PluginUpdater/src/PluginUpdater.cpp
@@ -103,8 +103,7 @@ extern "C" __declspec(dllexport) int Load(void)
// Add cheking update menu item
hCheckUpdates = CreateServiceFunction(MODNAME"/CheckUpdates", MenuCommand);
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = Skin_GetIconHandle("check_update");
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 67c805844c..764a7acc20 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -179,9 +179,7 @@ static int IconsChanged(WPARAM wParam,LPARAM lParam)
{
LoadActions();
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
-
+ CLISTMENUITEM mi = { sizeof(mi) };
if (PopUpOptions.ModuleIsEnabled == TRUE) { //The module is enabled.
//The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_ON,0);
@@ -225,9 +223,8 @@ INT_PTR svcEnableDisableMenuCommand(WPARAM wp, LPARAM lp)
{
int iResult = 0;
int iResultRoot = 0;
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
if (PopUpOptions.ModuleIsEnabled) {
//The module is enabled.
//The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
@@ -261,11 +258,9 @@ INT_PTR svcShowHistory(WPARAM, LPARAM)
return 0;
}
-void InitMenuItems(void) {
- CLISTMENUITEM mi={0};
-
- // Common
- mi.cbSize = sizeof(mi);
+void InitMenuItems(void)
+{
+ CLISTMENUITEM mi = { sizeof(mi) };
// support new genmenu style
mi.flags = CMIF_ROOTHANDLE|CMIF_TCHAR;
mi.hParentMenu = HGENMENU_ROOT;
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp
index 5009d4b898..eff0eaad77 100644
--- a/plugins/ProfileManager/src/pmanagerEx.cpp
+++ b/plugins/ProfileManager/src/pmanagerEx.cpp
@@ -100,13 +100,12 @@ static INT_PTR RestartMe(WPARAM wParam, LPARAM lParam)
extern "C" __declspec(dllexport) int Load(void)
{
- CLISTMENUITEM mi;
-
mir_getLP(&pluginInfo);
hLoadPM = CreateServiceFunction("Database/LoadPM", LoadPM);
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+
+ // !!!!!!!! check it later
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -500200000;
mi.flags = CMIF_TCHAR;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LoadPM));
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 3860e7a494..f5aa9e59c0 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -208,9 +208,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
hIml = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
// Add menu item
- CLISTMENUITEM mi;
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 500100001;
mi.flags = CMIF_TCHAR;
mi.ptszName = LPGENT("Quick Contacts...");
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp
index 6aa7d90dcf..d931ca9813 100644
--- a/plugins/Quotes/src/Forex.cpp
+++ b/plugins/Quotes/src/Forex.cpp
@@ -73,11 +73,7 @@ namespace
void InitMenu()
{
-// USES_CONVERSION;
-
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
- //mi.ptszPopupName = _T("Quotes");
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.ptszName = _T("Quotes");
mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_ROOTPOPUP;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp
index 61b6fb5f11..b828ee7931 100644
--- a/plugins/Quotes/src/QuoteInfoDlg.cpp
+++ b/plugins/Quotes/src/QuoteInfoDlg.cpp
@@ -304,13 +304,10 @@ namespace
{
void enable_menu(HANDLE hMenu,bool bEnable)
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
if(false == bEnable)
- {
- clmi.flags |= /*CMIF_HIDDEN*/CMIF_GRAYED;
- }
+ clmi.flags |= CMIF_GRAYED;
CallService(MS_CLIST_MODIFYMENUITEM,reinterpret_cast<WPARAM>(hMenu),reinterpret_cast<LPARAM>(&clmi));
}
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index 2e1b0b409e..86f737298a 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -461,8 +461,8 @@ int Create_TopToolbarShowList(WPARAM wParam, LPARAM lParam)
int Create_MenuitemShowList(void)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ // !!!!!!!! check it later
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hIcon = Skin_GetIcon("recent_main");
mi.pszName = msLastUC_ShowListName;
mi.pszService = msLastUC_ShowList;
@@ -522,8 +522,7 @@ static void iconsInit(void)
static int OnPrebuildContactMenu (WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof( clmi );
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
if ( DBGetContactSettingByte((HANDLE)wParam, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
diff --git a/plugins/Scriver/src/chat/clist.cpp b/plugins/Scriver/src/chat/clist.cpp
index 836277f933..8e89ab671d 100644
--- a/plugins/Scriver/src/chat/clist.cpp
+++ b/plugins/Scriver/src/chat/clist.cpp
@@ -198,8 +198,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
if ( hContact ) {
char* szProto = GetContactProto(hContact);
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp
index 4ff0eef47d..3f0e54753e 100644
--- a/plugins/Scriver/src/chat/main.cpp
+++ b/plugins/Scriver/src/chat/main.cpp
@@ -76,7 +76,7 @@ int Chat_ModulesLoaded(WPARAM wParam,LPARAM lParam)
OptionsInit();
LoadIcons();
{
- CLISTMENUITEM mi = { 0 };
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.cbSize = sizeof(mi);
mi.position = -2000090001;
mi.flags = CMIF_DEFAULT | CMIF_ICONFROMICOLIB;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 1a9450776e..7aed7129aa 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -381,8 +381,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
if ( hContact ) {
char* szProto = GetContactProto(hContact);
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
@@ -480,15 +479,14 @@ int StatusIconPressed(WPARAM wParam, LPARAM lParam) {
static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM mi;
ReloadGlobals();
RegisterIcons();
RegisterFontServiceFonts();
RegisterKeyBindings();
LoadGlobalIcons();
LoadMsgLogIcons();
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000090000;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_DEFAULT;
mi.icolibItem = LoadSkinnedIconHandle( SKINICON_EVENT_MESSAGE );
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index d0ca0a56c1..0591ce40cf 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -46,30 +46,27 @@ void AddHookFunction(LPCSTR eventName, MIRANDAHOOK hookFunction) {
HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WPARAM wParam=0)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize=sizeof(mi);
- mi.flags=flags | CMIF_HIDDEN;
- mi.position=pos;
- mi.hIcon=hicon;
- mi.pszName= (char*)name;
- mi.pszPopupName=(char*)-1;
- mi.pszService=(char*)service;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = flags | CMIF_HIDDEN;
+ mi.position = pos;
+ mi.hIcon = hicon;
+ mi.pszName = (char*)name;
+ mi.pszPopupName = (char*)-1;
+ mi.pszService = (char*)service;
return Menu_AddContactMenuItem(&mi);
}
HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WPARAM wParam=0)
{
- CLISTMENUITEM mi = { 0 };
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.flags=CMIF_CHILDPOPUP | CMIF_HIDDEN;
- mi.position=pos;
- mi.popupPosition=poppos;
- mi.hIcon=NULL;
- mi.pszName=(char*)name;
- mi.pszPopupName=(char*)rootid;
- mi.pszService=(char*)service;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_CHILDPOPUP | CMIF_HIDDEN;
+ mi.position = pos;
+ mi.popupPosition = poppos;
+ mi.hIcon = NULL;
+ mi.pszName = (char*)name;
+ mi.pszPopupName = (char*)rootid;
+ mi.pszService = (char*)service;
return Menu_AddContactMenuItem(&mi);
}
diff --git a/plugins/SecureIM/src/svcs_clist.cpp b/plugins/SecureIM/src/svcs_clist.cpp
index e7aa7f8379..a37dbf70d5 100644
--- a/plugins/SecureIM/src/svcs_clist.cpp
+++ b/plugins/SecureIM/src/svcs_clist.cpp
@@ -11,56 +11,28 @@ int __cdecl onContactSettingChanged(WPARAM wParam,LPARAM lParam) {
int stat = getContactStatus(hContact);
if (!ptr || stat==-1) return 0;
-// HANDLE hMetaContact = getMetaContact(hContact);
-// if(hMetaContact) {
-// ptr = getUinKey(hMetaContact);
-// if (!ptr) return 0;
-// }
-
if (stat==ID_STATUS_OFFLINE) { // go offline
if (ptr->mode==MODE_NATIVE && cpp_keyx(ptr->cntx)) { // have active context
cpp_delete_context(ptr->cntx); ptr->cntx=0; // reset context
-// if(hMetaContact) { // is subcontact of metacontact
-// showPopUpDC(hMetaContact);
-// ShowStatusIconNotify(hMetaContact);
-// if(getMostOnline(hMetaContact)) { // make handover
-// CallContactService(hMetaContact,PSS_MESSAGE,0,(LPARAM)SIG_INIT);
-// }
-// }
-// else { // is contact or metacontact (not subcontact)
- showPopUpDC(hContact); // show popup "Disabled"
- ShowStatusIconNotify(hContact); // change icon in CL
-// }
+ showPopUpDC(hContact); // show popup "Disabled"
+ ShowStatusIconNotify(hContact); // change icon in CL
}
- else
- if (ptr->mode==MODE_RSAAES && exp->rsa_get_state(ptr->cntx)==7) {
+ else if (ptr->mode==MODE_RSAAES && exp->rsa_get_state(ptr->cntx)==7) {
deleteRSAcntx(ptr);
-// if(hMetaContact) { // is subcontact of metacontact
-// showPopUpDC(hMetaContact);
-// ShowStatusIconNotify(hMetaContact);
-// if(getMostOnline(hMetaContact)) { // make handover
-// CallContactService(hMetaContact,PSS_MESSAGE,0,(LPARAM)SIG_INIT);
-// }
-// }
-// else { // is contact or metacontact (not subcontact)
- showPopUpDC(hContact); // show popup "Disabled"
- ShowStatusIconNotify(hContact); // change icon in CL
-// }
+ showPopUpDC(hContact); // show popup "Disabled"
+ ShowStatusIconNotify(hContact); // change icon in CL
}
}
else { // go not offline
-// if (!hMetaContact) { // is contact or metacontact (not subcontact)
- if (ptr->offlineKey) {
- cpp_reset_context(ptr->cntx);
- ptr->offlineKey = false;
- }
- ShowStatusIconNotify(hContact); // change icon in CL
-// }
+ if (ptr->offlineKey) {
+ cpp_reset_context(ptr->cntx);
+ ptr->offlineKey = false;
+ }
+ ShowStatusIconNotify(hContact); // change icon in CL
}
return 0;
}
-
// wParam=(WPARAM)(HANDLE)hContact
// lParam=0
int __cdecl onContactAdded(WPARAM wParam,LPARAM lParam) {
@@ -103,13 +75,10 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) {
pUinKey ptr = getUinKey(hContact);
int i;
- CLISTMENUITEM mi;
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(CLISTMENUITEM);
-
ShowStatusIconNotify(hContact);
// check offline/online
+ CLISTMENUITEM mi = { sizeof(mi) };
if (!ptr) {
// hide menu bars
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN;
diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp
index 3398f5580b..58d92dd8aa 100644
--- a/plugins/SendScreenshotPlus/src/Main.cpp
+++ b/plugins/SendScreenshotPlus/src/Main.cpp
@@ -292,13 +292,11 @@ INT_PTR service_Send2ImageShack(WPARAM wParam, LPARAM lParam) {
//---------------------------------------------------------------------------
// Add SendSS menu item in contact menu
-void AddMenuItems(void) {
- CLISTMENUITEM mi={0};
-
+void AddMenuItems(void)
+{
// Common
- mi.cbSize = sizeof(mi);
- // support new genmenu style
- mi.flags = CMIF_ROOTHANDLE|CMIF_UNICODE;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_ROOTHANDLE | CMIF_UNICODE;
mi.hParentMenu = HGENMENU_ROOT;
// Add item to contact menu
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 630f9bb1f0..ac82ba2010 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -976,9 +976,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
hibSessionsSave = AddIcon(hiSessionsSave, "SessionsSave", LPGENT("Save Session"));
hibSessionsLoadLast = AddIcon(hiSessionsLoadLast, "SessionsLoadLast", LPGENT("Load last Session"));
- CLISTMENUITEM cl;
- ZeroMemory(&cl, sizeof(cl));
- cl.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM cl = { sizeof(cl) };
cl.position = 1000000000;
cl.flags = CMIM_ALL | CMIF_TCHAR;
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp
index e00a1f6a64..fc9059c197 100644
--- a/plugins/SimpleAR/src/Main.cpp
+++ b/plugins/SimpleAR/src/Main.cpp
@@ -20,7 +20,6 @@ HINSTANCE hinstance;
HANDLE hPreBuildHook = NULL, hAddEventHook = NULL, hOptHook = NULL, hCheckDefHook = NULL, hOnPreShutdown = NULL, hToggleEnable = NULL, hToggleAutoanswer = NULL;
HANDLE hToggle = NULL, hEnableMenu = NULL;
-CLISTMENUITEM mi;
BOOL fEnabled, gbVarsServiceExist = FALSE;
INT interval;
int hLangpack;
@@ -61,16 +60,14 @@ BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved)
INT_PTR ToggleEnable(WPARAM wParam, LPARAM lParam)
{
- mi.cbSize=sizeof(mi);
- mi.flags=CMIM_NAME|CMIM_ICON|CMIF_TCHAR;
- fEnabled=!fEnabled;
- if (fEnabled)
- {
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_NAME|CMIM_ICON|CMIF_TCHAR;
+ fEnabled = !fEnabled;
+ if (fEnabled) {
mi.ptszName = _T("Disable Auto&reply");
mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ON));
}
- else
- {
+ else {
mi.ptszName = _T("Enable Auto&reply");
mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_OFF));
}
@@ -85,7 +82,8 @@ INT_PTR Toggle(WPARAM w, LPARAM l)
on = !DBGetContactSettingByte(hContact, protocolname, "TurnedOn", 0);
DBWriteContactSettingByte(hContact, protocolname, "TurnedOn", on?1:0);
on = on?0:1;
- mi.cbSize=sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME |CMIM_ICON | CMIF_TCHAR;
mi.ptszName=on?_T("Turn off Autoanswer"):_T("Turn on Autoanswer");
mi.hIcon = on?LoadIcon(hinstance, MAKEINTRESOURCE(IDI_OFF)):LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ON));
@@ -96,7 +94,8 @@ INT_PTR Toggle(WPARAM w, LPARAM l)
INT OnPreBuildContactMenu(WPARAM w, LPARAM l)
{
HANDLE hContact = (HANDLE)w;
- mi.cbSize=sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
BOOL on = !DBGetContactSettingByte(hContact, protocolname, "TurnedOn", 0);
mi.ptszName = on?_T("Turn off Autoanswer"):_T("Turn on Autoanswer");
@@ -314,23 +313,20 @@ INT OnPreShutdown(WPARAM wParam, LPARAM lParam)
extern "C" int __declspec(dllexport)Load(void)
{
-
mir_getLP(&pluginInfoEx);
hToggleEnable = CreateServiceFunction(protocolname"/ToggleEnable", ToggleEnable);
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ hToggleAutoanswer = CreateServiceFunction(protocolname"/ToggleAutoanswer",Toggle);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 500090000;
mi.ptszName = _T("");
mi.pszService = protocolname"/ToggleEnable";
hEnableMenu = Menu_AddMainMenuItem(&mi);
- hToggleAutoanswer = CreateServiceFunction(protocolname"/ToggleAutoanswer",Toggle);
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=-0x7FFFFFFF;
- mi.ptszName=_T("");
- mi.pszService=protocolname"/ToggleAutoanswer";
+ mi.position = -0x7FFFFFFF;
+ mi.ptszName = _T("");
+ mi.pszService = protocolname"/ToggleAutoanswer";
hToggle = Menu_AddContactMenuItem(&mi);
//add hook
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp
index 6c31c8ec4e..0f50b6d15a 100644
--- a/plugins/SimpleStatusMsg/src/awaymsg.cpp
+++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp
@@ -372,13 +372,13 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam)
static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM clmi = {0};
TCHAR str[128];
char *szProto = GetContactProto((HANDLE)wParam);
int iHidden = szProto ? DBGetContactSettingByte((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
char *szMsg;
int iStatus;
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.cbSize = sizeof(clmi);
clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
@@ -456,11 +456,10 @@ int AwayMsgPreShutdown(void)
int LoadAwayMsgModule(void)
{
- CLISTMENUITEM mi = {0};
-
hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
hWindowList2 = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
CreateServiceFunctionEx(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index d572945340..bbac07d69a 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -1647,8 +1647,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam)
if (!iStatusMsgFlags || !iStatusMenuItemCount)
return 0;
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
if (!DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1))
mi.flags |= CMIF_HIDDEN;
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp
index 4165553cad..cbf4531f0c 100644
--- a/plugins/SmileyAdd/src/main.cpp
+++ b/plugins/SmileyAdd/src/main.cpp
@@ -84,8 +84,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
INT_PTR temp = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
metaProtoName = mir_strdup(temp == CALLSERVICE_NOTFOUND ? NULL : (char*)temp);
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
mi.popupPosition = 2000070050;
mi.position = 2000070050;
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp
index 58bb73781e..58e6c90c97 100644
--- a/plugins/SmileyAdd/src/services.cpp
+++ b/plugins/SmileyAdd/src/services.cpp
@@ -402,20 +402,16 @@ INT_PTR CustomCatMenu(WPARAM wParam, LPARAM lParam)
int RebuildContactMenu(WPARAM wParam, LPARAM)
{
- int i;
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
SmileyCategoryListType::SmileyCategoryVectorType& smc = *g_SmileyCategories.GetSmileyCategoryList();
char* protnam = GetContactProto((HANDLE)wParam);
bool haveMenu = IsSmileyProto(protnam);
- if (haveMenu && opt.UseOneForAll)
- {
+ if (haveMenu && opt.UseOneForAll) {
unsigned cnt = 0;
- for (i = 0; i < smc.getCount(); ++i)
+ for (int i=0; i < smc.getCount(); ++i)
cnt += smc[i].IsCustom();
haveMenu = cnt != 0;
}
@@ -424,12 +420,11 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuItem, (LPARAM)&mi);
- for (i = 0; i < menuHandleArray.getCount(); ++i)
+ for (int i = 0; i < menuHandleArray.getCount(); ++i)
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)menuHandleArray[i], 0);
menuHandleArray.destroy();
- if (haveMenu)
- {
+ if (haveMenu) {
bkstring cat;
opt.ReadContactCategory((HANDLE)wParam, cat);
@@ -440,9 +435,9 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
bool nonecheck = true;
HGENMENU hMenu;
- for (i = 0; i < smc.getCount(); i++)
- {
- if (smc[i].IsExt() || (smc[i].IsProto() && opt.UseOneForAll)) continue;
+ for (int i=0; i < smc.getCount(); i++) {
+ if (smc[i].IsExt() || (smc[i].IsProto() && opt.UseOneForAll))
+ continue;
const int ind = i + 3;
@@ -450,8 +445,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
mi.popupPosition = ind;
mi.ptszName = (TCHAR*)smc[i].GetDisplayName().c_str();
- if (cat == smc[i].GetName())
- {
+ if (cat == smc[i].GetName()) {
mi.flags |= CMIF_CHECKED;
nonecheck = false;
}
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp
index 8289ce229d..0b3f842812 100644
--- a/plugins/SplashScreen/src/main.cpp
+++ b/plugins/SplashScreen/src/main.cpp
@@ -338,9 +338,8 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
#ifdef _DEBUG
hTestService = CreateServiceFunction("Splash/Test", TestService);
- CLISTMENUITEM mi;
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
mi.hotKey = 0;
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp
index 3fb09ef6eb..aa417e7672 100644
--- a/plugins/StatusPlugins/StartupStatus/profiles.cpp
+++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp
@@ -89,12 +89,10 @@ static INT_PTR profileService5(WPARAM wParam, LPARAM lParam)
static int CreateMainMenuItems(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM mi;
char profilename[128], servicename[128];
int i, count;
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.popupPosition = 2000100000;
mcount = 0;
count = GetProfileCount(0, 0);
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp
index 1ce5b12c79..9a7e7abb24 100755
--- a/plugins/StopSpamMod/src/init.cpp
+++ b/plugins/StopSpamMod/src/init.cpp
@@ -166,11 +166,11 @@ int hLangpack = 0;
extern "C" int __declspec(dllexport) Load()
{
mir_getLP(&pluginInfoEx);
- CLISTMENUITEM mi;
+
CreateServiceFunction("/RemoveTmp", (MIRANDASERVICE)RemoveTmp);
HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position=-0x7FFFFFFF;
mi.flags=0;
mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp
index 42639424fd..57dfa560ef 100644
--- a/plugins/StopSpamPlus/src/stopspam.cpp
+++ b/plugins/StopSpamPlus/src/stopspam.cpp
@@ -43,8 +43,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
extern "C" int __declspec(dllexport) Load(void)
{
- CLISTMENUITEM mi;
-
mir_getLP(&pluginInfoEx);
plSets=new Settings;
@@ -55,8 +53,8 @@ extern "C" int __declspec(dllexport) Load(void)
// Add deliting temporary contacts
hTempRemove = CreateServiceFunction(MS_STOPSPAM_REMTEMPCONTACTS, RemoveTempContacts);
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
diff --git a/plugins/TabSRMM/src/chat/clist.cpp b/plugins/TabSRMM/src/chat/clist.cpp
index 628a7372ab..d3714fc820 100644
--- a/plugins/TabSRMM/src/chat/clist.cpp
+++ b/plugins/TabSRMM/src/chat/clist.cpp
@@ -224,8 +224,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
if ( hContact ) {
char* szProto = GetContactProto(hContact);
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp
index 5690e08154..427dc7de89 100644
--- a/plugins/TabSRMM/src/chat/services.cpp
+++ b/plugins/TabSRMM/src/chat/services.cpp
@@ -70,8 +70,7 @@ int Chat_ModulesLoaded(WPARAM wParam, LPARAM lParam)
LoadIcons();
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000090001;
mi.flags = CMIF_DEFAULT | CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_JOIN );
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 32705d2388..16e335c2c8 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -156,10 +156,9 @@ void CGlobals::reloadSystemStartup()
*/
void CGlobals::reloadSystemModulesChanged()
{
- BOOL bIEView = FALSE;
- CLISTMENUITEM mi = { 0 };
+ BOOL bIEView = FALSE;
- m_MathModAvail = ServiceExists(MATH_RTF_REPLACE_FORMULAE);
+ m_MathModAvail = ServiceExists(MATH_RTF_REPLACE_FORMULAE);
/*
* smiley add
@@ -203,12 +202,10 @@ void CGlobals::reloadSystemModulesChanged()
CallService(MTH_FREE_MATH_BUFFER, 0, (LPARAM)szDelim);
}
}
- else
- PluginConfig.m_MathModStartDelimiter[0] = 0;
+ else PluginConfig.m_MathModStartDelimiter[0] = 0;
g_MetaContactsAvail = (ServiceExists(MS_MC_GETDEFAULTCONTACT) ? 1 : 0);
-
if (g_MetaContactsAvail) {
mir_snprintf(szMetaName, 256, "%s", (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0));
bMetaEnabled = abs(M->GetByte(0, szMetaName, "Enabled", -1));
@@ -221,7 +218,7 @@ void CGlobals::reloadSystemModulesChanged()
g_PopupAvail = (ServiceExists(MS_POPUP_ADDPOPUPEX) ? 1 : 0);
g_PopupWAvail = (ServiceExists(MS_POPUP_ADDPOPUPW) ? 1 : 0);
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000090000;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_DEFAULT;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_EVENT_MESSAGE);
@@ -364,11 +361,6 @@ void CGlobals::hookSystemEvents()
int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- int i;
- MENUITEMINFOA mii = {0};
- HMENU submenu;
- CLISTMENUITEM mi = { 0 };
-
::UnhookEvent(m_event_ModulesLoaded);
M->configureCustomFolders();
@@ -376,17 +368,18 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
Skin->Init(true);
CSkin::initAeroEffect();
- for (i=0; i < NR_BUTTONBARICONS; i++)
+ for (int i=0; i < NR_BUTTONBARICONS; i++)
PluginConfig.g_buttonBarIcons[i] = 0;
::LoadIconTheme();
::CreateImageList(TRUE);
+ MENUITEMINFOA mii = {0};
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_BITMAP;
mii.hbmpItem = HBMMENU_CALLBACK;
- submenu = GetSubMenu(PluginConfig.g_hMenuContext, 7);
- for (i=0; i <= 8; i++)
- SetMenuItemInfoA(submenu, (UINT_PTR)i, TRUE, &mii);
+ HMENU submenu = GetSubMenu(PluginConfig.g_hMenuContext, 7);
+ for (int k=0; k <= 8; k++)
+ SetMenuItemInfoA(submenu, (UINT_PTR)k, TRUE, &mii);
PluginConfig.reloadSystemModulesChanged();
@@ -395,7 +388,6 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
::CB_InitDefaultButtons();
::ModPlus_Init(wParam, lParam);
::NotifyEventHooks(hHookToolBarLoadedEvt, 0, 0);
- //
if (M->GetByte("avatarmode", -1) == -1)
M->WriteByte(SRMSGMOD_T, "avatarmode", 2);
@@ -407,7 +399,7 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
if (nen_options.bTraySupport)
::CreateSystrayIcon(TRUE);
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -500050005;
mi.hIcon = PluginConfig.g_iconContainer;
mi.pszContactOwner = NULL;
@@ -416,7 +408,6 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
PluginConfig.m_UserMenuItem = Menu_AddContactMenuItem(&mi);
if (sendLater->isAvail()) {
- mi.cbSize = sizeof(mi);
mi.position = -500050006;
mi.hIcon = 0;
mi.pszContactOwner = NULL;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 9381dc7356..f491210554 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -666,12 +666,10 @@ int CMimAPI::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE)wParam;
if ( hContact ) {
- char* szProto = GetContactProto(hContact);
-
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
+ char *szProto = GetContactProto(hContact);
if ( szProto ) {
// leave this menu item hidden for chats
if ( !M->GetByte(hContact, szProto, "ChatRoom", 0 ))
@@ -679,7 +677,7 @@ int CMimAPI::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
clmi.flags &= ~CMIF_HIDDEN;
}
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )PluginConfig.m_hMenuItem, ( LPARAM )&clmi );
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)PluginConfig.m_hMenuItem, (LPARAM)&clmi);
}
return 0;
}
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index 52633e3304..5214fadf5d 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -7,10 +7,7 @@ static INT_PTR EnableDisableMenuCommand(WPARAM wParam,LPARAM lParam)
Disabled = !(Disabled);
if (PopupService) {
-
- CLISTMENUITEM mi = { 0 };
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON | CMIM_NAME;
if (!Disabled) {
@@ -21,7 +18,7 @@ static INT_PTR EnableDisableMenuCommand(WPARAM wParam,LPARAM lParam)
mi.hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED));
}
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hDisableMenu,(LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableMenu, (LPARAM)&mi);
}
return 0;
@@ -541,10 +538,9 @@ int TN_ModuleInit()
mir_sntprintf(szStop, sizeof(szStop), TranslateT("...has stopped typing."));
if (PopupService && ShowMenu) {
- CLISTMENUITEM mi = { 0 };
hTypingNotify = CreateServiceFunction("TypingNotify/EnableDisableMenuCommand", EnableDisableMenuCommand);
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = 0;
if (!Disabled) {
diff --git a/plugins/TrafficCounter/src/TrafficCounter.c b/plugins/TrafficCounter/src/TrafficCounter.c
index c427ee7443..b7fe86b3d6 100644
--- a/plugins/TrafficCounter/src/TrafficCounter.c
+++ b/plugins/TrafficCounter/src/TrafficCounter.c
@@ -1506,10 +1506,7 @@ int MenuCommand_TrafficShowHide(WPARAM wParam,LPARAM lParam)
void Traffic_AddMainMenuItem(void)
{
- CLISTMENUITEM mi;
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -0x7FFFFFFF;
mi.flags = 0;
mi.hIcon = NULL;
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp
index 1533af56be..c11494cf38 100644
--- a/plugins/UserGuide/src/main.cpp
+++ b/plugins/UserGuide/src/main.cpp
@@ -79,11 +79,9 @@ static INT_PTR ShowGuideFile(WPARAM wParam,LPARAM lParam)
int ModulesLoaded(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
-
hShowGuide = CreateServiceFunction("UserGuide/ShowGuide", ShowGuideFile);
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 500000;
mi.flags = CMIF_TCHAR;
mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_HELP);
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp
index 9f140fb4b7..e7fdbeaaf5 100644
--- a/plugins/UserInfoEx/src/mir_menuitems.cpp
+++ b/plugins/UserInfoEx/src/mir_menuitems.cpp
@@ -80,7 +80,6 @@ VOID RebuildContact()
{
int flag = 0;
BYTE item = 0;
- CLISTMENUITEM mi;
HGENMENU mhRoot = HGENMENU_ROOT;
HGENMENU mhExIm = HGENMENU_ROOT;
@@ -98,10 +97,9 @@ VOID RebuildContact()
// delete all MenuItems and set all bytes 0 to avoid problems
RemoveMenuItems (hMenuItem, SIZEOF(hMenuItem));
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
// support new genmenu style
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ROOTHANDLE;
mi.hParentMenu = HGENMENU_ROOT;
@@ -182,7 +180,6 @@ VOID RebuildMain()
{
int flag = 0;
BYTE item = 0;
- CLISTMENUITEM mi;
HGENMENU mhRoot = HGENMENU_ROOT;
HGENMENU mhExIm = HGENMENU_ROOT;
@@ -197,10 +194,9 @@ VOID RebuildMain()
// delete all MenuItems and set all bytes 0 to avoid problems
RemoveMenuItems (hMenuItem, SIZEOF(hMenuItem));
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
// support new genmenu style
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ROOTHANDLE;
mi.hParentMenu = HGENMENU_ROOT;
@@ -321,7 +317,6 @@ VOID RebuildGroup()
{
int flag = 0;
BYTE item = 0;
- CLISTMENUITEM mi;
GroupMenuParam gmp = {0};
HGENMENU mhRoot = HGENMENU_ROOT;
@@ -337,12 +332,12 @@ VOID RebuildGroup()
// delete all MenuItems and set all bytes 0 to avoid problems
RemoveMenuItems (hMenuItem, SIZEOF(hMenuItem));
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
// create service name main (prevent to generate {(Null)/Ex-/Import Group} in db) and set pointer to end it
char text[ 200 ];
strcpy( text, "UserInfo");
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
char* tDest = text + strlen( text );
@@ -419,7 +414,6 @@ VOID RebuildSubGroup()
{
int flag = 0;
BYTE item = 0;
- CLISTMENUITEM mi;
GroupMenuParam gmp = {0};
HGENMENU mhRoot = HGENMENU_ROOT;
@@ -435,12 +429,12 @@ VOID RebuildSubGroup()
// delete all MenuItems and set all bytes 0 to avoid problems
RemoveMenuItems (hMenuItem, SIZEOF(hMenuItem));
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
// create service name main (prevent to generate {(Null)/Ex-/Import Group} in db) and set pointer to end it
char text[ 200 ];
strcpy( text, "UserInfo");
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
char* tDest = text + strlen( text );
@@ -529,7 +523,6 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
BYTE i = 0, item = 0;
TCHAR sztName[MAXSETTING];
PROTOACCOUNT* pAccountName = NULL;
- CLISTMENUITEM mi;
mProtoCount = pcli->menuProtoCount;
@@ -556,15 +549,12 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
DB::Setting::WriteByte(SET_MI_ACCOUNT, flag);
}
-
// loop for all account names
for (i = 0; i < mProtoCount; i++) {
// set all bytes 0 to avoid problems
item = 0;
mhRoot = 0;
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
mhRoot = pcli->menuProtos[i].pMenu;
if ( mhRoot == NULL )
@@ -574,6 +564,8 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
// create service name main (account module name) and set pointer to end it
char text[ 200 ];
strcpy( text, pcli->menuProtos[i].szProto);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
char* tDest = text + strlen( text );
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp
index 563d0dabf4..ea4741414d 100644
--- a/plugins/UserInfoEx/src/svc_email.cpp
+++ b/plugins/UserInfoEx/src/svc_email.cpp
@@ -180,22 +180,15 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw
**/
static INT OnPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM mi;
- LPSTR val;
-
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
- val = Get((HANDLE)wParam);
+ LPSTR val = Get((HANDLE)wParam);
if (val)
- {
mir_free(val);
- }
else
- {
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- }
+
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)ghMenuItem, (LPARAM)&mi);
return 0;
}
@@ -220,11 +213,8 @@ VOID SvcEMailRebuildMenu()
if (!ghMenuItem)
{
- CLISTMENUITEM mi;
-
// insert contact menuitem
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000010000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EMAIL);
mi.pszName = "&E-mail";
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp
index 7364653d56..456ef87711 100644
--- a/plugins/UserInfoEx/src/svc_homepage.cpp
+++ b/plugins/UserInfoEx/src/svc_homepage.cpp
@@ -142,11 +142,9 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw
**/
static INT OnPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM mi;
LPSTR val;
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
val = Get((HANDLE)wParam);
@@ -154,10 +152,8 @@ static INT OnPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
MIR_FREE(val);
}
- else
- {
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- }
+ else mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
+
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)ghMenuItem, (LPARAM)&mi);
return 0;
}
@@ -181,9 +177,7 @@ VOID SvcHomepageRebuildMenu()
if (!ghMenuItem) {
// insert contact menuitem
- CLISTMENUITEM mi = { 0 };
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000010000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_GOTO);
mi.pszName = "&Homepage";
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp
index 1a14ec0bea..2945b118c4 100644
--- a/plugins/UserInfoEx/src/svc_refreshci.cpp
+++ b/plugins/UserInfoEx/src/svc_refreshci.cpp
@@ -623,9 +623,7 @@ class CContactUpdater : public CContactQueue
// reset menu
if (hMenuItemRefresh)
{
- CLISTMENUITEM clmi;
-
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME|CMIM_ICON;
clmi.pszName = LPGEN("Refresh Contact Details");
clmi.hIcon = IcoLib_GetIcon(ICO_BTN_UPDATE);
@@ -751,9 +749,7 @@ public:
// if there are contacts in the queue, change the main menu item to indicate it is meant for canceling.
if (hMenuItemRefresh && Size() > 0)
{
- CLISTMENUITEM clmi;
-
- clmi.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME|CMIM_ICON;
clmi.pszName = LPGEN("Abort Refreshing Contact Details");
clmi.hIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
diff --git a/plugins/VersionInfo/src/main.cpp b/plugins/VersionInfo/src/main.cpp
index 91e29e650e..4427ca5827 100644
--- a/plugins/VersionInfo/src/main.cpp
+++ b/plugins/VersionInfo/src/main.cpp
@@ -91,8 +91,7 @@ extern "C" int __declspec(dllexport) Load(void)
_tcslwr(filePath);
//Menu item
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = mi.popupPosition = 2000089999;
mi.flags = 0;
mi.hIcon = hiVIIcon;
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp
index 8a7798b3b1..f5f305109f 100644
--- a/plugins/Weather/src/weather_mwin.cpp
+++ b/plugins/Weather/src/weather_mwin.cpp
@@ -310,9 +310,7 @@ INT_PTR Mwin_MenuClicked(WPARAM wParam,LPARAM lParam)
int BuildContactMenu(WPARAM wparam,LPARAM lparam)
{
- CLISTMENUITEM mi = {0};
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS |
(db_get_dw((HANDLE)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMwinMenu, (LPARAM)&mi);
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp
index f9ea5641a8..643ad10512 100644
--- a/plugins/WhenWasIt/src/hooked_events.cpp
+++ b/plugins/WhenWasIt/src/hooked_events.cpp
@@ -60,6 +60,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
SkinAddNewSoundEx(BIRTHDAY_TODAY_SOUND, LPGEN("WhenWasIt"), LPGEN("Birthday today"));
UpdateTimers();
+
CLISTMENUITEM cl = { sizeof(cl) };
cl.position = 10000000;
cl.flags = CMIF_ICONFROMICOLIB;
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.c b/plugins/WhoUsesMyFiles/src/wumfplug.c
index d7ba2a65bd..c9f07b99ad 100644
--- a/plugins/WhoUsesMyFiles/src/wumfplug.c
+++ b/plugins/WhoUsesMyFiles/src/wumfplug.c
@@ -271,17 +271,14 @@ static INT_PTR WumfMenuCommand(WPARAM wParam,LPARAM lParam)
{
BOOL MajorTo0121 = FALSE;
int iResult = 0;
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- if (WumfOptions.PopupsEnabled == TRUE)
- {
+ CLISTMENUITEM mi = { sizeof(mi) };
+ if (WumfOptions.PopupsEnabled == TRUE) {
WumfOptions.PopupsEnabled = FALSE;
mi.pszName = Translate("Enable WUMF popups");
mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP));
}
- else
- {
+ else {
WumfOptions.PopupsEnabled = TRUE;
mi.pszName = Translate("Disable WUMF popups");
mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP));
@@ -579,37 +576,34 @@ int OptionsInit(WPARAM wparam,LPARAM lparam)
__declspec(dllexport) int Load(void)
{
- CLISTMENUITEM mi = { 0 };
-
mir_getLP(&pluginInfo);
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
LoadOptions();
CreateServiceFunction(MS_WUMF_SWITCHPOPUP, WumfMenuCommand);
CreateServiceFunction(MS_WUMF_CONNECTIONSSHOW, WumfShowConnections);
- if (WumfOptions.PopupsEnabled == FALSE)
- {
- mi.pszName = Translate("Enable WUMF popups");
- mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP));
- }
- else
{
- mi.pszName = Translate("Disable WUMF popups");
- mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP));
+ CLISTMENUITEM mi = { sizeof(mi) };
+ if (WumfOptions.PopupsEnabled == FALSE) {
+ mi.pszName = Translate("Enable WUMF popups");
+ mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP));
+ }
+ else {
+ mi.pszName = Translate("Disable WUMF popups");
+ mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP));
+ }
+ mi.pszService = MS_WUMF_SWITCHPOPUP;
+ mi.popupPosition = 1999990000;
+ mi.pszPopupName = Translate("PopUps");
+ hMenuItem = (HANDLE)Menu_AddMainMenuItem(&mi);
+
+ mi.pszName = Translate("WUMF: Show connections");
+ mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_DRIVE));
+ mi.pszService = MS_WUMF_CONNECTIONSSHOW;
+ mi.popupPosition = 1999990000;
+ mi.pszPopupName = NULL;
+ Menu_AddMainMenuItem(&mi);
}
- mi.pszService = MS_WUMF_SWITCHPOPUP;
- mi.popupPosition = 1999990000;
- mi.pszPopupName = Translate("PopUps");
- hMenuItem = (HANDLE)Menu_AddMainMenuItem(&mi);
-
- mi.pszName = Translate("WUMF: Show connections");
- mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_DRIVE));
- mi.pszService = MS_WUMF_CONNECTIONSSHOW;
- mi.popupPosition = 1999990000;
- mi.pszPopupName = NULL;
- Menu_AddMainMenuItem(&mi);
HookEvent(ME_OPT_INITIALISE,OptionsInit);
HookEvent(ME_TTB_MODULELOADED, InitTopToolbar);
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index 018d9f9565..866fdfbd2c 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -197,8 +197,7 @@ BOOL CALLBACK EnumSystemCodePagesProc(LPTSTR cpStr)
void CheckMenuItems()
{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof( CLISTMENUITEM );
+ CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS;
if ( !DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1))
clmi.flags |= CMIF_HIDDEN;
@@ -209,8 +208,7 @@ void CheckMenuItems()
int SystemModulesLoaded(WPARAM, LPARAM)
{
//Insert "Check mail (YAMN)" item to Miranda's menu
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 0xb0000000;
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = g_GetIconHandle(0);
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index 6abbd4bc47..f8d2b3a1e9 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -239,9 +239,9 @@ INT_PTR IsSecondLineShown(WPARAM wParam, LPARAM lParam) {
return TRUE;
}
-void UpdateMenu() {
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(CLISTMENUITEM);
+void UpdateMenu()
+{
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.pszName = (char*)(db_get_b(0, MODULE, "Enabled", 1) == 1 ? LPGEN("Disable Popups") : LPGEN("Enable Popups"));
mi.flags = CMIM_NAME;// | CMIM_ICON;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuToggleOnOff, (LPARAM)&mi);
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp
index 70bda90b6f..02866e38f0 100644
--- a/plugins/ZeroNotification/src/main.cpp
+++ b/plugins/ZeroNotification/src/main.cpp
@@ -16,7 +16,6 @@ http://miranda-ng.org/
HINSTANCE hInst;
static HANDLE hEventSoundSettingChange, hEventStatusModeChange, hEventOptionsInitialize, hAckEvent, hSoundMenu;
-CLISTMENUITEM mi;
HGENMENU noSoundMenu;
int hLangpack;
@@ -38,7 +37,7 @@ static const struct CheckBoxValues_t statusValues[]={
};
PLUGININFOEX pluginInfoEx = {
- sizeof(PLUGININFOEX),
+ sizeof(PLUGININFOEX),
PLUGINNAME,
PLUGIN_MAKE_VERSION(VER_MAJOR, VER_MINOR, VER_RELEASE, VER_BUILD),
DESCRIPTION,
@@ -81,24 +80,29 @@ static void FillCheckBoxTree(HWND hwndTree,const struct CheckBoxValues_t *values
static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
{
DWORD flags=0;
- TVITEM tvi;
+ TVITEM tvi;
tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_STATE;
tvi.hItem=TreeView_GetRoot(hwndTree);
while(tvi.hItem) {
TreeView_GetItem(hwndTree,&tvi);
- if (((tvi.state&TVIS_STATEIMAGEMASK)>>12==2)) flags|=tvi.lParam;
- tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem);
+ if (((tvi.state & TVIS_STATEIMAGEMASK)>>12 == 2))
+ flags |= tvi.lParam;
+ tvi.hItem = TreeView_GetNextSibling(hwndTree,tvi.hItem);
}
return flags;
}
//Update the name on the menu
-static void UpdateMenuItem() {
+static void UpdateMenuItem()
+{
+ CLISTMENUITEM mi = { sizeof(mi) };
if (DBGetContactSettingByte(NULL, "Skin", "UseSound", 1))
mi.ptszName = TranslateT(DISABLE_SOUND);
else
mi.ptszName = TranslateT(ENABLE_SOUND);
+ mi.flags |= CMIM_NAME | CMIF_TCHAR;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)noSoundMenu,(LPARAM)&mi);
}
//Called when the sound setting in the database is changed
@@ -108,23 +112,16 @@ static int SoundSettingChanged(WPARAM wParam,LPARAM lParam)
if(lstrcmpA(cws->szModule, "Skin") || lstrcmpA(cws->szSetting, "UseSound")) return 0;
UpdateMenuItem();
-
- mi.flags |= CMIM_NAME;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)noSoundMenu,(LPARAM)&mi);
-
return 0;
}
-static int SetNotify(const long status){
+static int SetNotify(const long status)
+{
DBWriteContactSettingByte(NULL,"Skin","UseSound", (BYTE) !(DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoSound",DEFAULT_NOSOUND) & status));
DBWriteContactSettingByte(NULL,"CList","DisableTrayFlash", (BYTE) (DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoBlink",DEFAULT_NOBLINK) & status));
DBWriteContactSettingByte(NULL,"CList","NoIconBlink", (BYTE) (DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoCLCBlink",DEFAULT_NOCLCBLINK) & status));
UpdateMenuItem();
-
- mi.flags |= CMIM_NAME;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)noSoundMenu,(LPARAM)&mi);
-
return 0;
}
@@ -239,15 +236,13 @@ static INT_PTR NoSoundMenuCommand(WPARAM wParam,LPARAM lParam)
extern "C" __declspec(dllexport) int Load(void)
{
-
mir_getLP(&pluginInfoEx);
//The menu item - begin
- if (!DBGetContactSettingByte(NULL, PLUGINNAME_SHORT, "HideMenu", 1))
- {
+ if (!DBGetContactSettingByte(NULL, PLUGINNAME_SHORT, "HideMenu", 1)) {
hSoundMenu = CreateServiceFunction(PLUGINNAME_SHORT "/MenuCommand", NoSoundMenuCommand);
- ZeroMemory(&mi, sizeof(mi));
- mi.cbSize = sizeof(mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
UpdateMenuItem();