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!

Recommended Answers

All 4 Replies

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".

Member Avatar for iamthwee

1) it will appear as a Process in task manager

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.