InitializeTouchInjection function (winuser.h)

Configures the touch injection context for the calling application and initializes the maximum number of simultaneous contacts that the app can inject.

Note  InitializeTouchInjection must precede any call to InjectTouchInput.

 

Syntax

BOOL InitializeTouchInjection(
  [in] UINT32 maxCount,
  [in] DWORD  dwMode
);

Parameters

[in] maxCount

The maximum number of touch contacts.

The maxCount parameter must be greater than 0 and less than or equal to MAX_TOUCH_COUNT (256) as defined in winuser.h.

[in] dwMode

The contact visualization mode.

The dwMode parameter must be TOUCH_FEEDBACK_DEFAULT, TOUCH_FEEDBACK_INDIRECT, or TOUCH_FEEDBACK_NONE.

Return value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To get extended error information, call GetLastError.

Remarks

If TOUCH_FEEDBACK_DEFAULT is set, the injected touch feedback may get suppressed by the end-user settings in the Pen and Touch control panel.

If TOUCH_FEEDBACK_INDIRECT is set, the injected touch feedback overrides the end-user settings in the Pen and Touch control panel.

If TOUCH_FEEDBACK_INDIRECT or TOUCH_FEEDBACK_NONE are set, touch feedback provided by applications and controls may not be affected.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header winuser.h
Library User32.lib
DLL User32.dll
API set ext-ms-win-rtcore-ntuser-wmpointer-l1-1-0 (introduced in Windows 10, version 10.0.14393)

See also

Functions