home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
554
/
MAI
/
CURS_OS2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-10-07
|
2KB
|
56 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 190 of 288
From : Andres Cvitkovich 2:310/36.9 25 May 93 23:26
To : Michael Harris 1:216/506.0
Subj : Restore Cursor under OS/2-DOS
────────────────────────────────────────────────────────────────────────────────
Hi Michael,
Friday, May 21 1993, Michael Harris wrote to Anyone:
MH> I was wondering if anyone knew a way to remove/restore the cursor in a
MH> way that will work under regular DOS and OS/2-DOS. I have tried
MH> several different ways, all of them work under DOS, but not OS/2.
MH> Well, let me clarify that - they all can make the cursor go away under
MH> OS/2-DOS, but none of them have been successful in bringing it back.
MH> Any help would be greatly appreciated, because I always like my
MH> programs to work under OS/2-DOS as well as DOS for the convenience of
MH> the OS/2 users out there (myself included).
no problem at all: ;-)
>-----------------------------------------------------------}
Procedure CursorOff; Assembler;
Asm
Push BP
Xor AX, AX
Mov ES, AX
Mov BH, Byte Ptr ES:[462h] { get active page }
Mov AH, 3
Int 10h { get cursor characteristics }
Or CH, 32
Mov AH, 1
Int 10h { set cursor characteristics }
Pop BP
End;
Procedure CursorOn; Assembler;
Asm
Push BP
Xor AX, AX
Mov ES, AX
Mov BH, Byte Ptr ES:[462h] { get active page }
Mov AH, 3
Int 10h { get cursor characteristics }
And CH, 31
Mov AH, 1
Int 10h { set cursor characteristics }
Pop BP
End;
{>-----------------------------------------------------------
All you need is TP6 or higher. There are other solutions but this one has the
advantage that you don't depend from the type of graphic card installed. The
cursor is being restored to exactly the same shape it had before.}