GetConsoleCursorInfo() doesn't do it... what I need is a way to find the X, Y position of the cursor. Are there any functions that will tell me where the cursor is at any time?
GetConsoleCursorInfo() doesn't do it... what I need is a way to find the X, Y position of the cursor. Are there any functions that will tell me where the cursor is at any time?
Try GetConsoleScreenBufferInfo()...the second param is a pointer to a CONSOLE_SCREEN_BUFFER_INFO....and the dwCursorPosition member of that structure will give you the info you seekOriginally posted by rmullen3
GetConsoleCursorInfo() doesn't do it... what I need is a way to find the X, Y position of the cursor. Are there any functions that will tell me where the cursor is at any time?
rmullen, long time no see man. I have a question of my own. What is your AOL AIM SN? I need to talk to you now. I'll answer your question. Its quite simple really.
#include <iostream>
#include <windows.h>
int main()
{
HANDLE hOutput;
COORD cursorposition={X, Y};
hOutput=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOutput, cursorposition);
cursorposition.X= // your X position;
cursorposition.Y= // your Y position;
int x=500;
Sleep(x);
return 0;
}
I mean, if none of that is accessible in a function. To retrieve it from the system itself. I'm trying to do scrolling for a text-project, and to update this bar at the top of the screen I'd need to be able to know where the cursor is, because I wouldn't have the cursors X and Y stored in a variable I created.
Thanks Fordy, I'll check that out
I mean, if none of that is accessible in a function. To retrieve it from the system itself. I'm trying to do scrolling for a text-project, and to update this bar at the top of the screen I'd need to be able to know where the cursor is, because I wouldn't have the cursors X and Y stored in a variable I created.
Thanks Fordy, I'll check that out