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/MenuItemEx/src/main.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'plugins/MenuItemEx/src') 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; -- cgit v1.2.3