Ok, so, I've been scrounging around the internet looking for a decent C++ Keylogger that is able to be hidden (Not showing a console window) and have been very unsuccessful, I need help building one or finding one that works PROPERLY. I use Codeblocks compiler, similar to Dev-Cpp. Any help would be much oblidged!

Use ShowWindow in combination with SW_HIDE on the current window - it will hide the console.

#include<windows.h>

int main()
{
    HWND hwnd = GetForegroundWindow();
    ShowWindow(hwnd, SW_HIDE);

    while(1)
    {
         // look for keys ?
    }

    return 0;
}

However this is not the best way to make a keylogger
1) it will appear as a Process in task manager
2) will consume lots of CPU

For learning is good, but it will fail in "real world".

1) it will appear as a Process in task manager

You could compile the program so the process looks like a regular windows process.

Edited 3 Years Ago by iamthwee

Use ShowWindow in combination with SW_HIDE on the current window - it will hide the console

Just change main to "WinMain" and compile with -mwindows. That way the console never even shows.

This question has already been answered. Start a new discussion instead.