예제 #1
0
        public static uint GetIdleTime()
        {
            LASTINPUTINFO lastInPut = new LASTINPUTINFO();
            lastInPut.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(lastInPut);
            GetLastInputInfo(ref lastInPut);

            return ((uint)Environment.TickCount - lastInPut.dwTime);
        }
예제 #2
0
 public static long GetLastInputTime()
 {
     LASTINPUTINFO lastInPut = new LASTINPUTINFO();
     lastInPut.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(lastInPut);
     if (!GetLastInputInfo(ref lastInPut))
     {
         return 0;
     }
     else
     {
         return lastInPut.dwTime;
     }
 }
예제 #3
0
 private static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);