home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progc
/
c_all592.arj
/
TI712.ASC
< prev
next >
Wrap
Text File
|
1992-02-25
|
3KB
|
133 lines
PRODUCT : Borland C++ NUMBER : 712
VERSION : 2.0
OS : DOS
DATE : February 25, 1992 PAGE : 1/2
TITLE : Cursor Control Functions
These functions permit cursor control using the DOS Services.
They are not guaranteed to work on any given setup.
The bottom line is: if they work for you, GREAT!
/**********************************************************************/
#include <dos.h>
int CURSOR = 7;
/**********************************************************************/
/* Routine turns off the cursor on the default screen.
*/
/**********************************************************************/
void cursor_off(void)
{
union REGS regs;
regs.x.ax = 0x0100;
regs.x.cx = 0x2000;
int86 (0x10, ®s, ®s);
}
/**********************************************************************/
/* Routine turns on the cursor on the default screen.
*/
/**********************************************************************/
void cursor_on(void)
{
union REGS regs;
regs.x.ax = 0x0100;
regs.h.ch = CURSOR - 1;
regs.h.cl = CURSOR;
int86 (0x10, ®s, ®s);
}
PRODUCT : Borland C++ NUMBER : 712
VERSION : 2.0
OS : DOS
DATE : February 25, 1992 PAGE : 2/2
TITLE : Cursor Control Functions
/**********************************************************************/
/* Routine changes the cursor size on the default screen.
*/
/**********************************************************************/
void cursor_size(int lo, int hi)
{
union REGS regs;
regs.h.ah = 0x0001;
regs.h.ch = lo;
regs.h.cl = hi;
int86 (0x10, ®s, ®s);
}
/**********************************************************************/
/* Routine to test the cursor functions.
*/
/**********************************************************************/
#include <stdio.h>
void main(void)
{
int i;
printf("Changing cursor size: ");
for (i=0; i<11; i++)
{
cursor_size(0,i);
delay(250);
}
cursor_size(6,7);
printf("\nThe cursor should be off!\n");
cursor_off();
sleep(3);
cursor_on();
printf("The cursor should be on!\n");
}