Hello.
Seems to me that you want to use the SendInput function. It simulates everything (keyboard and Mouse events). Basically you just fill out an INPUT struct, pass it in and watch it go.
Code:
INPUT mouseInput;
memset(&mouseInput, 0, sizeof(INPUT));
mouseInput.type = INPUT_MOUSE;
// Move a mouse Cursor
mouseInput.mi.dx = newMouseXCoords;
mouseInput.mi.dy = newMouseYCoords;
// Click
mouseInput.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
// Fire Event
SendInput(1, &mouseInput, sizeof(INPUT));
NOTE: a Click is essentially a Mouse DOWN event followed by a Mouse UP event. If you dont send a Mouse UP event then your cursor will be treated as having the mouse button down.