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 |
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++ |
|
+ |
|
|
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|