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 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'tipper/tipper.cpp') 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); -- cgit v1.2.3