Hi Ruel,
There is no such a property. I suggest using the following procedure to determine whether there is a modal WPF dialog:
1. Get the main window object.
2. Get the window object of the dialog you want to check.
3. Try to activate the main window.
4. Find out whether the OnUnexpectedWindow event is raised.
To determine whether this event has been raised, follow the steps below:
1. Set a global project variable (see the 'Project and Project Suite Variables - Overview' help topic).
2. Set your own handler for the OnUnexpectedWindow event. It should be like this:
function GeneralEvents_OnUnexpectedWindow(Sender, Window, LogParams)
{
Project.Variables.Var1 = true;
}
Here is a script example. It works with the Orders.exe sample application:
[JScript]
function checkModal(mainWindow)
{
Project.Variables.Var1 = false;
mainWindow.Activate();
if (Project.Variables.Var1)
Log.Message("Modal");
else
Log.Message("Modeless");
}
function Test1()
{
var orders, grid, listView;
var testedWnd, mainWnd;
TestedApps.Orders.Run();
orders = Sys.Process("Orders");
mainWnd = orders.WPFObject("HwndSource: MainForm");
grid = orders.WPFObject("HwndSource: MainForm").MainForm.WPFObject("gridMain");
grid.MainMenu.WPFMenu.Click("Orders|Edit order...");
testedWnd = orders.Window("#32770", "Warning");
checkModal(mainWnd);
TestedApps.CloseAll();
}