This question is part of a long story about trying to get input messages, WM_INPUT
, from outside of the main window for an application.
The reason is that the main loop's frequency is lower than the desired frequencies for input processing. I don't have the choice to change the workload in the main loop itself, as other functionality needs to be performed in the main thread. I'm thus left with one choice - to manage input outside of the main thread.
Given the following factors:
- Let's say that we have several message-only windows, running on different threads;
- We are using the RawInput API to register and receive
WM_INPUT
messages for different input devices; - The different threads will share a few data structures to work together on input processing;
Is there a method to identify one WM_INPUT
message sent to different threads as being the same message?
Is there a serial number, or a counter, or something to identify that messages that are sent from the same source at the same polling, to be used when comparing the input shared data between the threads?