summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-07 20:38:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-07 20:38:34 +0000
commit37690f6a83f2935292f28cdec8340c206a2f3aac (patch)
treebbd87013cecd8dc3aa06cf5a7cfe707de657cde7 /plugins/TopToolBar
parent990064649ebc7b3df17b3784b6c38d6a09df39ec (diff)
fix for top toolbar drawing in Clist Nicer & Clist Modern
git-svn-id: http://svn.miranda-ng.org/main/trunk@838 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r--plugins/TopToolBar/InternalButtons.cpp6
-rw-r--r--plugins/TopToolBar/common.h2
-rw-r--r--plugins/TopToolBar/toolbar.cpp21
3 files changed, 25 insertions, 4 deletions
diff --git a/plugins/TopToolBar/InternalButtons.cpp b/plugins/TopToolBar/InternalButtons.cpp
index 2a79cd566f..4551d55c7d 100644
--- a/plugins/TopToolBar/InternalButtons.cpp
+++ b/plugins/TopToolBar/InternalButtons.cpp
@@ -1,9 +1,9 @@
#include "common.h"
-#define TTBI_GROUPSHOWHIDE "TTBInternal/GroupShowHide"
-#define TTBI_SOUNDSONOFF "TTBInternal/SoundsOnOFF"
-#define TTBI_MAINMENUBUTT "TTBInternal/MainMenuBUTT"
+#define TTBI_GROUPSHOWHIDE "TTBInternal/GroupShowHide"
+#define TTBI_SOUNDSONOFF "TTBInternal/SoundsOnOFF"
+#define TTBI_MAINMENUBUTT "TTBInternal/MainMenuBUTT"
int LoadInternalButtons( HWND );
int UnLoadInternalButtons();
diff --git a/plugins/TopToolBar/common.h b/plugins/TopToolBar/common.h
index 432879c57f..3ce3807d57 100644
--- a/plugins/TopToolBar/common.h
+++ b/plugins/TopToolBar/common.h
@@ -121,7 +121,7 @@ char *AS(char *str, const char *setting, char *addstr)
return str;
}
-#define TTB_LAUNCHSERVICE "TTB/LaunchSerice"
+#define TTB_LAUNCHSERVICE "TTB/LaunchService"
INT_PTR TTBAddButton(WPARAM, LPARAM);
INT_PTR TTBRemoveButton(WPARAM, LPARAM);
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp
index f2e9932738..7dc3535efb 100644
--- a/plugins/TopToolBar/toolbar.cpp
+++ b/plugins/TopToolBar/toolbar.cpp
@@ -1,6 +1,9 @@
#include "common.h"
+pfnCustomProc g_CustomProc = NULL;
+LPARAM g_CustomProcParam = 0;
+
HWND hwndContactList = 0;
HWND hwndTopToolBar = 0;
bool StopArrange;
@@ -756,6 +759,16 @@ static INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam)
CallService(MS_SYSTEM_REMOVEWAIT, wParam, 0);
StopArrange = FALSE;
NotifyEventHooks(hHookTTBModuleLoaded, 0, 0);
+
+ if (g_CustomProc) {
+ mir_cslock lck(csButtonsHook);
+
+ for (int i=0; i < Buttons.getCount(); i++) {
+ TopButtonInt* p = Buttons[i];
+ g_CustomProc((HANDLE)p->id, p->hwnd, g_CustomProcParam);
+ }
+ }
+
return 0;
}
@@ -772,6 +785,13 @@ static int OnBGChange(WPARAM wParam, LPARAM lParam)
return 0;
}
+static INT_PTR TTBSetCustomProc(WPARAM wParam, LPARAM lParam)
+{
+ g_CustomProc = (pfnCustomProc)wParam;
+ g_CustomProcParam = lParam;
+ return 0;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
int OnModulesLoad(WPARAM wParam, LPARAM lParam)
@@ -829,6 +849,7 @@ int LoadToolbarModule()
CreateServiceFunction(TTB_LAUNCHSERVICE, LaunchService);
+ CreateServiceFunction("TopToolBar/SetCustomProc", TTBSetCustomProc);
CreateServiceFunction("TTB_ONSTARTUPFIRE", OnEventFire);
BUTTHEIGHT = DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTHEIGHT", DEFBUTTHEIGHT);