Sets the cursor toggle for graphics functions.
#include <graph.h>
short __far _displaycursor( short flag );
flag | Cursor state |
Upon entry into each graphic routine, the screen cursor is turned off. The _displaycursor function determines whether the cursor will be turned back on when programs exit graphic routines. If flag is set to _GCURSORON, the cursor will be restored on exit. If flag is set to _GCURSOROFF, the cursor will be left off.
The function returns the previous value of flag. There is no error return.
Standards:None
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:None
_gettextcursor, _settextcursor
/* DISCURS.C: This program changes the cursor shape using _gettextcursor
* and _settextcursor, and hides the cursor using _displaycursor.
*/
#include <conio.h>
#include <graph.h>
void main( void )
{
short oldcursor;
short newcursor = 0x007; /* Full block cursor */
/* Save old cursor shape and make sure cursor is on */
oldcursor = _gettextcursor();
_clearscreen( _GCLEARSCREEN );
_displaycursor( _GCURSORON );
_outtext( “\nOld cursor shape: ” );
_getch();
/* Change cursor shape */
_outtext( “\nNew cursor shape: ” );
_settextcursor( newcursor );
_getch();
/* Restore original cursor shape */
_outtext( “\n” );
_settextcursor( oldcursor );
}