コード例 #1
0
        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();
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
ファイル: GeneralModule.cs プロジェクト: qwertyquerty/Artemis
        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;
            }
        }