public bool IsForegroundApplicationFullScreen() { var window = SystemWindow.TryGetForegroundWindow(); return (window != null && window.IsVisible() && !window.IsSystemWindow() && window.IsFullScreen()); }
public ExternalApplication?TryGetForegroundApplication() { var window = SystemWindow.TryGetForegroundWindow(); using var process = window?.TryGetProcess(); var executableFilePath = process?.TryGetExecutableFilePath(); return(!string.IsNullOrWhiteSpace(executableFilePath) ? new ExternalApplication(executableFilePath) : null); }