You seem to have answered your question there, Nathan ;-) "GetLastInputInfo" is the way to go.
One trick is that if your application runs on the desktop and the user connects to the virtual machine, GetLastInputInfo will not report any activity (since there is no activity on the host machine).
This may differ from the behavior you want, depending on how you want to apply user input.
Leon bambrick
source share