Fast interapp communication
Posted on 2004-10-20
For somewhat arcane reasons, I need to monitor (globally) keystrokes and mouse movements and later analyze that data.
OK, I can do system wide hooks (ordinary or low level) and accumulate the data in the hookprocs.
But I need to send that data, periodically, to a separate analysis app running in the system tray. This has to be done fast because of the performance implications for the system as a whole. I was thinking WM_COPYDATA but the SDK says to use SendMessage .. I would rather use PostMessage (can I do this??)
Now, maybe I am getting confused here, but is there any reason I cannot grab some memory in the hookproc with GlobalAlloc send its address to the analysis app and free it there?
The data to be transferred is maybe 5K bytes max, if that makes a difference