I want to be able to set the visibility of the cursor in the console, so i looked in wincon.h, where i had previously found "SetConsoleCursorPosition()". This is what i found:
Code:
SetConsoleCursorInfo(
HANDLE hConsoleOutput,
CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo
);
and the structure earlier on:
Code:
typedef struct _CONSOLE_CURSOR_INFO {
DWORD dwSize;
BOOL bVisible;
} CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO;
i tried to use this in pretty much the same way as SetConsoleCursorPosition(), which goes like this:
Code:
void gotoxy(int x, int y)
{
HANDLE hConsoleOutput;
COORD dwCursorPosition;
dwCursorPosition.X = x;
dwCursorPosition.Y = y;
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsoleOutput,dwCursorPosition);
}
My code for setting the visibility of the cursor was this:
Code:
void setCursor(bool visible)
{
HANDLE hConsoleOutput;
CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo.bVisible=visible;
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorInfo(hConsoleOutput,lpConsoleCursorInfo);
}
It did NOT work.
if anyone knows about the Windows API and how to use it, can you give us a hand?