summaryrefslogtreecommitdiff
path: root/plugins/BossKeyPlus/src/BossKeyIdle.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-23 15:13:53 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-23 15:13:53 +0000
commit4917567d0e33f20b07b004c368cd66e301115db0 (patch)
treefa841e9647b10bb5a291196bae241974de30f060 /plugins/BossKeyPlus/src/BossKeyIdle.cpp
parent83181e39a7613a9ed00c6c7ddcbea59a340d491e (diff)
small plugins cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6193 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BossKeyPlus/src/BossKeyIdle.cpp')
-rw-r--r--plugins/BossKeyPlus/src/BossKeyIdle.cpp28
1 files changed, 6 insertions, 22 deletions
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);
}