From 2e5816eef646b4454412dcdeb8e02b674bb81e0b Mon Sep 17 00:00:00 2001 From: sje Date: Thu, 26 Apr 2007 08:31:41 +0000 Subject: hack: hide tip when clist hides due to timeout git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@157 4f64403b-2f21-0410-a795-97e2b3489a10 --- tipper/tipper.cpp | 18 +++++++++++++++++- tipper/version.h | 2 +- 2 files changed, 18 insertions(+), 2 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); diff --git a/tipper/version.h b/tipper/version.h index 114a952..7c287b9 100644 --- a/tipper/version.h +++ b/tipper/version.h @@ -4,7 +4,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 4 #define __RELEASE_NUM 0 -#define __BUILD_NUM 0 +#define __BUILD_NUM 1 #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM #define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM -- cgit v1.2.3