RegisterModalWindow Method

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)


Engine.RegisterModalWindow ( sequenceContextParam, modalHWND, shouldAbort)

Return Value


Returns the modalID to pass to the Engine.UnregisterModalWindow method when the dialog box no longer appears on screen.


Notifies TestStand that the specified window is a modal dialog box.


Call this method after you create a modal dialog box. TestStand disables the main application window and forwards any activation requests to the specified window. Call the Engine.UnregisterModalWindow method when the dialog box closes.

You must call this method after you have created the dialog box window. An alternative to using this method is to call the Engine.NotifyStartOfModalDialogEx method, which you must call before creating the dialog box window.

For a Microsoft Visual Basic modal dialog box, if you display the dialog box from multiple threads at the same time, you must use an executable ActiveX Automation server project and set the project settings to Thread Per Object.


sequenceContextParam As SequenceContext

[In] If you display the dialog box from the step of an execution, pass the sequence context of the step; otherwise, pass a NULL reference. If you pass a sequence context, this method serializes calls from multiple threads the same way the Engine.NotifyStartOfModalDialogEx method serializes calls.

modalHWND As Long

[In] Specifies the window handle of the modal dialog box.

shouldAbort As Boolean

[Out] Returns True when the user terminates or aborts the corresponding execution for the sequence context parameter you passed while you were blocked inside this method call. The step skips launching the dialog box and returns as soon as possible. You can call Engine.UnregisterModalWindow in this case, though it is not necessary.

See Also






Not Helpful