summaryrefslogtreecommitdiff
path: root/plugins/Boltun
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/Boltun
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/Boltun')
-rw-r--r--plugins/Boltun/src/boltun.cpp20
1 files changed, 6 insertions, 14 deletions
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)