Source file: /~heha/hs/maus32.zip/warpcursorkey/warpcu32.c

#include <windows.h>
// Quelltext für Visual C++ 6.0
// Funktion: Kursortasten (und nur diese) beschleunigen
// 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 g_hHook=0;	// Initialisierung ist notwendig
UINT SaveSpeed=7;

//#pragma data_seg()
HHOOK g_HookProcess;	// Initialisierung für NT-Ladbarkeit ->bss_seg

LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam) {
 if (code>=0
 && (wParam==VK_LEFT||wParam==VK_RIGHT||wParam==VK_UP||wParam==VK_DOWN)) {
  if (lParam&0x80000000) {		// loslassen
   SystemParametersInfo(SPI_SETKEYBOARDSPEED,SaveSpeed,NULL,0);
  }else if (!(lParam&0x40000000)) {	// erstes Drücken
   SystemParametersInfo(SPI_GETKEYBOARDSPEED,0,&SaveSpeed,0);
   SystemParametersInfo(SPI_SETKEYBOARDSPEED,31,NULL,0);
  } 
 }
 return CallNextHookEx(g_hHook,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 (!g_hHook) {
    g_HookProcess=g_hHook=SetWindowsHookEx(WH_KEYBOARD,
      KeyboardProc,hinstDLL,0);
   }
  }break;
  case DLL_PROCESS_DETACH: {
   if (g_HookProcess) UnhookWindowsHookEx(g_HookProcess);
  }
 }
 return TRUE;
}
Detected encoding: ANSI (CP1252)4
Wrong umlauts? - Assume file is ANSI (CP1252) encoded