home *** CD-ROM | disk | FTP | other *** search
/ Mega CD-ROM 1 / megacd_rom_1.zip / megacd_rom_1 / DESQVIEW / API_EXAM.ZIP / HELLO.C < prev    next >
C/C++ Source or Header  |  1988-04-28  |  1KB  |  67 lines

  1. /****************************************************************
  2. *
  3. *  Name:          HELLO
  4. *
  5. *  Function:      display "hello world" in the task window
  6. *
  7. *  Shows how to:  1. write a "minimal" DESQview-specific program.
  8. *                 2. initialize and disable the C interfaces.
  9. *                 3. detect DESQview's presence.
  10. *                 4. enable DESQview extensions.
  11. *                 5. write to the default task window.
  12. *
  13. ****************************************************************/
  14.  
  15. #include <stdio.h>
  16. #include "dvapi.h"
  17.  
  18. /* minimum API version required */
  19. #define required 0x201
  20.  
  21. /* actual API version */
  22. int  version;
  23.  
  24.  
  25. /**********************************************************************
  26. *  main  -  check for DESQview present and enable required extensions.
  27. ***********************************************************************/
  28.  
  29. main () {
  30.   /* initialize C interfaces and get API version number */
  31.   version = api_init();
  32.  
  33.   /* if DESQview is not running or version is too low, display a message */ 
  34.   if (version < required) {
  35.     printf ("This program requires DESQview version %d.02%d or later.\n",
  36.              required/256,required%256);
  37.     }
  38.  
  39.   /* tell DESQview what extensions to enable */
  40.   else {
  41.     api_level (required);
  42.  
  43.     /* extend greetings */
  44.     win_printf (win_me(),"hello world\n");
  45.     }
  46.  
  47.   /* disable C interfaces and return from program */
  48.   api_exit();
  49.   }
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.