PRODUCT : TURBO C NUMBER : 396 VERSION : 1.0 OS : PC-DOS DATE : November 18, 1987 PAGE : 1/2 TITLE : CAPTURING INTERRUPTS The following program demonstrates the use of getvect and setvect to safely capture and restore interrupt vectors. This code could be easily modified to disable the print screen utility during program execution. #include #include void interrupt (*oldfunc)(); int __LOOPING__ = 1; /*-------------------------------------------------------------------- * get_out - this is our new interrupt routine *------------------------------------------------------------------*/ void interrupt get_out() { setvect(5,oldfunc); /* restore to original interrupt routine */ __LOOPING__ = 0; } /*-------------------------------------------------------------------- * capture_prtscr - installs a new interrupt for * arguments : func -- new interrupt function pointer *------------------------------------------------------------------*/ void capture_prtscr(void interrupt (*func)()) { oldfunc = getvect(5); /* save the old interrupt */ setvect(5,func); /* install our interrupt handler */ } void main () { puts("Press to terminate"); capture_prtscr(get_out); /* capture the print screen interrupt */ while (__LOOPING__) ; /* do nothing */ puts("Success"); } PRODUCT : TURBO C NUMBER : 396 VERSION : 1.0 OS : PC-DOS DATE : November 18, 1987 PAGE : 2/2 TITLE : CAPTURING INTERRUPTS DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.