Microsoft KB Archive/82154

= Microsoft Knowledge Base =

WINTEST.MST Sample May Open or Restore Other Applications
Last reviewed: October 19, 1994

Article ID: Q82154

The information in this article applies to:

- Microsoft Test for Windows, version 1.0

SYMPTOMS
Running the WINTEST.MST sample test script (provided with Microsoft Test version 1.0 for Windows) may result in an unrelated application being started or a minimized application being restored when the WINTEST.MST script closes Paintbrush.

CAUSE
This error occurs because of an error in the sample script.

RESOLUTION
Change the last two lines of the WINTEST.MST script from:

XAlt &quot;f&quot; XEnter &quot;x&quot; To:

XAlt &quot;f&quot; XText &quot;x&quot;

STATUS
Microsoft has confirmed this to be a problem with the WINTEST.MST sample script provided with Microsoft Test version 1.0 for Windows.

MORE INFORMATION
The last two lines of the WINTEST.MST script call the FastTest routines XAlt and XEnter to close the active application, Paintbrush, as follows:

XAlt &quot;f&quot; XEnter &quot;x&quot; The code above sends three keystrokes: ALT+F, X, and ENTER. Because Paintbrush closes itself after receiving the ALT+F, X combination, the ENTER key event does not go to Paintbrush, but instead goes to whatever window becomes the active window when Paintbrush closes. If the next active window happens to be Windows Program Manager, the ENTER key will cause one of your applications listed in Program Manager to start running. If all windows are minimized, the ENTER key event will cause one of them to be restored to normal size.

To avoid this problem, use the XText statement instead of XEnter, as follows:

XAlt &quot;f&quot; XText &quot;x&quot;