home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: DFÜ und Kommunikation / SOS-DFUE.ISO / programm / windows / terminal / hawtd1 / mcimail.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-11  |  1.7 KB  |  60 lines

  1. /* This program mcimail.c created by Hilgraeve and assigned to the mcimail session*/
  2. /* runs an automated logon script for connecting to MCI Mail.                    */
  3.  
  4. /*    $Revision: 1.2 $  */
  5. /*    $Date: 1993/06/11 16:33:56 $  */
  6.  
  7. /* Define main function, which is always the starting point of C programs. */
  8. /* (The term "void" indicates that the function returns no value.) */
  9. void main()
  10.     {
  11.     /* Declare variables */
  12.     long ScriptHandle;
  13.     int ReturnValue;
  14.     char Buffer[128];
  15.  
  16.     /* Initialize variables */
  17.     ReturnValue = 0;
  18.     ScriptHandle = 0;
  19.  
  20.     /* Establish a link between this script program and HA/Win */
  21.     ScriptHandle = haInitialize(0,0,0,0);
  22.  
  23.     /* Exit if intialization of link with HA/Win failed */
  24.     if (ScriptHandle == 0) exit();
  25.  
  26.     ReturnValue = -1;
  27.     /* Wait for the user name prompt */
  28.     while (ReturnValue < 0)
  29.         {
  30.         ReturnValue = haWaitForString(ScriptHandle, 1, " name: ", 3000L);
  31.         if (ReturnValue < 0)
  32.             haTypeText(ScriptHandle, 0, "\r");
  33.         }
  34.  
  35.     /* Get User Name value from Runtime values dialog box */
  36.     if (ReturnValue >= 0)
  37.         ReturnValue = haGetRuntimeValue(ScriptHandle, 1, 1, 128, Buffer);
  38.  
  39.     /* Type the value */
  40.     if (ReturnValue >= 0)
  41.         ReturnValue = haTypeText(ScriptHandle, 0, Buffer);
  42.  
  43.     /* Wait for a prompt */
  44.     if (ReturnValue >= 0)
  45.         ReturnValue = haWaitForString(ScriptHandle, 1, "sword: ", 32000L);
  46.  
  47.     /* Get Password value from Runtime Values dialog box */
  48.     if (ReturnValue >= 0)
  49.         ReturnValue = haGetRuntimeValue(ScriptHandle, 3, 1, 128, Buffer);
  50.  
  51.     /* Type the value */
  52.     if (ReturnValue >= 0)
  53.         ReturnValue = haTypeText(ScriptHandle, 0, Buffer);
  54.  
  55.     /* Terminate link between HA/Win and script program */
  56.     haTerminate(ScriptHandle, 0);
  57.     }
  58.  
  59.  
  60.