/// <summary> /// Get the last input time in ticks /// </summary> /// <returns></returns> public static uint GetLastInputTime() { NativeMethods.LASTINPUTINFO lastInPut = new NativeMethods.LASTINPUTINFO(); lastInPut.cbSize = (uint)Marshal.SizeOf(lastInPut); if (!NativeMethods.GetLastInputInfo(ref lastInPut)) throw new Exception(NativeMethods.GetLastError().ToString()); return lastInPut.dwTime; }
/// <summary> /// Get the last input time in ticks /// </summary> /// <returns></returns> public static uint GetLastInputTime() { NativeMethods.LASTINPUTINFO lastInPut = new NativeMethods.LASTINPUTINFO(); lastInPut.cbSize = (uint)Marshal.SizeOf(lastInPut); if (!NativeMethods.GetLastInputInfo(ref lastInPut)) { throw new Exception(NativeMethods.GetLastError().ToString()); } return(lastInPut.dwTime); }