Esempio n. 1
0
        public uint GetCurrentIdle()
        {
            var ticks = new LASTINPUTINFO();

            ticks.cbSize = (uint)Marshal.SizeOf(ticks);
            if (!IdleTracker.GetLastInputInfo(ref ticks))
            {
                throw new Exception(GetLastError().ToString());
            }

            return(ticks.dwTime);
        }