mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
#1960: Also ignore cloaked windows in region capture
This commit is contained in:
parent
dc1dce8b7a
commit
a948c6f793
2 changed files with 8 additions and 6 deletions
|
@ -351,12 +351,14 @@ public static bool IsWindowMaximized(IntPtr handle)
|
||||||
|
|
||||||
public static bool IsWindowCloaked(IntPtr handle)
|
public static bool IsWindowCloaked(IntPtr handle)
|
||||||
{
|
{
|
||||||
if (!IsDWMEnabled())
|
if (IsDWMEnabled())
|
||||||
return false;
|
{
|
||||||
|
int cloaked;
|
||||||
|
int result = DwmGetWindowAttribute(handle, (int)DwmWindowAttribute.Cloaked, out cloaked, sizeof(int));
|
||||||
|
return result == 0 && cloaked != 0;
|
||||||
|
}
|
||||||
|
|
||||||
int cloaked;
|
return false;
|
||||||
int result = DwmGetWindowAttribute(handle, (int)DwmWindowAttribute.Cloaked, out cloaked, sizeof(int));
|
|
||||||
return result == 0 && cloaked != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IntPtr SetHook(int hookType, HookProc hookProc)
|
public static IntPtr SetHook(int hookType, HookProc hookProc)
|
||||||
|
|
|
@ -111,7 +111,7 @@ private bool EvalControl(IntPtr hWnd, IntPtr lParam)
|
||||||
|
|
||||||
private bool CheckHandle(IntPtr handle, bool isWindow)
|
private bool CheckHandle(IntPtr handle, bool isWindow)
|
||||||
{
|
{
|
||||||
if (handle == IgnoreHandle || !NativeMethods.IsWindowVisible(handle))
|
if (handle == IgnoreHandle || !NativeMethods.IsWindowVisible(handle) || (isWindow && NativeMethods.IsWindowCloaked(handle)))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue