home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / d / d009_2 / 1.ddi / SAMPLES / TRAPS / SAVEUAE.MS$ / SAVEUAE.bin
Encoding:
Text File  |  1992-02-26  |  1.9 KB  |  54 lines

  1. '************************** SAVEUAE.MST *********************************
  2. 'Demonstrates:  Trapping a Windows UAE from a MSTest script
  3. '
  4. 'Required Files: NP.EXE, TOOLHELP.DLL
  5. '
  6. 'Uses: TESTDRVR.EXE built in UAE trap
  7. '
  8. 'Complexity Level: ADVANCED
  9. '
  10. 'Notes: This script runs an invalid version of Windows NotePad, NP.EXE
  11. '       (which is provided with MSTest for use with this sample and
  12. '       should be in the current directory) to demonstrate that this
  13. '       application causes a UAE.  After verifying that the application
  14. '       will UAE, run SAVEUAE2.MST to see an example of trapping the UAE
  15. '
  16. '       NOTE!: This script requires SHELL.DLL from Windows 3.1 to run.  
  17. '
  18. '************************************************************************
  19.  
  20. '$define W_MENU
  21. '$define W_BUTTON
  22. '$define TESTEVNT
  23. '$Include 'MSTEST.INC'
  24.  
  25. '************************* MAIN CODE ************************************
  26.  
  27.     'Hide viewport
  28.     ViewPort OFF
  29.  
  30.     'Slow DoKeys down so you can watch
  31.     QueSetSpeed 10
  32.  
  33.     'RUN invalid version of notepad
  34.     Run "NP.EXE" ,NOWAIT
  35.  
  36.     'Type test into NotePad window to show the user a real UAE
  37.     DoKeys "This is a demonstration of trapping a UAE...{Enter 2}"
  38.     DoKeys "...and saving the file(s) before allowing the UAE to occur...{Enter 2}"
  39.     DoKeys "HELP-ABOUT in this ""invalid"" version of NotePad will UAE!{Enter 2}"
  40.     DoKeys "First, I'll show you that a UAE really occurs...{Enter 2}"
  41.     DoKeys "When you see it, press ENTER or Click OK....{Enter 2}"
  42.     DoKeys ".....Here Goes....{Enter 2}"
  43.     WMenu "&Help"
  44.     WMenu "&About Notepad..."
  45.     WButtonClick "OK"           'This causes a UAE!
  46.  
  47.     'The UAE should have occurred.
  48.     PAUSE "NOTEPAD has terminated after a UAE" + CRLF + "Now we'll do it again, but trap the UAE..." + CRLF + "       (hit ok)"
  49.  
  50.     PAUSE "Please load and run the script SaveUae2.mst"
  51.  
  52. End
  53.  
  54.