• Advertisement

Archived

This topic is now archived and is closed to further replies.

Hiding Text Cursor In C++ Console Applications

This topic is 5154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to hide the blinking cursors in a C++ console application using a standard include? Or do I need a special third party file? o.o I really need to get rid of that annoying blinking cursor. ^_^ And sorry if theres posts about this, it seems I can''t log in (I have to type my username and password everytime I post), and I can''t use the search function without errors. x.x

Share this post


Link to post
Share on other sites
Advertisement
If you are programming for Windows, you can use SetConsoleCursorInfo(). There''s no way to do that using standard C++.

Share this post


Link to post
Share on other sites
I''m really new at this. ._. I''m trying to learn through experience, but how do I define the function.

Okay, I know this will probably look like the dumbest attempt at this every but:

void hidecursor(void) {
HANDLE hdl;
hdl = GetStdHandle(STD_OUTPUT_HANDLE);
struct cursory {
DWORD dwSize;
BOOL bVisible;
}
cursory.bVisible = false;
SetConsoleCursorInfo(hdl, cursory);
}

Anyway you can help me here? ._.

Share this post


Link to post
Share on other sites
It should look something like this (you''ll want to check the return values of the functions for errors, though):

void hidecursor()
{
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = TRUE;
SetConsoleCursorInfo(consoleHandle, &info);
}

Share this post


Link to post
Share on other sites

  • Advertisement