Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

NotifyStartOfModalDialogEx Method

NI TestStand™ 4.0 Help
April 2007

NI Part Number:
370052F-01

»View NI TestStand Product Info

Syntax

Engine.NotifyStartOfModalDialogEx ( sequenceContextParam, shouldAbort)

Return Value

long

Returns the modalID to pass to NotifyEndOfModalDialog when your dialog box no longer appears onscreen.

Purpose

Notifies TestStand that you are about to launch a modal dialog box.

Remarks

This method returns a modalID, which you pass to NotifyEndOfModalDialog when the dialog box is closed. TestStand uses this notification to determine when to disable the main window of your application and to enforce the modality of your dialog box.

LabVIEW modal dialog box

Call Start Modal Dialog.vi and End Modal Dialog.vi in TestStand.llb instead of Engine.NotifyStartOfModalDialogEx and Engine.NotifyEndOfModalDialog.

LabWindows/CVI modal dialog box

Call TS_EndModalDialog or TS_StartModalDialogEx in <TestStand>\API\CVI\tsutil.fp instead of Engine.NotifyStartOfModalDialogEx and Engine.NotifyEndOfModalDialog.

Note  Do not call this method when displaying a dialog box that the TestStand API implements.

Note  This method differs from Engine.NotifyStartOfModalDialog in that if multiple threads call into this method at the same time, only the first thread proceeds. The rest block until the first thread calls NotifyEndOfModalDialog, at which point the next thread proceeds. Thus, TestStand displays modal dialog boxes one at a time using this method. In order to use this method, you must launch your dialog box within the step of an execution and you must pass the sequence context of the step to this method.

In certain environments, dialog boxes may take a parameter that is a parent window handle. For this situation, call this method before creating your dialog box, treat the return value as a window handle (HWND), and pass the return value as the handle for the parent window. For environments such as Microsoft Visual Basic, in which setting the parent window handle of dialog boxes is difficult, use the RegisterModalWindow method instead.

Note  The Engine.NotifyStartOfModalDialog property is obsolete. Use NotifyStartOfModalDialogEx instead.

Parameters

sequenceContextParam As SequenceContext

[In] Pass the sequence context of the step displaying the modal dialog box. You can also pass a NULL reference, but you will lose the added functionality of this method.

shouldAbort As Boolean

[Out] If this parameter returns True, the corresponding execution for the sequence context parameter you passed has been terminated or aborted by the user while you were blocked inside this method call. Your step should skip the display of its dialog box and return as soon as possible. You may call NotifyEndOfModalDialog in this case, though it is not necessary. If you are using the CVI TS_StartModalDialogEx function, always call the corresponding TS_EndModalDialog function. Similarly, if you are using Start Modal Dialog.vi in LabVIEW, always call End Modal Dialog.vi.


See Also

NotifyEndOfModalDialog

RegisterModalWindow

UnregisterModalWindow


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit