Microsoft KB Archive/86689

= Microsoft Knowledge Base =

Test for Windows Cannot Test a System-Modal Dialog Box
Last reviewed: October 19, 1994

Article ID: Q86689

The information in this article applies to:

- Microsoft Test for Windows, versions 1.0 and 2.0

SUMMARY
Microsoft Test for Windows cannot test a system-modal dialog box. System-modal dialog boxes effectively shut down the system until the user supplies the required information.

MORE INFORMATION
The following actions are prevented by system-modal dialog boxes:


 * Sending intertask messages
 * Changing the focus
 * Activating another application

Test for Windows simulates user input to an application by sending messages to the application. Because system-modal dialog boxes prevent intertask messaging, Test cannot send messages to it.

Example
The following program demonstrates that Test cannot test a system-modal dialog box. The Program Manager displays a system-modal dialog box when you attempt to close Windows. The example program selects the Program Manager File menu, chooses Exit, then attempts to shift the focus from the OK button to the Cancel button. The focus correctly does not shift.

' $Define W_WINDOW. REM $INCLUDE: 'mstest.inc' hwnd% = WFndWnd(&quot;Program Manager&quot;, FW_ALL Or FW_FULL Or FW_FOCUS)

DoKeys &quot;%fx&quot;   ' File/Exit. DoKeys &quot;{tab}&quot; ' Focus will not shift.