The WM_INPUT
message cannot be sent between processes. Like WM_PAINT
, it is a synthesized message which can only be properly generated by the system itself. The lParam
is not just an HGLOBAL
containing the data, it is an opaque handle understood only by the raw input code.
Raw Input messages are generated directly by the GetMessage
/PeekMessage
internals, and the associated objects are cleaned up by DefWindowProc
. SendMessage
will not marshal the LPARAM
for WM_INPUT
, because the code to do so wasn't written as it is not intended to be used in that way.