home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD2.mdf
/
c
/
library
/
mslang
/
cp1
/
nopause1.as!
< prev
next >
Wrap
Text File
|
1993-03-31
|
4KB
|
113 lines
===========================================================================
BBS: The Abacus * HST/DS * Potterville MI
Date: 03-29-93 (17:53) Number: 41
From: GEOFFREY LIU Refer#: NONE
To: JOEL YEN Recvd: NO
Subj: DISABLE THE PAUSE KEY Conf: (35) Quick Basi
---------------------------------------------------------------------------
JY> Hello! Do anyone know how to disable the PAUSE function of the
JY>keyboard? Please leave a message to me. Thanks a lot.
The following routine doesn't really disable the pause button,
but turns it off 18.2 times every second.
'Stardate: 02-01-93
'From: EDWARD LAM
'Conf: NANET-BASIC (44)
' Because B_OnExit might have too many routines registered already, I've made
'NoPause a function returning TRUE(-1) if everything is ok, otherwise FALSE(0).
' The B_OnExit routine does look a little eratic to me in the environment but
'try it and see what happens.
'cut here for NOPDEMO2.BAS
'Example program for NoPause2 module.
'
DECLARE FUNCTION NoPause%
'
CLS
PRINT "Press N for NoPause, U to Unhook NoPause, ESC to exit"
DO
I = (I + 1) MOD 1000
LOCATE 5, 5: PRINT " ";
LOCATE 5, 5: PRINT I;
A$ = UCASE$(INKEY$)
IF A$ = "N" THEN
IF NOT NoPause% THEN 'We call NoPause here
LOCATE 2, 1
PRINT "B_OnExit Full! Can't stop pause key"
END IF
END IF
IF A$ = "U" THEN
CALL UnhookNoPause 'Have option to disable nopause from
'within program
LOCATE 2, 1
PRINT SPACE$(36)
END IF
LOOP UNTIL A$ = CHR$(27)
'Note that we don't care the state of the vectors since B_OnExit will call
'UnHookNoPause for us. You can call UnHookExit as many times as you like
;NoPause2.ASM
;Note that this file has been modified so that the UnHookNoPause routine
;does not need ever (or should it) to be called. --EKL
EXTRN B_OnExit:FAR ;QB's internal routine calls all clean
;up routines registered with it ony _any_ exit
;
; NoPause.ASM by Brent Ashley / NoPause2.ASM modified by Edward Lam 01/31/93
;
.model medium, basic
.code
Old1C Label Dword ;Label for to old Int 1Ch
Old1COffset dw ? ;Offset part
Old1CSegment dw ? ;Segment part
Hooked db 0 ;Our installed flag
;Note that if an error occurs registering NoHookPause, NoPause will return
;FALSE. Right, it's a function now instead of a sub -- EKL
NoPause proc uses ds dx ;From BASIC: Ok% = NoPause%
;Use UnhookNoPause to disable NoPause
cmp cs:Hooked,0 ;Are we already hooked?
jnz InstallExit ;If so, exit
;following section just cut&paste from EVENTCHN.ASM by Jim Mack
mov dx, offset UnHookNoPause
push cs ; push far address of UnHookNoPause
push dx ; to register the exit routine
call B_OnExit ; so that we don't hang machine
or ax, ax ; registered OK?
jz ErrorExit ; error: too many registered routines
mov ax,351Ch ;Get current vector for int 09h
int 21h
mov cs:Old1CSegment,es ;Remember it for later
mov cs:Old1COffset,bx
mov ax,251Ch
push ds
push cs
pop ds ;Point int 1Ch to our code
mov dx, offset OurInt1C
int 21h
pop ds
mov cs:Hooked,-1 ;Set our installed flag
mov ax, -1 ;return TRUE for ok
jmp InstallExit
ErrorExit:
sub ax, ax ;put 0 into ax to return with error
(Continued in the next message)
---
* DeLuxe* 1.26b #11507 * Old MacDonald had a computer, with EIA I/O...
--- FidoPCB v1.4 beta
* Origin: Canada Remote Systems, Mississauga, Ontario (1:229/15)
SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1
SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20