Code:
#include "stdafx.h"
void Hax(int id);
void Hook();
HHOOK keybdhook;
LRESULT CALLBACK KeyboardHook(int nCode,WPARAM wParam,LPARAM lParam);
DWORD WINAPI CreateHooks( LPVOID lpParam )
{
Hook();
return 0;
}
void Hook()
{
keybdhook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHook, GetModuleHandle(0), 0);
}
LRESULT CALLBACK KeyboardHook(int nCode,WPARAM wParam,LPARAM lParam)
{
KBDLLHOOKSTRUCT* key;
if(wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN)
{
key = (KBDLLHOOKSTRUCT*)lParam;
// advantages
if(key->vkCode == VK_F8)
{
Hax(2);
Hax(3);
}
// esp
if(key->vkCode == VK_F9)
{
Hax(4);
Hax(5);
Hax(7);
}
// thermal + laser
if(key->vkCode == VK_F7)
{
Hax(1);
Hax(6);
}
}
return CallNextHookEx(keybdhook,nCode,wParam,lParam);
}
Nothing happens when I press f7, f8 or f9. The CreateHooks() function is being called, I know that for sure, the error is in this code.
Thanks in advance.
EDIT: Oh, and the Hax function does work too