_setcursortype
conio.h:インデックス への移動
ヘッダーファイル
conio.h
カテゴリ
コンソール入出力ルーチン
プロトタイプ
void _setcursortype(int cur_t);
説明
カーソルの外観を選択します。
カーソルの種類を次のいずれかに設定します。
_NOCURSOR |
カーソルをオフにします。 |
_NORMALCURSOR |
通常の下線カーソル |
_SOLIDCURSOR |
ブロックカーソル |
メモ: Win32 GUI アプリケーションでは,この関数を使用しないでください。
戻り値
なし。
例
#include <conio.h>
int main( )
{
// ユーザーに操作を説明します
clrscr();
cputs("Press any key three times.\n\r");
cputs("Each time the cursor will change shape.\n\r");
gotoxy(1,5); // ブロックカーソルを表示します
cputs("Now the cursor is solid.\n\r");
_setcursortype(_SOLIDCURSOR);
while(!kbhit()) {}; // 待機します
getch();
gotoxy(1,5); // カーソルを削除します
cputs("Now the cursor is gone.");
clreol();
gotoxy(1,6);
_setcursortype(_NOCURSOR);
while(!kbhit()) {}; // 待機します
getch();
gotoxy(1,5); // 通常のカーソルを表示します
cputs("Now the cursor is normal.");
clreol();
gotoxy(1,6);
_setcursortype(_NORMALCURSOR);
while(!kbhit()) {}; // 待機します
getch();
clrscr();
return(0);
}
移植性
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |