summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src/settingsdlg.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-10 12:45:32 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-10 12:45:32 +0000
commit6ac63284a8f93f977db66673727d4995a86764c4 (patch)
tree79d7e0b6744e1de21e6c01c0b0869be8927621a1 /plugins/AutoShutdown/src/settingsdlg.cpp
parent102a413497df49bd2af8ee0a1770718fa0ecfcc2 (diff)
various TTB initialization issues
git-svn-id: http://svn.miranda-ng.org/main/trunk@3957 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown/src/settingsdlg.cpp')
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index f528822c31..84fa86b5e4 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* Menu Item */
static HANDLE hServiceMenuCommand;
-/* Toolbar Button */
-static HANDLE hHookToolbarLoaded;
/* Services */
static HANDLE hServiceShowDlg;
static HWND hwndSettingsDlg;
@@ -407,20 +405,15 @@ static HANDLE hToolbarButton;
static int ToolbarLoaded(WPARAM wParam,LPARAM lParam)
{
- TTBButton ttbb = {0};
- ttbb.cbSize = sizeof(ttbb);
- /* toptoolbar offers icolib support */
- ttbb.hIconUp = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ACTIVE), IMAGE_ICON, 0, 0, 0);
- ttbb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_INACTIVE), IMAGE_ICON, 0, 0, 0);
- ttbb.pszService = "AutoShutdown/MenuCommand";
- ttbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- ttbb.name = LPGEN("Start/Stop automatic shutdown");
- ttbb.pszTooltipUp = LPGEN("Stop automatic shutdown");
- ttbb.pszTooltipDn = LPGEN("Start automatic shutdown");
-
- hToolbarButton = TopToolbar_AddButton(&ttbb);
- if(ttbb.hIconUp != NULL) DestroyIcon(ttbb.hIconUp);
- if(ttbb.hIconDn != NULL) DestroyIcon(ttbb.hIconDn);
+ TTBButton ttb = { sizeof(ttb) };
+ ttb.hIconHandleUp = iconList[1].hIcolib;
+ ttb.hIconHandleDn = iconList[2].hIcolib;
+ ttb.pszService = "AutoShutdown/MenuCommand";
+ ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ ttb.name = LPGEN("Start/Stop automatic shutdown");
+ ttb.pszTooltipUp = LPGEN("Stop automatic shutdown");
+ ttb.pszTooltipDn = LPGEN("Start automatic shutdown");
+ hToolbarButton = TopToolbar_AddButton(&ttb);
return 0;
}
@@ -435,7 +428,6 @@ void SetShutdownToolbarButton(BOOL fActive)
/************************* Menu Item **********************************/
static HANDLE hMainMenuItem,hTrayMenuItem;
-extern IconItem iconList[];
void SetShutdownMenuItem(BOOL fActive)
{
@@ -482,8 +474,7 @@ void InitSettingsDlg(void)
hMainMenuItem=hTrayMenuItem=NULL;
SetShutdownMenuItem(FALSE);
/* Toolbar Item */
- hToolbarButton=0;
- hHookToolbarLoaded=HookEvent(ME_TTB_MODULELOADED,ToolbarLoaded); /* no service to check for */
+ HookEvent(ME_TTB_MODULELOADED,ToolbarLoaded); /* no service to check for */
/* Hotkey */
AddHotkey();
/* Services */
@@ -493,8 +484,6 @@ void InitSettingsDlg(void)
void UninitSettingsDlg(void)
{
- /* Toolbar Item */
- UnhookEvent(hHookToolbarLoaded);
/* Menu Item */
DestroyServiceFunction(hServiceMenuCommand);
/* Services */