home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 2.ddi / TOOLS.2 / EXAMPLES / SHOWHELP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.4 KB  |  63 lines

  1. /**
  2. *    SHOWHELP.C    Simple example of Turbo C TOOLS help system
  3. *            usage.
  4. *
  5. *  Version    6.00 (C)Copyright Blaise Computing Inc. 1989
  6. *
  7. **/
  8.  
  9. #include <stdio.h>
  10. #include <bhelp.h>
  11. #include <bmouse.h>
  12.  
  13. void main(void);
  14.  
  15. void main(void)
  16. {
  17.     PAGE_STATE page_state;
  18.     ADAP_STATE adapter_state;
  19.     WN_EVENT   final;
  20.  
  21.         /* Save the state of the video adapter, including   */
  22.         /* the contents of the screen.                */
  23.     scgetvid(&adapter_state);
  24.     if (scsavepg(&page_state) == SC_NO_MEMORY)
  25.     {
  26.     printf("Not enough memory to save screen image!\n");
  27.     exit (-1);
  28.     }
  29.  
  30.     scpclr();
  31.  
  32.         /* Set the limits for window scroll delay, mouse    */
  33.         /* button hold events, and mouse button clicks.     */
  34.     b_win_delay  = 0;
  35.     b_win_hold     = 4L;
  36.     b_clicklimit = 4L;
  37.  
  38.         /* Now display the screen and read user responses   */
  39.         /* until a transmit or abort event occurs.        */
  40.     if (&final != hldisp("showhelp.hlp", "sample", 0L, &final,
  41.              HL_USE_MOUSE))
  42.     {
  43.     printf("Error number %d encountered during HLDISP!\n",
  44.            b_wnerr);
  45.     exit(-1);
  46.     }
  47.  
  48.         /* Restore the video adapter state.            */
  49.     if (screstpg(&page_state) == SC_NO_MEMORY)
  50.     {
  51.     printf("Not enough memory to restore screen image!\n");
  52.     exit (-1);
  53.     }
  54.     scsetvid(&adapter_state);
  55.  
  56.         /* The help routines allocate space for the final   */
  57.         /* event's action list; free the list.              */
  58.     free(final.pdata);
  59.  
  60.     exit(0);
  61. }
  62.  
  63.