You can use the following Core Graphics API, in CGEvent.h :
CGEventRef event = CGEventCreate(NULL); CGPoint cursor = CGEventGetLocation(event); CFRelease(event);
(Note that you can still use Cocoa in a cross-platform program, you just need to split the platform-specific code into different files instead of using #define s.)
source share