home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cenvi23.zip / KEYGHOST.CMD < prev    next >
OS/2 REXX Batch file  |  1995-10-13  |  3KB  |  78 lines

  1. EXTPROC CEnvi2
  2. //**************************************************************************
  3. //*** KeyGhost.cmd - Example for how to control other programs using the ***
  4. //*** ver.2          the keyboard stuffing routines in KeyPush.Lib.      ***
  5. //**************************************************************************
  6.  
  7. #include <KeyPush.lib>
  8.  
  9. // Start e.exe running, and give it time to get going
  10.    system("Start /F /N E.EXE");
  11.    suspend(3000)
  12.  
  13. // Let's use a BIG helvetica font
  14.    //KeyStroke(VK_ALT,'o');  // options
  15.    //KeyStroke('f');         // fonts
  16.    //SpeedKeys("Helv");      // select the Helvetica font
  17.    //KeyStroke(VK_TAB),KeyStroke(VK_TAB);   // Tab twice to get to size
  18.    //KeyStroke(VK_PAGEDOWN); // page down to a BIG font
  19.    //KeyStroke(VK_ENTER);    // Select OK
  20.  
  21. // Enter initial CEnvi sentence
  22.    // KeyPushFocusID("E.EXE",False);
  23.    SpeedKeys("CEnvi is good.");
  24.  
  25. // Change "good" to "great"
  26.    for ( i = 0; i < 5; i++ )
  27.       KeyStroke(VK_SHIFT,VK_LEFT)
  28.    SpeedKeys("great!");
  29.  
  30. // Figure out how much it costs per day for a year
  31.    SpeedKeys("\r\rIs CEnvi worth 69 dollars?"
  32.              "\rTo use it every day for a year costs ");
  33.  
  34. //**** THIS PART OF EXAMPLE REMOVED BECAUSE       ****
  35. //**** CALCULATOR IS NO LONGER INCLUDED WITH WARP ****
  36. //// Bring up calculator to figure $69.00 / 365 * 100
  37. //   system("start /PM /B PMDCalc.EXE");
  38. //   suspend(1000);
  39. //   system("call Switch Calculator");
  40. //
  41. //// Perform calculation for costs
  42. //   // KeyPushFocusID("Calculator",False);
  43. //   SpeedKeys("A69.00/365=*100=",200);   // perform calculation
  44. //   suspend(500);
  45. //
  46. //// Kill the calculator
  47. //   suspend(3000);
  48. //   KeyStroke(VK_ALT,VK_F4);
  49.  
  50.   SpeedKeys("69.00/365*100",150);
  51.   for ( i = 0; i < 13; i++ )
  52.      KeyStroke(VK_SHIFT,VK_LEFT)
  53.  
  54. // Print the results of the calculation
  55. //   system("call Switch E.EXE");
  56.    // KeyPushFocusID("E.EXE",False);
  57.    SpeedKeys("18.9",100);
  58.    SpeedKeys(" pennies a day.\rWhat a bargain!");
  59.  
  60. // now print the message to register
  61.    SpeedKeys("\r\rRegister now!");
  62. // copy the Register message just printed and print it many more times
  63.    KeyStroke(VK_SHIFT,VK_HOME);
  64.    KeyStroke(VK_SHIFT,VK_UP);
  65.    KeyStroke(VK_CTRL,VK_INSERT);
  66.    KeyStroke(VK_DOWN), KeyStroke(VK_END);
  67.    KeyStroke(VK_RIGHT); // just in case not ALL the way at the end
  68. // print that message another 15 times
  69.    for ( i = 0; i < 7; i++ )
  70.       KeyStroke(VK_SHIFT,VK_INSERT);
  71.  
  72. // finally, say goodbye and exit
  73.    suspend(500);
  74.    SpeedKeys("\rThank you.");
  75.    KeyStroke(VK_ALT,VK_F4);
  76.    //suspend(2000); KeyPushFocusID("Warning",False);
  77.    KeyStroke('d');
  78.