InjectSyntheticPointerInput function (winuser.h)

Simulates pointer input (pen or touch).


BOOL InjectSyntheticPointerInput(
  [in] const POINTER_TYPE_INFO *pointerInfo,
  [in] UINT32                  count



A handle to the pointer injection device created by CreateSyntheticPointerDevice.

[in] pointerInfo

An array of POINTER_TYPE_INFO structures represneting the injected pointers.

The type must match the pointerType parameter of the CreateSyntheticPointerDevice call that created the injection device.

The ptPixelLocation for each POINTER_TYPE_INFO is specified relative to top left of the virtual screen:

[in] count

The number of contacts.

For PT_TOUCH this value must be greater than 0 and less than or equal to MAX_TOUCH_COUNT.

For PT_PEN this value must be 1.

Return value

If this function succeeds, it returns TRUE.

Otherwise, it returns FALSE. To retrieve extended error information, call the GetLastError function.


Minimum supported client Windows 10, version 1809 [desktop apps only]
Minimum supported server Windows Server [desktop apps only]
Target Platform Windows
Header winuser.h
Library User32.lib
DLL User32.dll