Try putting a Sleep of 50-200 milliseconds at the begging of the while loop for GetAsyncKeyState. That reduces lagg. As for the GetCusorPos, you said it works when CA is not running?
GetCursorPos(&p) problem
global keyboard hook is probably the only other alternative, but I can't see why you should use that vs this if you're just using 3-4 keys >.>
Well this thread went off topic pretty fast.
