There is a [tt]GetLastInputInfo()[/tt] in [tt]user32.dll[/tt] that will return the time of the last user input (keyboard or mouse I believe) in milliseconds since last reboot. This requires Win2K or later.
There is also a window message broadcast to all windows relating to expiration of the screen saver inactivity interval. I can't recall the name and value of this message right now. Probably a WM_SYSCOMMAND with an argument like SC_SCREENSAVE. Ahh, I think that's it, see: How to write a 32bit screen saver.
Neither of these is directly useful from a WSH or HTA script however. You'd need a code component created using VB or C++ to make the API calls needed, and you'd need to intercept window messages to use the other approach.
Maybe someone else has another answer, possibly via WMI?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.