diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-28 21:45:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-28 21:45:37 +0000 |
commit | 30707c980d1560b358dbf2671a4d2a26a1e8173c (patch) | |
tree | 74aee5adaaac976e1398274ca64c5461a60f1feb /plugins/FloatingContacts/src | |
parent | 335ec43a4bfdcbbd0b2257037f1f3e0553d89076 (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/FloatingContacts/src')
-rw-r--r-- | plugins/FloatingContacts/src/main.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
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;
}
|