home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_02 / 1n02084a < prev    next >
Text File  |  1990-07-09  |  780b  |  35 lines

  1.  
  2. #include <dos.h>
  3.  
  4. void interrupt (*oldint)();
  5.  
  6. main()
  7. {
  8.  
  9. int status;
  10.  
  11. oldint=getvect(0x50);   /* Save the interrupt vector before use
  12. */
  13.  
  14.  
  15. geninterrupt(5);        /* Call Interrupt 05h to print the screen
  16.  
  17. status=peekb(0x0050,0); /* Check the status of the Print Screen
  18.                            Operation */
  19.  
  20. if(status==0)           /* Print Screen successful */
  21.         exit(0);
  22. else
  23. if(status==1)           /* Print Screen Interrupt in use */
  24.         printf("Screen printing in progress.");
  25. else                    /* Error occured */
  26.         {
  27.         printf("Error, couldn't print the screen at this time.");
  28.         printf("\nProgram terminating!");
  29.         exit(0);
  30.         }
  31.  
  32. setvect(0x50,oldint);   /* Reset the interrupt vector */
  33.  
  34. }
  35.