summaryrefslogtreecommitdiff
path: root/plugins/NewEventNotify
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
commit30707c980d1560b358dbf2671a4d2a26a1e8173c (patch)
tree74aee5adaaac976e1398274ca64c5461a60f1feb /plugins/NewEventNotify
parent335ec43a4bfdcbbd0b2257037f1f3e0553d89076 (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/NewEventNotify')
-rw-r--r--plugins/NewEventNotify/src/menuitem.cpp30
-rw-r--r--plugins/NewEventNotify/src/options.cpp4
2 files changed, 16 insertions, 18 deletions
diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp
index 6831c204a1..99e35c4740 100644
--- a/plugins/NewEventNotify/src/menuitem.cpp
+++ b/plugins/NewEventNotify/src/menuitem.cpp
@@ -1,6 +1,6 @@
/*
Name: NewEventNotify - Plugin for Miranda IM
- File: menuitem.c - Manages item(s) in the Miranda Menu
+ File: mi.c - Manages item(s) in the Miranda Menu
Version: 0.0.4
Description: Notifies you about some events
Author: icebreaker, <icebreaker@newmail.net>
@@ -24,7 +24,6 @@
#include "neweventnotify.h"
-CLISTMENUITEM menuitem;
HANDLE hMenuitemNotify;
BOOL bNotify;
@@ -40,14 +39,14 @@ static INT_PTR MenuitemNotifyCmd(WPARAM wParam,LPARAM lParam)
int MenuitemUpdate(BOOL bStatus)
{
- //menuitem.flags = CMIM_FLAGS | (bStatus ? CMIF_CHECKED : 0);
- menuitem.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(bStatus ? IDI_ENABLED : IDI_DISABLED));
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(bStatus ? IDI_ENABLED : IDI_DISABLED));
if (bStatus)
- menuitem.ptszName = TranslateT(MENUITEM_DISABLE);
+ mi.ptszName = TranslateT(MENUITEM_DISABLE);
else
- menuitem.ptszName = TranslateT(MENUITEM_ENABLE);
- menuitem.flags = CMIM_ICON | CMIM_NAME | CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuitemNotify, (LPARAM)&menuitem);
+ mi.ptszName = TranslateT(MENUITEM_ENABLE);
+ mi.flags = CMIM_ICON | CMIM_NAME | CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuitemNotify, (LPARAM)&mi);
return 0;
}
@@ -56,14 +55,13 @@ int MenuitemInit(BOOL bStatus)
{
CreateServiceFunction(MS_NEN_MENUNOTIFY, MenuitemNotifyCmd);
- ZeroMemory(&menuitem, sizeof(menuitem));
- menuitem.cbSize = sizeof(CLISTMENUITEM);
- menuitem.position = 1;
- menuitem.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ENABLED));
- menuitem.ptszPopupName = TranslateT("PopUps");
- menuitem.pszService = MS_NEN_MENUNOTIFY;
- menuitem.flags = CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
- hMenuitemNotify = Menu_AddMainMenuItem(&menuitem);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 1;
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ENABLED));
+ mi.ptszPopupName = TranslateT("PopUps");
+ mi.pszService = MS_NEN_MENUNOTIFY;
+ mi.flags = CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
+ hMenuitemNotify = Menu_AddMainMenuItem(&mi);
bNotify = bStatus;
MenuitemUpdate(bNotify);
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp
index 2e22a9f5cd..648e15c7de 100644
--- a/plugins/NewEventNotify/src/options.cpp
+++ b/plugins/NewEventNotify/src/options.cpp
@@ -263,7 +263,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, L
options->colBackOthers = SendDlgItemMessage(hWnd, IDC_COLBACK_OTHERS, CPM_GETCOLOUR, 0, 0);
options->colTextOthers = SendDlgItemMessage(hWnd, IDC_COLTEXT_OTHERS, CPM_GETCOLOUR, 0, 0);
}
- //send changes to menuitem
+ //send changes to mi
MenuitemUpdate(!options->bDisable);
//enable "Apply" button
SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0);
@@ -282,7 +282,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, L
case PSN_RESET:
OptionsRead();
- //maybe something changed with the menuitem
+ //maybe something changed with the mi
MenuitemUpdate(!options->bDisable);
break;
}