From c8a87e7d8f6a82bac4f99695227ba00591044b1d Mon Sep 17 00:00:00 2001 From: White-Tiger Date: Sat, 24 Feb 2018 10:00:26 +0100 Subject: [PATCH] Injection: disable "TaskbarCreated" handling during hook postponing (prevents multiple messages) #118 --- src/Clock/main.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Clock/main.c b/src/Clock/main.c index b6773a8f..62ddc169 100644 --- a/src/Clock/main.c +++ b/src/Clock/main.c @@ -498,16 +498,21 @@ static void InjectClockHook(HWND hwnd) { DebugLog(1, "injecting T-Clock... (%i)", g_explorer_restarts); if(ticks - s_restart_ticks < 30000){ if(g_explorer_restarts >= 3){ - if(api.Message(0, - L"Multiple Explorer crashes or restarts detected\n" - L"It's possible that T-Clock is crashing your Explorer,\n" - L"automated hooking postponed.\n" - L"\n" - L"Take precaution and exit T-Clock now?", L"T-Clock", MB_YESNO|MB_SETFOREGROUND, MB_ICONEXCLAMATION) == IDYES) { + ticks = g_WM_TaskbarCreated; + g_WM_TaskbarCreated = 0x7FFF; // highest valid WM_USER to temporarily disable WM_TaskbarCreated + retry = api.Message(0, + L"Multiple Explorer crashes or restarts detected\n" + L"It's possible that T-Clock is crashing your Explorer,\n" + L"automated hooking postponed.\n" + L"\n" + L"Take precaution and exit T-Clock now?", L"T-Clock", MB_YESNO|MB_SETFOREGROUND, MB_ICONEXCLAMATION); + g_WM_TaskbarCreated = ticks; + if(retry == IDYES) { SendMessage(hwnd, WM_CLOSE, 0, 0); return; } - s_restart_ticks = GetTickCount(); + ticks = GetTickCount(); + s_restart_ticks = ticks; g_explorer_restarts = 0; } }else{