#include <windows.h>
// Quelltext für Visual C++ 6.0
// Funktion: Rechte Windows-Logo-Taste mit AltGr belegen
// h#s 08/02
// In Einstellung "DEBUG" ist der Compiler-Schalter "/GZ" zu entfernen!
#pragma comment(linker,"/ALIGN:4096 /DLL /MERGE:.rsrc=.rdata /SECTION:.shared,RWS /RELEASE /NODEFAULTLIB")
#pragma data_seg(".shared")
HHOOK Hook=0; // Initialisierung ist notwendig
//#pragma data_seg()
HHOOK HookProcess; // Initialisierung für NT-Ladbarkeit ->bss_seg
LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam) {
DWORD flags;
if (code>=0 && wParam==VK_RWIN) {
flags=lParam&0x80000000?KEYEVENTF_KEYUP:0;
keybd_event(VK_CONTROL,29,flags,0);
keybd_event(VK_MENU,56,flags,0);
return 1; // Alles andere abblocken!
}
return CallNextHookEx(Hook,code,wParam,lParam);
}
BOOL __stdcall _DllMainCRTStartup(
HINSTANCE hinstDLL, // handle to DLL module
DWORD fdwReason, // reason for calling function
LPVOID lpvReserved) { // reserved
switch (fdwReason) {
case DLL_PROCESS_ATTACH: {
DisableThreadLibraryCalls(hinstDLL);
if (!Hook) {
HookProcess=Hook=SetWindowsHookEx(WH_KEYBOARD,
KeyboardProc,hinstDLL,0);
}
}break;
case DLL_PROCESS_DETACH: {
if (HookProcess) UnhookWindowsHookEx(HookProcess);
}
}
return TRUE;
}
Vorgefundene Kodierung: UTF-8 | 0
|