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 --- protocols/FacebookRM/src/theme.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'protocols/FacebookRM/src') diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 5d7c002398..021e8a6fcc 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -200,8 +200,7 @@ void UninitContactMenus() void EnableMenuItem(HANDLE hMenuItem, bool enable) { - CLISTMENUITEM clmi = {0}; - clmi.cbSize = sizeof(CLISTMENUITEM); + CLISTMENUITEM clmi = { sizeof(clmi) }; clmi.flags = CMIM_FLAGS; if (!enable) clmi.flags |= CMIF_HIDDEN; @@ -236,13 +235,11 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) strcpy(text,m_szModuleName); char *tDest = text+strlen(text); - HGENMENU hRoot; CLISTMENUITEM mi = {sizeof(mi)}; mi.pszService = text; - hRoot = MO_GetProtoRootMenu(m_szModuleName); - if (hRoot == NULL) - { + HGENMENU hRoot = MO_GetProtoRootMenu(m_szModuleName); + if (hRoot == NULL) { mi.popupPosition = 500085000; mi.hParentMenu = HGENMENU_ROOT; mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | ( this->isOnline() ? 0 : CMIF_GRAYED ); @@ -311,8 +308,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) void FacebookProto::ToggleStatusMenuItems( BOOL bEnable ) { - CLISTMENUITEM clmi = { 0 }; - clmi.cbSize = sizeof( CLISTMENUITEM ); + CLISTMENUITEM clmi = {sizeof(clmi)}; clmi.flags = CMIM_FLAGS | (( bEnable ) ? 0 : CMIF_GRAYED); CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )m_hMenuRoot, ( LPARAM )&clmi ); -- cgit v1.2.3