[This is preliminary documentation and subject to change.]
Simulates a series of mouse, keyboard, or other user input events without interruption.
UINT SendInput(
UINT cInputs,
LPINPUT pInputs,
INT cbSize
);
Returns a value representing the number of INPUT structures played back to USER. If this value equals the cInputs parameter, then the function completed successfully. If this value equals zero, then input was already blocked by another thread.
This function does not reset the keyboard's current state. Therefore, if the user has any keys pressed when you call this function, they might interfere with the events that this function generates. If you are concerned about possible interference, check the keyboard's state with the GetAsyncKeyState Win32 function and correct as necessary.
Simulating Input