I wrote this program to keep users from breaking a dos written program from crashing with the CTRL-C key combination.
Because of an internet website that is capturing the right mouse click and is not functioning properly to copy the text highlighted contents to clipboard, we are having to use the CTRL-C key to copy the marked highlighted text to the clipboard from the web page inside of the web browser.
Apparently the user hit the CRTL-C inside the dos program that was running and caused the program to have issues because it is run in batch mode JCL like form.
I think(hope) this TSR program will capture the CTRL-C keys and disguard any unwanted keys shortly there after. It seems to be working with the test i have done.
In windows xp, I could not find a way to keep the TRS from loading a second instance of itself more than once which is OK because the batch file that starts the console program ends and does not loop back to the begging in any manner. But, it would great if I could stop the multiple instances of this PBDOS program.
But here it is anyways and it does not appear to stop batch file when mutlitple CTRL-C keys are pressed, but it appears to stop the CTRL-C in a dos program.
The batch file that i tested to see if this program would stop it was just a simple BATCH program that looped running the DIR windows os program.
Here is the simple batch routine that will eventually allow you abort out of using a CTRL-C with this program running, but we do not plan to for our JCL like third program like be broken like this simple batch routine.
All i wanted to do was try to intercept the Ctrl-C key combination and keep it from reaching the third party dos program.
Because of an internet website that is capturing the right mouse click and is not functioning properly to copy the text highlighted contents to clipboard, we are having to use the CTRL-C key to copy the marked highlighted text to the clipboard from the web page inside of the web browser.
Apparently the user hit the CRTL-C inside the dos program that was running and caused the program to have issues because it is run in batch mode JCL like form.
I think(hope) this TSR program will capture the CTRL-C keys and disguard any unwanted keys shortly there after. It seems to be working with the test i have done.
In windows xp, I could not find a way to keep the TRS from loading a second instance of itself more than once which is OK because the batch file that starts the console program ends and does not loop back to the begging in any manner. But, it would great if I could stop the multiple instances of this PBDOS program.
But here it is anyways and it does not appear to stop batch file when mutlitple CTRL-C keys are pressed, but it appears to stop the CTRL-C in a dos program.
The batch file that i tested to see if this program would stop it was just a simple BATCH program that looped running the DIR windows os program.
Here is the simple batch routine that will eventually allow you abort out of using a CTRL-C with this program running, but we do not plan to for our JCL like third program like be broken like this simple batch routine.
All i wanted to do was try to intercept the Ctrl-C key combination and keep it from reaching the third party dos program.
Code:
TSRCTRLC.EXE :START DIR SLEEP1 GOTO START
Code:
REM TSRCTRLC.BAS REM TSR TO PREVENT CTRL-C characters being input REM this progam will popup and back down on a CTRL-C character input REM POWERBASIC SOURCE CODE REM VERSION 03-22-2018 REM COMPILED WITH POWERBASIC 3.5 FOR DOS REM $CPU 80386 'program works on any CPU $CPU 80386 'program works on only 80386 CPU $OPTIMIZE SIZE 'make smallest possible executable $DEBUG MAP OFF 'turn off map file generation $DEBUG PBDEBUG OFF 'don't include pbdebug support in our executable $LIB COM OFF 'turn off PowerBASIC's communications library. $LIB CGA OFF 'turn off PowerBASIC's CGA graphics library. $LIB EGA OFF 'turn off PowerBASIC's EGA graphics library. $LIB VGA OFF 'turn off PowerBASIC's EGA graphics library. $LIB FULLFLOAT OFF 'turn off PowerBASIC's floating point support. $ERROR BOUNDS ON 'turn on bounds checking $ERROR NUMERIC OFF 'turn off numeric checking $ERROR OVERFLOW OFF 'turn off overflow checking $ERROR STACK OFF 'turn off stack checking $COM 0 'set communications buffer to nothing $STRING 1 'set largest string size at 1k $STACK 2048 'let's use a 2k stack $SOUND 0 'smallest music buffer possible $DYNAMIC 'all arrays will be dynamic by default $OPTION CNTLBREAK OFF 'don't allow Ctrl-Break to exit program $COMPILE EXE 'this tells PB to make a standalone EXE $EVENT OFF ON ERROR GOTO ErrorHandler x& = SETMEM( -700000 ) 'release unused memory POPUP KEY CHR$(04,&H2E,&H73) 'CTRL-C key press PRINT "loaded TSRCTRLC.EXE to block CTRL-C input" POPUP SLEEP ' before going to sleep WHILE 1 = 1 I&=0 ' PRINT "CTRL C WAS ENTERED " ' PRINT "DONE GOING TO SLEEP" A$=INKEY$ WHILE LEN(A$) A$=INKEY$ WEND POPUP SLEEP 'going to sleep WEND END ErrorHandler: RESUME NEXT
Comment