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