private static bool UiaGetIsTopmost(ProdWindow control) { bool retVal = WindowPatternHelper.GetIsTopmost(control.UIAElement); LogController.ReceiveLogMessage(new LogMessage(retVal.ToString())); return(retVal); }
/// <summary> /// Gets a value whether a window is set to be topmost in the z-order /// </summary> /// <param name="windowHandle">NativeWindowHandle to window</param> /// <returns> /// True if window is topmost, false otherwise /// </returns> /// <exception cref="ProdOperationException">Examine inner exception</exception> public static bool WindowIsTopmost(IntPtr windowHandle) { try { return(WindowPatternHelper.GetIsTopmost(AutomationElement.FromHandle(windowHandle))); } catch (InvalidOperationException err) { throw new ProdOperationException(err.Message, err); } catch (ElementNotAvailableException err) { throw new ProdOperationException(err.Message, err); } catch (ArgumentException err) { throw new ProdOperationException(err.Message, err); } }