_setcursortype
Go Up to conio.h Index
Warning: Display title "_setcursortype" overrides earlier display title "setcursortype".
Header File
conio.h
Category
Console I/O Routines
Prototype
void _setcursortype(int cur_t);
Description
Selects cursor appearance.
Sets the cursor type to
_NOCURSOR |
Turns off the cursor |
_NORMALCURSOR |
Normal underscore cursor |
_SOLIDCURSOR |
Solid block cursor |
Note: Do not use this function in Win32 GUI applications.
Return Value
None.
Example
#include <conio.h> int main( ) { // tell the user what to do clrscr(); cputs("Press any key three times.\n\r"); cputs("Each time the cursor will change shape.\n\r"); gotoxy(1,5); // show a solid cursor cputs("Now the cursor is solid.\n\r"); _setcursortype(_SOLIDCURSOR); while(!kbhit()) {}; // wait to proceed getch(); gotoxy(1,5); // remove the cursor cputs("Now the cursor is gone."); clreol(); gotoxy(1,6); _setcursortype(_NOCURSOR); while(!kbhit()) {}; // wait to proceed getch(); gotoxy(1,5); // show a normal cursor cputs("Now the cursor is normal."); clreol(); gotoxy(1,6); _setcursortype(_NORMALCURSOR); while(!kbhit()) {}; // wait to proceed getch(); clrscr(); return(0); }
Portability
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |