private void tick() { try { uint ProcessId; WindowHandles.GetWindowThreadProcessId(WindowHandles.GetForegroundWindow(), out ProcessId); using (Process processById = Process.GetProcessById((int)ProcessId)) base.Value = (object)processById.MainModule.FileName; } catch (Exception ex) { base.Unavailable(); } }
private void tick() { try { uint ProcessId; WindowHandles.GetWindowThreadProcessId(WindowHandles.GetForegroundWindow(), out ProcessId); using (Process processById = Process.GetProcessById((int)ProcessId)) base.Value = !processById.Responding ? (object)"INACTIVE" : (object)"ACTIVE"; } catch (Exception ex) { base.Unavailable(); } }