| | |
C expert help me! Write a TSR program that changes the background color ...
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2007
Posts: 5
Reputation:
Solved Threads: 0
Write a TSR program that changes the background color of the screen to red every 5 second and then white next 5 second, And this continues until you press ‘Q’ It should not modify the text displayed on the screen.
Hint:
1_ Intercept Keyboard interrupt (0x09H)
2_ Use video text memory address 0xB000000H
3_ Use timer interrupt.
Hint:
1_ Intercept Keyboard interrupt (0x09H)
2_ Use video text memory address 0xB000000H
3_ Use timer interrupt.
What operating system are you using? I might be wrong but I don't think TSRs work with MS-Windows command prompts because they only emulate MS-DOS.
>>Please sir i can't do
Narue is a woman. And just because you can not do something today doesn't mean you have to give up trying. Search the internet and visit your local bookstore. Or better yet if you are taking a class then study your textbook. But no one here is going to just give you all the code. Learn to reasearch the problem.
>>Please sir i can't do
Narue is a woman. And just because you can not do something today doesn't mean you have to give up trying. Search the internet and visit your local bookstore. Or better yet if you are taking a class then study your textbook. But no one here is going to just give you all the code. Learn to reasearch the problem.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Oct 2007
Posts: 5
Reputation:
Solved Threads: 0
ok , i have done my home work , but this background change function perform with buttons , control and shift , i can't do as requirement , so please help me ..
c Syntax (Toggle Plain Text)
#include <dos.h> #include <stdio.h> #include <conio.h> void interrupt (*oldKey)( ); void interrupt newKey ( ); char far *scr = (char far* ) 0xB8000000; char far *scr1=(char far* ) 0x00400017; int i=0; int main( ) { oldKey = getvect(9); setvect (9,newKey); keep(0,1000); //To Make it TSR return 0; } void interrupt newKey ( ) { if (((*scr1)&4) == 4) /* Ctrl */ { for (i =0; i <=4000; i +=2) { *(scr + i + 1) = 0x40; /* red background */ } } if (((*scr1)&2) == 2) /* Left Shift */ { for (i =0; i <=4000; i +=2) { *(scr + i + 1) = 0x70; /* white background */ } } (*oldKey) ( ); }
Last edited by Ancient Dragon; Oct 12th, 2007 at 5:47 pm. Reason: add code tags
you need to do that in a timer interrupt service so that the service gets called every clock tick. Then inside the service function you need to keep track of the most reent time the color was changed and compare that time with the current time. If 5 or more seconds have elapsed then change the color again and reset your time counter.
The newkey interrupt service you wrote only needs to check if the 'Q' key was hit, and if it has then uninstall both interrupt services you have installed and uninstall the TSR.
None of the above are trivel things to write and will require some research on your part how to do them.
The newkey interrupt service you wrote only needs to check if the 'Q' key was hit, and if it has then uninstall both interrupt services you have installed and uninstall the TSR.
None of the above are trivel things to write and will require some research on your part how to do them.
Last edited by Ancient Dragon; Oct 12th, 2007 at 5:55 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Oct 2007
Posts: 5
Reputation:
Solved Threads: 0
Re: C expert help me! Write a TSR program that changes the background color ...
-1
#8 Oct 12th, 2007
if you can help me please change my code as requirment , if you can not do i will get help from www.cramster.com , cramster experts can do everything,
•
•
•
•
if you can help me please change my code as requirment , if you can not do i will get help from www.cramster.com , cramster experts can do everything,
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- iframe background color - pls help (HTML and CSS)
- TSR program (C)
- How Vb.NET Textbox background color change when TabStop come? (VB.NET)
- VS 2005 ListViews not holding background color (C#)
- help with setting background color!!! (Java)
- Please tell me to write TSR's for windows enviorment (C)
- How to code a program that can show color text output??? (C)
Other Threads in the C Forum
- Previous Thread: Making a letter counting program
- Next Thread: compiler
| Thread Tools | Search this Thread |
* ansi api append array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile creafecopyofanytypeoffileinc createcopyoffile createprocess() dynamic execv fflush file floatingpointvalidation fork forloop frequency function getlogicaldrivestrin givemetehcodez grade graphics gtkwinlinux histogram homework i/o ide inches include infiniteloop initialization input intmain() iso keyboard km license linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft multi mysql oddnumber open opendocumentformat openwebfoundation overwrite pdf pointer pointers posix power program programming pyramidusingturboccodes radix read recursion recv recvblocked reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string strings suggestions test testautomation threads unix urboc user variable whythiscodecausesegmentationfault win32api windowsapi






