1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| // TODO: Add extra initialization here
hHookDll = LoadLibrary("e:\\Visual C\\essai\\hook\\debug\\rhook.dll");
hHookProcMouse = (HOOKPROC) GetProcAddress(hHookDll, (char *) 2);
fnHookInit = (HookInit *) GetProcAddress(hHookDll, (char *) 3);
hSystemHookMouse = SetWindowsHookEx(WH_KEYBOARD,hHookProcMouse,hHookDll,0);
fnHookInit(hSystemHookMouse);
//Création de l'évènement "my_HookEvent"
hGlobalWriteEvent = CreateEvent(NULL, TRUE, FALSE,"my_HookEvent"); // object name
if (hGlobalWriteEvent == NULL)
{
// Alerte1 est une fonction perso d'affichage de message d'alerte, (MessageBox ....)
Alerte1("Ocr inactif");
}
else
{
// on crèe le thread
hThread = CreateThread(NULL, 0,
(LPTHREAD_START_ROUTINE) RACThreadFunction,
NULL, 0, &IDThread);
if (hThread == NULL)
{
Alerte1("Ocr inactif");
}
} |
Partager