plz write newfunc() .
A TSR program that changes the background color of the screen to red whenever ‘Ctrl’ is pressed and white whenever ‘Left Shift’ is pressed. It should not modify the text displayed on the screen.


Hint:

Intercept Keyboard interrupt (0x09H)
Use video text memory address 0xB000000H

#include <dos.h>
void interrupt (*old)();
void interrupt newfunc();
char far *keybord=(char far* ) 0x00400017; //keyboard status
 
char far *scr=(char far* ) 0x0xB000000; //address of text area 
void main()
{
     old=getvect(0x09);
     setvect(0x09,newfunc);
     keep(0,1000);
}
     void interrupt newfunc ()
     {

Write code here that changes the background color of the screen to red whenever ‘Ctrl’ is pressed and white whenever ‘Left Shift’ is pressed. It should not modify the text displayed on the screen.


(*old)();

}

Are we talking about doing something that back in 1995 the computer industry left behind? Are you running DOS or a command line from XP?

And is this homework from a school teaching obsolete practices or from your Dad's (or Granddad's?) old textbook?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.