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/AutoShutdown/src/settingsdlg.cpp | |
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/AutoShutdown/src/settingsdlg.cpp')
-rw-r--r-- | plugins/AutoShutdown/src/settingsdlg.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 2131c768aa..4c980117f2 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -439,31 +439,28 @@ extern HANDLE hActiveIcon,hInactiveIcon; void SetShutdownMenuItem(BOOL fActive)
{
- CLISTMENUITEM cmi;
- ZeroMemory(&cmi,sizeof(cmi));
- cmi.cbSize=sizeof(cmi);
-
/* main menu */
- cmi.position=2001090000;
- cmi.icolibItem=fActive?hActiveIcon:hInactiveIcon;
- cmi.ptszName=fActive?_T("Stop automatic &shutdown"):_T("Automatic &shutdown..."); /* autotranslated */
- cmi.pszService="AutoShutdown/MenuCommand";
- cmi.flags=CMIF_TCHAR|CMIF_ICONFROMICOLIB;
- if(hMainMenuItem!=NULL) {
- cmi.flags|=CMIM_NAME|CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMainMenuItem,(LPARAM)&cmi);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 2001090000;
+ mi.icolibItem = fActive?hActiveIcon:hInactiveIcon;
+ mi.ptszName = fActive?_T("Stop automatic &shutdown"):_T("Automatic &shutdown..."); /* autotranslated */
+ mi.pszService = "AutoShutdown/MenuCommand";
+ mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB;
+ if (hMainMenuItem != NULL) {
+ mi.flags |= CMIM_NAME|CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMainMenuItem,(LPARAM)&mi);
}
- else hMainMenuItem = Menu_AddMainMenuItem(&cmi);
+ else hMainMenuItem = Menu_AddMainMenuItem(&mi);
/* tray menu */
- cmi.position=899999;
+ mi.position = 899999;
if(hTrayMenuItem!=NULL) {
- cmi.flags|=CMIM_NAME|CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hTrayMenuItem,(LPARAM)&cmi);
+ mi.flags|=CMIM_NAME|CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hTrayMenuItem,(LPARAM)&mi);
}
- else hTrayMenuItem = Menu_AddTrayMenuItem(&cmi);
+ else hTrayMenuItem = Menu_AddTrayMenuItem(&mi);
- Skin_ReleaseIcon(cmi.hIcon);
+ Skin_ReleaseIcon(mi.hIcon);
}
static INT_PTR MenuItemCommand(WPARAM wParam,LPARAM lParam)
|