shadowsilver
Programmer
Can anybody help me? I'm trying to use the GetConsoleScreenBufferInfo function to get the location of the cursor on the screen at any time, but I'm having troubles. I've studied MSDN, and thought I'd figured it out, but it didn't work. I've looked all over for example source code for that function, but couldn't find any that did the same thing I was trying to do. By the way, I'm using the Dev-C++ 4.9.6.0 compiler.
Here's the source code:
The error i'm getting is:
"In function 'int main()' : request for member 'dwCursorPosition' in 'BufInfo', which is of non-aggregate type _CONSOLE_SCREEN_BUFFER_INFO"
I don't even know what non-aggregate type means!
Any help or recommendations would be appreciated very much.
Thanks.
Here's the source code:
Code:
PCONSOLE_SCREEN_BUFFER_INFO BufInfo;
HANDLE MyHand = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(MyHand, BufInfo);
COORD MyCoord;
MyCoord = BufInfo.dwCursorPosition;
if (MyCoord == (0,1))
{ etc;}
The error i'm getting is:
"In function 'int main()' : request for member 'dwCursorPosition' in 'BufInfo', which is of non-aggregate type _CONSOLE_SCREEN_BUFFER_INFO"
I don't even know what non-aggregate type means!
Any help or recommendations would be appreciated very much.
Thanks.