From 4917567d0e33f20b07b004c368cd66e301115db0 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 23 Sep 2013 15:13:53 +0000 Subject: small plugins cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@6193 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/BossKeyPlus/src/BossKeyIdle.cpp | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'plugins/BossKeyPlus') diff --git a/plugins/BossKeyPlus/src/BossKeyIdle.cpp b/plugins/BossKeyPlus/src/BossKeyIdle.cpp index a71bd2200c..a97bf01abc 100644 --- a/plugins/BossKeyPlus/src/BossKeyIdle.cpp +++ b/plugins/BossKeyPlus/src/BossKeyIdle.cpp @@ -27,8 +27,6 @@ POINT mousepos; UINT_PTR hTimer; UINT mouseidle, minutes; -static BOOL (WINAPI * MyGetLastInputInfo)(PLASTINPUTINFO); - VOID CALLBACK IdleTimer(HWND hwnd, UINT umsg, UINT idEvent, DWORD dwTime); static bool IsScreenSaverRunning() @@ -46,25 +44,12 @@ static bool IsUserIdle() return GetTickCount() - dwTick > (minutes * 60 * 1000); } - if ( MyGetLastInputInfo != NULL ) { - LASTINPUTINFO ii; - ZeroMemory(&ii,sizeof(ii)); - ii.cbSize=sizeof(ii); - if ( MyGetLastInputInfo(&ii)) - return GetTickCount() - ii.dwTime > (minutes * 60 * 1000); - } - else { - POINT pt; - GetCursorPos(&pt); - if ( pt.x != mousepos.x || pt.y != mousepos.y ) { - mousepos=pt; - mouseidle=0; - } - else mouseidle += 2; - - if ( mouseidle ) - return mouseidle >= (minutes * 60); - } + LASTINPUTINFO ii; + ZeroMemory(&ii,sizeof(ii)); + ii.cbSize=sizeof(ii); + if (GetLastInputInfo(&ii)) + return GetTickCount() - ii.dwTime > (minutes * 60 * 1000); + return FALSE; } @@ -81,7 +66,6 @@ VOID CALLBACK IdleTimer(HWND hwnd, UINT umsg, UINT_PTR idEvent, DWORD dwTime) void InitIdleTimer() { minutes = db_get_b(NULL,MOD_NAME,"time",10); - MyGetLastInputInfo=(BOOL (WINAPI *)(LASTINPUTINFO*))GetProcAddress(GetModuleHandleA("user32"), "GetLastInputInfo"); hTimer=SetTimer(NULL, 0, 2000, IdleTimer); } -- cgit v1.2.3