Fix for generating the list of windows which can be selected.

Fix for including the credentials of the web services in azure-pipelines.yml
This commit is contained in:
Robin Krom 2020-03-07 17:19:45 +01:00
commit 043b6048ae
2 changed files with 23 additions and 6 deletions

View file

@ -548,13 +548,21 @@ namespace GreenshotPlugin.Core
User32.ShowWindow(Handle, ShowWindowCommand.Hide);
}
/// <summary>
/// Returns if this window is cloaked
/// </summary>
public bool IsCloaked
{
get => DWM.IsWindowCloaked(Handle);
}
/// <summary>
/// Gets whether the window is visible.
/// </summary>
public bool Visible {
get {
// Tip from Raymond Chen
if (DWM.IsWindowCloaked(Handle))
if (IsCloaked)
{
return false;
}
@ -1525,6 +1533,12 @@ namespace GreenshotPlugin.Core
/// <returns>bool</returns>
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;
}