GetCurrentInputMessageSource function

Retrieves the source of the input message.


BOOL GetCurrentInputMessageSource(
  INPUT_MESSAGE_SOURCE *inputMessageSource



The INPUT_MESSAGE_SOURCE structure that holds the device type and the ID of the input message source.

Note  deviceType in INPUT_MESSAGE_SOURCE is set to IMDT_UNAVAILABLE when SendMessage is used to inject input (system generated or through messages such as WM_PAINT). This remains true until SendMessage returns.

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 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

See Also

Input Source Identification Reference