home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Direkt 1995 #6
/
CDD_6_95.ISO
/
cdd
/
winanw
/
hawin
/
attmail.c
next >
Wrap
C/C++ Source or Header
|
1994-12-07
|
2KB
|
59 lines
/* This program attmail.c created by Hilgraeve and assigned to the attmail session*/
/* runs an automated logon script for connecting to AT&T Mail. */
/* $Revision: 1.2 $ */
/* $Date: 1994/11/14 16:10:35 $ */
/* Define main function, which is always the starting point of C programs. */
/* (The term "void" indicates that the function returns no value.) */
void main()
{
/* Declare variables */
long ScriptHandle;
int ReturnValue;
char Buffer[128];
/* Initialize variables */
ReturnValue = 0;
ScriptHandle = 0;
/* Establish a link between this script program and HyperACCESS */
ScriptHandle = haInitialize(0,0,0,0);
/* Exit if intialization of link with HyperACCESS failed */
if (ScriptHandle == 0) exit();
/* Type two consecutive <Enter> with pauses */
haSleep(ScriptHandle, 2197L);
haTypeText(ScriptHandle, 0, "\r");
haSleep(ScriptHandle, 494L);
haTypeText(ScriptHandle, 0, "\r");
/* Wait for a prompt */
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "User Name: ", 300L, 32000L);
/* Get User Name value from Runtime Values dialog box */
if (ReturnValue >= 0)
ReturnValue = haGetRuntimeValue(ScriptHandle, 1, 1, 128, Buffer);
/* Type the value */
if (ReturnValue >= 0)
ReturnValue = haTypeText(ScriptHandle, 0, Buffer);
/* Wait for a prompt */
if (ReturnValue >= 0)
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "assword:", 300L, 32000L);
/* Get Password value from Runtime Values dialog box */
if (ReturnValue >= 0)
ReturnValue = haGetRuntimeValue(ScriptHandle, 3, 1, 128, Buffer);
/* Type the value */
if (ReturnValue >= 0)
ReturnValue = haTypeText(ScriptHandle, 0, Buffer);
/* Terminate link between HyperACCESS and script program */
haTerminate(ScriptHandle, 0);
}