Page 1 of 1

Get Mouse Position from C++ Console Application

Posted: Mon Jan 18, 2010 1:05 pm
by Neo

Code: Select all

#include <stdio.h>
#include <windows.h>

void main(){

	POINT pt;

	while (1){
		GetCursorPos(&pt);
		printf("X %d   Y %d\n", pt.x, pt.y);
		Sleep(1);
	}
}