Example #1
0
/*---------------------------------------------------------
-- show a message when TClock failed to customize the clock
---------------------------------------------------------*/
void InitError(int n)
{
	char s[160];
	
	wsprintf(s, "%s: %d", MyString(IDS_NOTFOUNDCLOCK), n);
	api.Message(NULL, s, "Error", MB_OK, MB_ICONEXCLAMATION);
}
Example #2
0
static void InjectClockHook(HWND hwnd) {
	static DWORD s_restart_ticks = 0;
	static int s_restart_num = 0;
	DWORD ticks = GetTickCount();
	if(ticks - s_restart_ticks < 30000){
		if(++s_restart_num >= 3){
			if(api.Message(0,
					"Multiple Explorer crashes or restarts detected\n"
					"It's possible that T-Clock is crashing your Explorer,\n"
					"automated hooking postponed.\n"
					"\n"
					"Take precaution and exit T-Clock now?","T-Clock",MB_YESNO,MB_ICONEXCLAMATION) == IDYES) {
				SendMessage(hwnd, WM_CLOSE, 0, 0);
				return;
			}
			s_restart_ticks = GetTickCount();
			s_restart_num = 0;
		}
	}else{
		s_restart_ticks = ticks;
		s_restart_num = 0;
	}
	api.Inject(hwnd);
	#ifndef _DEBUG
	EmptyWorkingSet(GetCurrentProcess());
	#endif
}