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/MetaContacts | |
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/MetaContacts')
-rw-r--r-- | plugins/MetaContacts/src/icons.cpp | 42 | ||||
-rw-r--r-- | plugins/MetaContacts/src/meta_menu.cpp | 3 | ||||
-rw-r--r-- | plugins/MetaContacts/src/meta_services.cpp | 6 |
3 files changed, 24 insertions, 27 deletions
diff --git a/plugins/MetaContacts/src/icons.cpp b/plugins/MetaContacts/src/icons.cpp index e6cbc9a3a3..54f56e2a84 100644 --- a/plugins/MetaContacts/src/icons.cpp +++ b/plugins/MetaContacts/src/icons.cpp @@ -30,34 +30,32 @@ void ReleaseIconEx(HICON hIcon) int ReloadIcons(WPARAM wParam, LPARAM lParam)
{
// fix menu icons
- CLISTMENUITEM menu = {0};
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON;
- menu.cbSize = sizeof(menu);
- menu.flags = CMIM_ICON;
+ mi.hIcon = LoadIconEx(Meta_IsEnabled() ? I_MENUOFF : I_MENU);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(Meta_IsEnabled() ? I_MENUOFF : I_MENU);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
-
- menu.hIcon = LoadIconEx(I_CONVERT);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_CONVERT);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(I_ADD);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_ADD);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(I_EDIT);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_EDIT);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(I_SETDEFAULT);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_SETDEFAULT);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
- menu.hIcon = LoadIconEx(I_REMOVE);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&menu);
- ReleaseIconEx(menu.hIcon);
+ mi.hIcon = LoadIconEx(I_REMOVE);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&mi);
+ ReleaseIconEx(mi.hIcon);
return 0;
}
diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp index 743b25c838..0d7d82d7a7 100644 --- a/plugins/MetaContacts/src/meta_menu.cpp +++ b/plugins/MetaContacts/src/meta_menu.cpp @@ -394,7 +394,6 @@ INT_PTR TranslateMenuFunc(HANDLE hMeta, int contact_number) { */
int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM mi;
DBVARIANT dbv;
HANDLE hContact;
char *proto;
@@ -402,8 +401,8 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) int i, iconIndex;
WORD status;
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
- mi.cbSize = sizeof(CLISTMENUITEM);
if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,-1) != (DWORD)-1)
{
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index c837a7b1c8..d205ff9a6e 100644 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -1489,9 +1489,9 @@ int Meta_CallMostOnline(WPARAM wParam, LPARAM lParam) { }
-INT_PTR Meta_OnOff(WPARAM wParam, LPARAM lParam) {
- CLISTMENUITEM mi;
- mi.cbSize = sizeof(CLISTMENUITEM);
+INT_PTR Meta_OnOff(WPARAM wParam, LPARAM lParam)
+{
+ CLISTMENUITEM mi = { sizeof(mi) };
// just write to db - the rest is handled in the Meta_SettingChanged function
if (db_get_b(0, META_PROTO, "Enabled", 1)) {
db_set_b(0, META_PROTO, "Enabled", 0);
|