The SendInput function synthesizes keystrokes, mouse motions, and button clicks.
UINT SendInput(
UINT nInputs, // count of input events
LPINPUT pInputs, // array of input events to insert
int cbSize // size of an INPUT structure
);
The function returns the number of events that it successfully inserted into the keyboard or mouse input stream.
To get extended error information, call GetLastError.
The SendInput function inserts the events in the INPUT structures serially into the keyboard or mouse input stream. These events aren't interspersed with other keyboard or mouse input events inserted either by the user (with the keyboard or mouse) or by calls to keybd_event, mouse_event, or other calls to SendInput.
Windows CE: Windows CE does not support the INPUT_HARDWARE value in the type field of the INPUT structure referred to by the pInputs parameter.
Windows NT: Requires version 4.0 SP3 or later.
Windows: Requires Windows 98 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
Keyboard Input Overview, Keyboard Input Functions, INPUT, keybd_event, mouse_event