/* * Copyright (c) 2010 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include #include namespace Swift { WindowsIdleQuerier::WindowsIdleQuerier() { } int WindowsIdleQuerier::getIdleTimeSeconds() { LASTINPUTINFO info; info.cbSize = sizeof(info); if (GetLastInputInfo(&info)) { return (GetTickCount() - info.dwTime) / 1000; } else { return 0; } } }