I'm in a school project, I need to get the click when I hit the console.
Where you press save the coordinates X, Y
and put them in void GotoXY(int x, int y);
for the program to continue printing at that point. Then wait for another point to start the cycle again.
Is there a method type GetCursorPosition();
?
Although it is generated as gotoxy.
Edit:
I have this
BOOL WINAPI GetConsoleScreenBufferInfo(
_In_ HANDLE hConsoleOutput,
_Out_ PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo
);
int main(){
int r = 0;
int i = 0;
int j = 0;
int vuelta = 0;
int sleep = 50;
while(true){
if(vuelta!=1){
irA(i,j);
r = rand()%11+1;
pon_color(r);
printf("Jose ");
Sleep(100);
//j = j+1; //esto mueve izquierda o derecha
i = i+1; //esto mueve arriba o abajo
if(i==25)
vuelta = 1;
irA(lpConsoleScreenBufferInfor.x, lpConsoleScreenBufferInfor.y);
}
but it does not work for me, it gives me this error:
name colors.cpp [Warning] 'BOOL GetConsoleScreenBufferInfo (HANDLE, PCONSOLE_SCREEN_BUFFER_INFO) 'redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]