.NET equivalent for GetLastInputInfo?
Asked Answered
W

2

12

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.

Whited answered 1/7, 2009 at 15:44 Comment(0)
E
11

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.

Educationist answered 1/7, 2009 at 15:51 Comment(1)
@Cocowalla The linked article shows various options, including completely managed means of monitoring input, etc.Educationist
S
1

If there isn't another call for this Pinvoke.net provides a P/Invoke solution for this call and necessary struct.

Secret answered 1/7, 2009 at 15:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.