private static bool UiaGetIsModal(ProdWindow control) { bool retVal = WindowPatternHelper.GetIsModal(control.UIAElement); LogController.ReceiveLogMessage(new LogMessage(retVal.ToString())); return(retVal); }
/// <summary> /// Gets whether the current window is modal or not /// </summary> /// <param name="windowHandle">NativeWindowHandle to window</param> /// <returns> /// True if window is modal, false otherwise /// </returns> /// <exception cref="ProdOperationException">Examine inner exception</exception> public static bool WindowGetModal(IntPtr windowHandle) { try { return(WindowPatternHelper.GetIsModal(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); } }