home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / cenvi29.zip / KEYGHOST.CMD < prev    next >
OS/2 REXX Batch file  |  1994-05-19  |  2KB  |  72 lines

  1. EXTPROC CEnvi
  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 45 dollars?"
  32.              "\rTo use it every day for a year costs ");
  33.  
  34. // Bring up calculator to figure $45.00 / 365 * 100
  35.    system("start /PM /B PMDCalc.EXE");
  36.    suspend(1000);
  37.    system("call Switch Calculator");
  38.  
  39. // Perform calculation for costs
  40.    // KeyPushFocusID("Calculator",False);
  41.    SpeedKeys("A45.00/365=*100=",200);   // perform calculation
  42.    suspend(500);
  43.  
  44. // Kill the calculator
  45.    suspend(3000);
  46.    KeyStroke(VK_ALT,VK_F4);
  47.  
  48. // Print the results of the calculation
  49.    system("call Switch E.EXE");
  50.    // KeyPushFocusID("E.EXE",False);
  51.    SpeedKeys("12.3",100);
  52.    SpeedKeys(" pennies a day.\rWhat a bargain!");
  53.  
  54. // now print the message to register
  55.    SpeedKeys("\r\rRegister now!");
  56. // copy the Register message just printed and print it many more times
  57.    KeyStroke(VK_SHIFT,VK_HOME);
  58.    KeyStroke(VK_SHIFT,VK_UP);
  59.    KeyStroke(VK_CTRL,VK_INSERT);
  60.    KeyStroke(VK_DOWN), KeyStroke(VK_END);
  61.    KeyStroke(VK_RIGHT); // just in case not ALL the way at the end
  62. // print that message another 15 times
  63.    for ( i = 0; i < 7; i++ )
  64.       KeyStroke(VK_SHIFT,VK_INSERT);
  65.  
  66. // finally, say goodbye and exit
  67.    suspend(500);
  68.    SpeedKeys("\rThank you.");
  69.    KeyStroke(VK_ALT,VK_F4);
  70.    //suspend(2000); KeyPushFocusID("Warning",False);
  71.    KeyStroke('d');
  72.