Cursor Blink Off and On

How can I set my cursor blink off and on in the output for the given code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<iostream>
#include<Windows.h>
using namespace std;
int main()
{
cout<<"Processing data ";
for(int i=0;i<5;i++)
{
  Sleep(1000);
  cout<<"\b. ";
}//end for
cout<<endl;
}//end main



One way is, If I make Sleep time as Sleep(500), the cursor doesnt show up. But anything higher(>500) that value, cursor start blinking.

Is it possible to hide the cursor in output?
If your compiler supports #include <conio.h> , there may be a function _setcursortype in there.

Otherwise, take a look at this code from Whitenite1.
See function setcursor.

http://www.cplusplus.com/forum/beginner/82739/#msg444198
Last edited on
Wow. Really thatz a excellent one Chrevil. worked perfectly as I wish.

THank thank you you
Topic archived. No new replies allowed.