summaryrefslogtreecommitdiff
path: root/tipper/tipper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tipper/tipper.cpp')
-rw-r--r--tipper/tipper.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/tipper/tipper.cpp b/tipper/tipper.cpp
index b7268b7..0eabf18 100644
--- a/tipper/tipper.cpp
+++ b/tipper/tipper.cpp
@@ -22,7 +22,7 @@ ColourIDW colour_id_bgw = {0}, colour_id_borderw = {0}, colour_id_dividerw = {0}
HFONT hFontTitle = 0, hFontLabels = 0, hFontValues = 0;
// hooked here so it's in the main thread
-HANDLE hAvChangeEvent = 0, hShowTipEvent = 0, hHideTipEvent = 0, hAckEvent = 0, hFramesSBShow = 0, hFramesSBHide;
+HANDLE hAvChangeEvent = 0, hShowTipEvent = 0, hHideTipEvent = 0, hAckEvent = 0, hFramesSBShow = 0, hFramesSBHide = 0, hSettingChangedEvent = 0;
HANDLE hShowTipService = 0, hShowTipWService = 0, hHideTipService = 0;
@@ -114,6 +114,19 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) {
return 0;
}
+// hack to hide tip when clist hides from timeout
+int SettingChanged(WPARAM wParam, LPARAM lParam) {
+ DBCONTACTWRITESETTING *dcws = (DBCONTACTWRITESETTING *)lParam;
+ if(strcmp(dcws->szModule, "CList") != 0 || strcmp(dcws->szSetting, "State") != 0) return 0;
+
+ // clist hiding
+ if(dcws->value.type == DBVT_BYTE && dcws->value.bVal == 0) {
+ HideTip(0, 0);
+ }
+
+ return 0;
+}
+
int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
if(ServiceExists(MS_UPDATE_REGISTER)) {
// register with updater
@@ -410,10 +423,13 @@ extern "C" int TIPPER_API Load(PLUGINLINK *link) {
hEventPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, Shutdown);
hEventModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ hSettingChangedEvent = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged);
+
return 0;
}
extern "C" int TIPPER_API Unload() {
+ UnhookEvent(hSettingChangedEvent);
UnhookEvent(hEventPreShutdown);
UnhookEvent(hEventModulesLoaded);