Engine.RegisterModalWindow
- Updated2025-07-21
- 2 minute(s) read
Engine.RegisterModalWindow
Syntax
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.
Purpose
Notifies TestStand that the specified window is a modal dialog box.
Remarks
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.
Parameters
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.