home *** CD-ROM | disk | FTP | other *** search
- '************************** SAVEUAE.MST *********************************
- 'Demonstrates: Trapping a Windows UAE from a MSTest script
- '
- 'Required Files: NP.EXE, TOOLHELP.DLL
- '
- 'Uses: TESTDRVR.EXE built in UAE trap
- '
- 'Complexity Level: ADVANCED
- '
- 'Notes: This script runs an invalid version of Windows NotePad, NP.EXE
- ' (which is provided with MSTest for use with this sample and
- ' should be in the current directory) to demonstrate that this
- ' application causes a UAE. After verifying that the application
- ' will UAE, run SAVEUAE2.MST to see an example of trapping the UAE
- '
- ' NOTE!: This script requires SHELL.DLL from Windows 3.1 to run.
- '
- '************************************************************************
-
- '$define W_MENU
- '$define W_BUTTON
- '$define TESTEVNT
- '$Include 'MSTEST.INC'
-
- '************************* MAIN CODE ************************************
-
- 'Hide viewport
- ViewPort OFF
-
- 'Slow DoKeys down so you can watch
- QueSetSpeed 10
-
- 'RUN invalid version of notepad
- Run "NP.EXE" ,NOWAIT
-
- 'Type test into NotePad window to show the user a real UAE
- DoKeys "This is a demonstration of trapping a UAE...{Enter 2}"
- DoKeys "...and saving the file(s) before allowing the UAE to occur...{Enter 2}"
- DoKeys "HELP-ABOUT in this ""invalid"" version of NotePad will UAE!{Enter 2}"
- DoKeys "First, I'll show you that a UAE really occurs...{Enter 2}"
- DoKeys "When you see it, press ENTER or Click OK....{Enter 2}"
- DoKeys ".....Here Goes....{Enter 2}"
- WMenu "&Help"
- WMenu "&About Notepad..."
- WButtonClick "OK" 'This causes a UAE!
-
- 'The UAE should have occurred.
- PAUSE "NOTEPAD has terminated after a UAE" + CRLF + "Now we'll do it again, but trap the UAE..." + CRLF + " (hit ok)"
-
- PAUSE "Please load and run the script SaveUae2.mst"
-
- End
-
-