From 043b6048aea975bf26540582ad5e4d355ce48037 Mon Sep 17 00:00:00 2001 From: Robin Krom Date: Sat, 7 Mar 2020 17:19:45 +0100 Subject: [PATCH] Fix for generating the list of windows which can be selected. Fix for including the credentials of the web services in azure-pipelines.yml --- GreenshotPlugin/Core/WindowDetails.cs | 18 ++++++++++++++++-- azure-pipelines.yml | 11 +++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/GreenshotPlugin/Core/WindowDetails.cs b/GreenshotPlugin/Core/WindowDetails.cs index 10f087163..883c7aa1e 100644 --- a/GreenshotPlugin/Core/WindowDetails.cs +++ b/GreenshotPlugin/Core/WindowDetails.cs @@ -548,13 +548,21 @@ namespace GreenshotPlugin.Core User32.ShowWindow(Handle, ShowWindowCommand.Hide); } + /// + /// Returns if this window is cloaked + /// + public bool IsCloaked + { + get => DWM.IsWindowCloaked(Handle); + } + /// /// Gets whether the window is visible. /// public bool Visible { get { // Tip from Raymond Chen - if (DWM.IsWindowCloaked(Handle)) + if (IsCloaked) { return false; } @@ -1525,6 +1533,12 @@ namespace GreenshotPlugin.Core /// bool private static bool IsTopLevel(WindowDetails window) { + // Window is not on this desktop + if (window.IsCloaked) + { + return false; + } + // Ignore windows without title if (window.Text.Length == 0) { @@ -1535,7 +1549,7 @@ namespace GreenshotPlugin.Core return false; } // Windows without size - if (window.WindowRectangle.Size.IsEmpty) + if (window.WindowRectangle.Size.Width * window.WindowRectangle.Size.Height == 0) { return false; } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e912f8839..25ca84c4f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,10 +19,13 @@ stages: vmImage: 'Windows-latest' variables: - solution: 'Greenshot.sln' - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - group: 'Plug-in Credentials' + - group: 'Plug-in Credentials' + - name: solution + value: 'Greenshot.sln' + - name: buildPlatform + value: 'Any CPU' + - name: buildConfiguration + value: 'Release' steps: - task: NuGetToolInstaller@1