Ejemplo n.º 1
0
        public ExternalApplication?GetForegroundApplication()
        {
            using var window  = SystemWindow.GetForegroundWindow();
            using var process = window?.GetProcess();

            var executableFilePath = process?.GetExecutableFilePath();

            return(!string.IsNullOrWhiteSpace(executableFilePath)
                ? new ExternalApplication(executableFilePath)
                : null);
        }
Ejemplo n.º 2
0
 public bool IsForegroundApplicationFullScreen()
 {
     using var window = SystemWindow.GetForegroundWindow();
     return(window != null && window.IsVisible() && !window.IsSystemWindow() && window.IsFullScreen());
 }