SendInput

[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
);
 

Parameters

cInputs
Count of INPUT structures in the array at cInputs.
pInputs
Base address of an array INPUT structures. Each element describes a single simulated event.
cbSize
Size of the INPUT structure, in bytes.

Return Values

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.

Remarks

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.

See Also

Simulating Input