InitializeTouchInjection function

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

maxCount [in]

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.

dwMode [in]

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.

Error codes

NameMeaning
ERROR_INVALID_PARAMETER

maxCount is not valid.

Error codes

NameMeaning
ERROR_INVALID_PARAMETER

maxCount is not valid.

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

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Winuser.h

Library

User32.lib

DLL

User32.dll

See also

Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft