From 30707c980d1560b358dbf2671a4d2a26a1e8173c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Nov 2012 21:45:37 +0000 Subject: various menu initialization quirks git-svn-id: http://svn.miranda-ng.org/main/trunk@2552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Boltun/src/boltun.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'plugins/Boltun') 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) -- cgit v1.2.3