From def6a67c133cbf7532652be76195fc41927540e1 Mon Sep 17 00:00:00 2001 From: Elvio Basello Date: Thu, 17 Sep 2009 21:15:21 +0000 Subject: removed useless dirs git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3508 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/my/win32/Makefile | 9 --- src/modules/my/win32/idleui.cpp | 175 ---------------------------------------- src/modules/my/win32/idleui.def | 7 -- src/modules/my/win32/idleui.dll | Bin 155 -> 0 bytes src/modules/my/win32/idleui.h | 46 ----------- 5 files changed, 237 deletions(-) delete mode 100644 src/modules/my/win32/Makefile delete mode 100644 src/modules/my/win32/idleui.cpp delete mode 100644 src/modules/my/win32/idleui.def delete mode 100644 src/modules/my/win32/idleui.dll delete mode 100644 src/modules/my/win32/idleui.h (limited to 'src/modules') diff --git a/src/modules/my/win32/Makefile b/src/modules/my/win32/Makefile deleted file mode 100644 index d7119ba81..000000000 --- a/src/modules/my/win32/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES = idleui.cpp -DLL_NAME = idleui.dll -DEF_NAME = idleui.def - -all: $(DLL_NAME) - -$(DLL_NAME): $(SOURCES) - cl /nologo /MD $(SOURCES) /link /def:$(DEF_NAME) user32.lib kernel32.lib /dll /out:$(DLL_NAME) - diff --git a/src/modules/my/win32/idleui.cpp b/src/modules/my/win32/idleui.cpp deleted file mode 100644 index aede2ba23..000000000 --- a/src/modules/my/win32/idleui.cpp +++ /dev/null @@ -1,175 +0,0 @@ -//////////////////////////////////////////////////////////////// -// 2000 Microsoft Systems Journal. -// If this program works, it was written by Paul DiLascia. -// If not, I don't know who wrote it. -// This program compiles with Visual C++ 6.0 on Windows 98 -// -// See IdleUI.h -// - -#include -#include -#include - -#define DLLEXPORT __declspec(dllexport) - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -//////////////// -// The following global data is SHARED among all instances of the DLL -// (processes); i.e., these are system-wide globals. -// -#pragma data_seg (".IdleUI") // you must define as SHARED in .def - -HHOOK g_keyboardHook = NULL; // one instance for all processes -HHOOK g_mouseHook = NULL; // one instance for all processes -DWORD g_lastInputTick = 0; // tick time of last input event - -/** - Last mouse position. -*/ -POINT g_lastMousePos; - -#pragma data_seg () - -/** - Flag indicating whether the DLL's owning process is the loading DLL. -*/ -bool g_isHandleOwner = false; - -// -// Public interface -// - -////////////////// -// Initialize DLL: install kbd/mouse hooks. -// -DLLEXPORT BOOL IdleUIInit() -{ - return TRUE; -} - -////////////////// -// Terminate DLL: remove hooks. -// -DLLEXPORT void IdleUITerm() -{ -} - -///////////////// -// Get tick count of last keyboard or mouse event -// -DLLEXPORT DWORD IdleUIGetLastInputTime() -{ - return g_lastInputTick; -} - -// -// Internals -// - -///////////////// -// Keyboard hook: record tick count -// -LRESULT CALLBACK keyboardHookCallback(int code, WPARAM wParam, LPARAM lParam) -{ - if (code == HC_ACTION) - { - g_lastInputTick = GetTickCount(); - } - return ::CallNextHookEx(g_keyboardHook, code, wParam, lParam); -} - -///////////////// -// Mouse hook: record tick count -// -LRESULT CALLBACK mouseHookCallback(int code, WPARAM wParam, LPARAM lParam) -{ - if (code == HC_ACTION) - { - // Update timestamp if event indicates mouse action - bool change = false; - if (wParam == WM_MOUSEMOVE && lParam != 0) - { - PMOUSEHOOKSTRUCT mhs = (PMOUSEHOOKSTRUCT) lParam; - if (mhs->pt.x != g_lastMousePos.x || - mhs->pt.y != g_lastMousePos.y) - { - change = true; - g_lastMousePos = mhs->pt; - } - } - else - { - change = true; - } - if (change) - { - g_lastInputTick = GetTickCount(); - } - } - return ::CallNextHookEx(g_mouseHook, code, wParam, lParam); -} - -void initialize(HINSTANCE module) -{ - if (g_keyboardHook == 0) - { - g_keyboardHook = SetWindowsHookEx(WH_KEYBOARD, keyboardHookCallback, module, 0); - g_mouseHook = SetWindowsHookEx(WH_MOUSE, mouseHookCallback, module, 0); - g_lastInputTick = GetTickCount(); - g_isHandleOwner = true; - } - assert(g_keyboardHook); - assert(g_mouseHook); -} - -void shutdown() -{ - // Only handle-owning process may unhook - if (g_isHandleOwner) - { - if (g_keyboardHook != 0) - { - UnhookWindowsHookEx(g_keyboardHook); - g_keyboardHook = 0; - } - if (g_mouseHook != 0) - { - UnhookWindowsHookEx(g_mouseHook); - g_mouseHook = 0; - } - } -} - -// -// DLL entry point -// - -BOOL WINAPI DllMain(HINSTANCE module, DWORD reason, LPVOID reserved) -{ - switch (reason) - { - case DLL_PROCESS_ATTACH: - { - initialize(module); - break; - } - case DLL_PROCESS_DETACH: - { - shutdown(); - break; - } - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - { - // Ignore - break; - } - } - return TRUE; -} diff --git a/src/modules/my/win32/idleui.def b/src/modules/my/win32/idleui.def deleted file mode 100644 index 530918c51..000000000 --- a/src/modules/my/win32/idleui.def +++ /dev/null @@ -1,7 +0,0 @@ -LIBRARY "IdleUI" -DESCRIPTION 'IdleUI DLL by Paul DiLascia' -SECTIONS .IdleUI READ WRITE SHARED - -EXPORTS -IdleUIGetLastInputTime - diff --git a/src/modules/my/win32/idleui.dll b/src/modules/my/win32/idleui.dll deleted file mode 100644 index b68d56f77..000000000 Binary files a/src/modules/my/win32/idleui.dll and /dev/null differ diff --git a/src/modules/my/win32/idleui.h b/src/modules/my/win32/idleui.h deleted file mode 100644 index cf54a75ae..000000000 --- a/src/modules/my/win32/idleui.h +++ /dev/null @@ -1,46 +0,0 @@ -//////////////////////////////////////////////////////////////// - -// 2000 Microsoft Systems Journal. - -// If this program works, it was written by Paul DiLascia. - -// If not, I don't know who wrote it. - -// This program compiles with Visual C++ 6.0 on Windows 98 - -// - -#define DLLIMPORT __declspec(dllimport) - - - -// IdleUI is a DLL that lets you tell when the user interface has been idle - -// for a specified amount of time. The DLL works by installing windows keyboard - -// and mouse hooks. The DLL records the tick count whenever input is received. - -// - -// To use, you must - -// - call IdleUIInit when your app starts up - -// - call IdleUITerm when your app terminates - -// - call IdleUIGetLastInputTime to get the time, and compare this with - -// the current GetTickCount(); - -// - -// See TestIdleUI.cpp for an example of how to use IdleUI - -// - -DLLIMPORT BOOL IdleUIInit(); - -DLLIMPORT void IdleUITerm(); - -DLLIMPORT DWORD IdleUIGetLastInputTime(); - -- cgit v1.3.1-10-gc9f91