Is there a .NET equivalent to the Windows GetLastInputInfo()
API?
I know it's possible to P/Invoke the API but I'm looking for a method or technique that's already built into the .NET framework.
There isn't a direct translation of that specific API in the .NET BCL. Fortunately, it's a very easy method to P/Invoke.
That being said, there are other ways to attempt to check user idle state. Most still require P/Invoke at some level (at least all of the ones that handle other applications).
Here is a CodeProject article comparing options.
If there isn't another call for this Pinvoke.net provides a P/Invoke solution for this call and necessary struct.
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