InjectSyntheticPointerInput function (winuser.h)

Simulates pointer input (pen or touch).

Syntax

BOOL InjectSyntheticPointerInput(
  HSYNTHETICPOINTERDEVICE device,
  const POINTER_TYPE_INFO *pointerInfo,
  UINT32                  count
);

Parameters

device

A handle to the pointer injection device created by CreateSyntheticPointerDevice.

pointerInfo

Array of 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:

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.

Requirements

   
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