home *** CD-ROM | disk | FTP | other *** search
- EXTPROC CEnvi
- //**************************************************************************
- //*** KeyGhost.cmd - Example for how to control other programs using the ***
- //*** ver.1 the keyboard stuffing routines in KeyPush.Lib. ***
- //**************************************************************************
-
- #include <KeyPush.lib>
-
- // Start e.exe running, and give it time to get going
- system("Start /F /N E.EXE");
- suspend(3000)
-
- // Let's use a BIG helvetica font
- //KeyStroke(VK_ALT,'o'); // options
- //KeyStroke('f'); // fonts
- //SpeedKeys("Helv"); // select the Helvetica font
- //KeyStroke(VK_TAB),KeyStroke(VK_TAB); // Tab twice to get to size
- //KeyStroke(VK_PAGEDOWN); // page down to a BIG font
- //KeyStroke(VK_ENTER); // Select OK
-
- // Enter initial CEnvi sentence
- // KeyPushFocusID("E.EXE",False);
- SpeedKeys("CEnvi is good.");
-
- // Change "good" to "great"
- for ( i = 0; i < 5; i++ )
- KeyStroke(VK_SHIFT,VK_LEFT)
- SpeedKeys("great!");
-
- // Figure out how much it costs per day for a year
- SpeedKeys("\r\rIs CEnvi worth 38 dollars?"
- "\rTo use it every day for a year costs ");
-
- // Bring up calculator to figure $38.00 / 365 * 10
- system("start /PM /B PMDCalc.EXE");
- suspend(1000);
- system("call Switch Calculator");
-
- // Perform calculation for costs
- // KeyPushFocusID("Calculator",False);
- SpeedKeys("A38.00/365=*100=",200); // perform calculation
- suspend(500);
-
- // Kill the calculator
- suspend(3000);
- KeyStroke(VK_ALT,VK_F4);
-
- // Print the results of the calculation
- system("call Switch E.EXE");
- // KeyPushFocusID("E.EXE",False);
- SpeedKeys("10.4",100);
- SpeedKeys(" pennies a day.\rWhat a bargain!");
-
- // now print the message to register
- SpeedKeys("\r\rRegister now!");
- // copy the Register message just printed and print it many more times
- KeyStroke(VK_SHIFT,VK_HOME);
- KeyStroke(VK_SHIFT,VK_UP);
- KeyStroke(VK_CTRL,VK_INSERT);
- KeyStroke(VK_DOWN), KeyStroke(VK_END);
- KeyStroke(VK_RIGHT); // just in case not ALL the way at the end
- // print that message another 15 times
- for ( i = 0; i < 7; i++ )
- KeyStroke(VK_SHIFT,VK_INSERT);
-
- // finally, say goodbye and exit
- suspend(500);
- SpeedKeys("\rThank you.");
- KeyStroke(VK_ALT,VK_F4);
- //suspend(2000); KeyPushFocusID("Warning",False);
- KeyStroke('d');