How to check in C++ if the system is active?
问题 I'm writing code that need to run only when there is no human activity on the PC, like when the screensaver is running. Any suggestions on how to do this in c++ under windows? @talnicolas, simply to use unused resources, how many times people leave the computer on but they are in another place? 回答1: You can use GetLastInputInfo to check how long the user has been idle (not moved around the mouse or typed something on the keyboard) and SystemParametersInfo to check if a screensaver is active.