🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4511

Re: How to turn the cursor off

#4511
From: Brian K. W. Hook
Date: Sun, 03 Feb 1991 07:24
45 lines
1882 bytes
In article <29796@usc> dank@calvin.usc.edu (Dan King) writes:
>
>Here's one that I'm sure is in every compendium of Frequently Asked
>Questions that has ever existed:
>
>Using Turbo C (v2.0->I know it's outdated, but it's what I've been
>using for years), how do I turn off the infernal cursor?  I'm using
>lots-o-console IO routines and the blinking cursor is really annoying.
>Any help would be appreciated.
>
>dank

Well, I guess that there are two common methods of turning off the cursor
in text mode on a PC.  The first is via moving the cursor off the screen
to a NULL location, or just setting its size to zero.  I set the size
to zero....

void cursorOff ( void )
{
union REGS regs;

	regs.h.ah=0x01;	/* Subfunction 0x01 is set cursor size */
	regs.x.cx=0x00; /* CH and CL are both set to zero for start and */
			/* and ending scan lines */
	int86(0x10,&regs,&regs); /* Generate an interrupt to 0x10, the */
				 /* video interrupt */
}

Note that usually you will also want to save the cursor size.  For more
information, refer to "The New Peter Norton Programmer's Guide to The IBM
PC and PS/2".

Another method is via using inline asm...I use TC++, so I don't know if
the syntax is the same as TC 2.0....

asm {
	xor cx,cx
	mov ah,1H
	int 10
}

Using Turbo C++ there is something like a _settextcurosr(CURSOR_OFF) or
something like that.  GHope this helps.

Brian
Technical Details
Message-ID: <26640@uflorida.cis.ufl.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!apple!agate!usenet.ins.cwru.edu!gatech!uflorida!reef.cis.ufl.edu!jdb
References: <29796@usc>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!apple!agate!usenet.ins.cwru.edu!gatech!uflorida!reef.cis.ufl.edu!jdb
From: jdb@reef.cis.ufl.edu (Brian K. W. Hook)
Newsgroups: comp.os.msdos.programmer
Subject: Re: How to turn the cursor off
Message-ID: <26640@uflorida.cis.ufl.EDU>
Date: 3 Feb 91 07:24:35 GMT
References: <29796@usc>
Sender: news@uflorida.cis.ufl.EDU
Organization: UF CIS Dept.
Lines: 45