Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ WindowVisualState IWindowProvider.VisualState

WindowInteractionState IWindowProvider.InteractionState
{
// Note: we should consider Implementing InteractionState by finding the gui thread of the
// Note: we should consider Implementing InteractionState by finding the gui thread of the
// process and mapping ThreadState and WaitReason to a WindowInteractionState
get
{
Expand Down Expand Up @@ -1457,6 +1457,21 @@ private static bool IsWindowReallyEnabled( NativeMethods.HWND hwnd )
// Check that a window is visible, and has a non-empty rect
private static bool IsWindowReallyVisible( NativeMethods.HWND hwnd )
{
// check for visibility overrides
// The UIA team says:
// * UIA_WindowVisibilityOverridden property was added in 2011 for Win8.1
// * "I'm not actually sure it is documented publicly."
// * "It's a window property that if its handle value is 1 it's ForceVisible, and if it's 2 it's ForceHidden."
IntPtr visibilityOverride = UnsafeNativeMethods.GetProp(hwnd, "UIA_WindowVisibilityOverridden");
if (visibilityOverride == new IntPtr(1))
{
return true;
}
else if (visibilityOverride == new IntPtr(2))
{
return false;
}

if(!SafeNativeMethods.IsWindowVisible(hwnd))
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,5 +365,12 @@ internal struct MENUBARINFO
[DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
internal static extern bool DeleteObject(IntPtr hrgn);

//
// Window Property Functions
//

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
internal static extern IntPtr GetProp(IntPtr hwnd, string name);

}
}