home *** CD-ROM | disk | FTP | other *** search
- /**
- * SHOWHELP.C Simple example of Turbo C TOOLS help system
- * usage.
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1989
- *
- **/
-
- #include <stdio.h>
- #include <bhelp.h>
- #include <bmouse.h>
-
- void main(void);
-
- void main(void)
- {
- PAGE_STATE page_state;
- ADAP_STATE adapter_state;
- WN_EVENT final;
-
- /* Save the state of the video adapter, including */
- /* the contents of the screen. */
- scgetvid(&adapter_state);
- if (scsavepg(&page_state) == SC_NO_MEMORY)
- {
- printf("Not enough memory to save screen image!\n");
- exit (-1);
- }
-
- scpclr();
-
- /* Set the limits for window scroll delay, mouse */
- /* button hold events, and mouse button clicks. */
- b_win_delay = 0;
- b_win_hold = 4L;
- b_clicklimit = 4L;
-
- /* Now display the screen and read user responses */
- /* until a transmit or abort event occurs. */
- if (&final != hldisp("showhelp.hlp", "sample", 0L, &final,
- HL_USE_MOUSE))
- {
- printf("Error number %d encountered during HLDISP!\n",
- b_wnerr);
- exit(-1);
- }
-
- /* Restore the video adapter state. */
- if (screstpg(&page_state) == SC_NO_MEMORY)
- {
- printf("Not enough memory to restore screen image!\n");
- exit (-1);
- }
- scsetvid(&adapter_state);
-
- /* The help routines allocate space for the final */
- /* event's action list; free the list. */
- free(final.pdata);
-
- exit(0);
- }
-