public void UpdateCurrentWindow() { int processId = WindowUtilities.GetActiveProcessId(); if (DataModel.ActiveWindow == null || DataModel.ActiveWindow.Process.Id != processId) { DataModel.ActiveWindow = new WindowDataModel(Process.GetProcessById(processId), _quantizerService); } DataModel.ActiveWindow?.UpdateWindowTitle(); }
private void TaskManagerTimerOnElapsed(object sender, ElapsedEventArgs e) { // If task manager has focus then we can't track keys properly, release everything to avoid them getting stuck // Same goes for Idle which is what you get when you press Ctrl+Alt+Del Process active = Process.GetProcessById(WindowUtilities.GetActiveProcessId()); if (active?.ProcessName == "Taskmgr" || active?.ProcessName == "Idle") { _inputService.ReleaseAll(); } }
public void UpdateCurrentWindow() { int processId = WindowUtilities.GetActiveProcessId(); if (DataModel.ActiveWindow == null || DataModel.ActiveWindow.Process.Id != processId) { DataModel.ActiveWindow = new WindowDataModel(Process.GetProcessById(processId)); } if (DataModel.ActiveWindow != null && string.IsNullOrWhiteSpace(DataModel.ActiveWindow.WindowTitle)) { DataModel.ActiveWindow.WindowTitle = Process.GetProcessById(WindowUtilities.GetActiveProcessId()).MainWindowTitle; } }