home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: DFÜ und Kommunikation / SOS-DFUE.ISO / programm / windows / terminal / hawtd1 / sview.c < prev    next >
Encoding:
Text File  |  1993-04-26  |  1.2 KB  |  45 lines

  1. /* This program, sview.c, created by Hilgraeve and assigned to the View */
  2. /* button, cycles the Phonebook between various views, as if you selected */
  3. /* View|[Icon][Details][Statistics]. */
  4.  
  5. /* $Revision: 1.1 $ */
  6. /* $Date: 1993/04/26 15:20:58 $ */
  7.  
  8. /* Define main function, which is always the starting point of C programs. */
  9. /* (The term "void" indicates that the function returns no value.) */
  10. void main ()
  11.     {
  12.     /* Declares a variable and initializes it to zero. */
  13.     long ScriptHandle = 0;
  14.     int DisplayMode;
  15.  
  16.     /* Establish a link between this script program and HA/Win */
  17.     ScriptHandle = haInitialize(0, 0, 0, 0);
  18.  
  19.     /* Exit if intialization of link with HA/Win failed */
  20.     if (ScriptHandle == 0) exit();
  21.     
  22.     /* Check current phonebook display */
  23.     DisplayMode = haGetDisplay(ScriptHandle);
  24.  
  25.     /* Cycle through display modes */
  26.     switch (DisplayMode)
  27.         {
  28.         case 1:
  29.             DisplayMode = 2;
  30.             break;
  31.         case 2:
  32.             DisplayMode = 3;
  33.             break;
  34.         default:
  35.             DisplayMode = 1;
  36.             break;
  37.         }
  38.  
  39.     /* Change phonebook display */
  40.     haSetDisplay(ScriptHandle, DisplayMode);
  41.  
  42.     /* Terminate link between HA/Win and script program */
  43.     haTerminate(ScriptHandle, 0);
  44.     }
  45.