home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_06 / 1n06058a < prev    next >
Text File  |  1990-08-24  |  808b  |  36 lines

  1. /* 
  2.  * Microsoft C version of Print Screen routine,
  3.  *    compiled under C 6.0
  4.  */
  5.  
  6. #include <dos.h>
  7.  
  8. /* Macro to peek at a specific memory address */
  9. #define peek(addr)  (*(unsigned char _far *)addr)
  10.  
  11. union REGS inregs, outregs;
  12.  
  13. void main()
  14. {
  15.     int status;
  16.  
  17.                 /* Call Interrupt 05h to print the screen */
  18.     int86( 0x05, &inregs, &outregs );
  19.  
  20.                 /* Get value in Print Screen status byte */
  21.     status = peek(0x00500000);
  22.  
  23.  
  24.     if (status == 0)    /* Print Screen successful */
  25.         exit (0);
  26.  
  27.     else if (status == 1)   /* Print Screen in progress */
  28.         printf("Screen printing in progress.\n");
  29.  
  30.     else            /* Error occured */
  31.         {
  32.         printf("Error - couldn't print the screen.\n");
  33.         exit(0);
  34.         }
  35. }
  36.