 <p>I do exactly this using P/Invoke to talk to the <a href="http://msdn.microsoft.com/en-us/library/ms646302(VS.85).aspx" rel="nofollow noreferrer"><code>GetLastInputInfo</code></a> API.</p> <p><strong>Edit</strong>: Here's a complete VB.Net program to display the number of milliseconds since the last input event, system-wide. It sleeps for a second before getting the information, so it reports a time of around a thousand milliseconds, assuming you use the mouse or keyboard to run it. :-)</p> <pre><code>Imports System.Runtime.InteropServices Module Module1 &lt;StructLayout(LayoutKind.Sequential)&gt; _ Public Structure LASTINPUTINFO Public Shared ReadOnly SizeOf As Integer = Marshal.SizeOf(GetType(LASTINPUTINFO)) &lt;MarshalAs(UnmanagedType.U4)&gt; _ Public cbSize As Integer &lt;MarshalAs(UnmanagedType.U4)&gt; _ Public dwTime As Integer End Structure &lt;DllImport("user32.dll")&gt; _ Public Function GetLastInputInfo(ByRef plii As LASTINPUTINFO) As Boolean End Function Sub Main() Dim lii As New LASTINPUTINFO() lii.cbSize = LASTINPUTINFO.SizeOf lii.dwTime = 0 System.Threading.Thread.Sleep(1000) GetLastInputInfo(lii) MsgBox((Environment.TickCount - lii.dwTime).ToString) End Sub End Module </code></pre>