hide flashing cursor in cmd

I use the next code to hide the flashing cursor when you run the application. But it doesn't work. The cursor is still flashing. Can somebody help me?

1
2
3
4
5
6
7
8
9
10
11
12
void DrawEngine::cursorVisibility(bool visibility)
{
     HANDLE output_handle;
     CONSOLE_CURSOR_INFO cciInfo;
     
     cciInfo.dwSize = 1;
     cciInfo.bVisible = visibility;   
     
     output_handle = GetStdHandle(STD_OUTPUT_HANDLE); 
     
     SetConsoleCursorInfo(output_handle, &cciInfo);     
}
closed account (z05DSL3A)
SetConsoleCursorInfo returns zero if it fails, so check for this and call GetLastError to find the error.

Topic archived. No new replies allowed.