I want to detect the idle time (eg. How long ago the user pressed a key or moved the mouse). Supposedly the GetLastInputInfo() should be what I need but, when I use it, it always prints 0.
LASTINPUTINFO last_input = {0};
GetLastInputInfo(&last_input);
cout << last_input.dwTime << endl;
Any idea why?
Thank you
EDIT: Using getlasterror, it says that the parameter is incorrect (ERROR_INVALID_PARAMETER, 87)
Solved! Forgot about initializing cbSize ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With