-4

My purpose is to make a keylogger and I don't want to just to copy the available codes out there around the internet because they can easily get caught by antivirus so I am writing one with an algorithm to make it seems like it is not recording the keystrokes. I wrote a program to make that while window is on top and it worked well. Then I used the following code to make it invisible:

HWND Stealth;
AllocConsole();
Stealth = FindWindowA("ConsoleWindowClass", NULL);
ShowWindow(Stealth,0);

but now the program can not capture the keystrokes because I cant anymore interact to the program. Is there a code line that makes it possible to interact with a window in invisible while other window is on top?

1 Answers1

1

Only the window that has focus will receive input. You can still capture keystrokes with GetAsyncKeyState.

Mike Kwan
  • 24,123
  • 12
  • 63
  • 96
  • Not aware of any rule against this and similar questions have been well received: http://stackoverflow.com/questions/12954040/making-a-keylogger. In fact this question looks as if it is partially lifted from that one. You are misusing/misunderstanding the purpose of downvoting. – Mike Kwan Mar 14 '13 at 15:55
  • This is a grey area, see http://meta.stackexchange.com/questions/3528/dealing-with-questions-of-nefarious-intent/12688#12688 – Mike Kwan Mar 14 '13 at 16:00
  • Neh, I don's see any gray here. More like red. – vector Mar 14 '13 at 16:05
  • Perhaps you should get your eyes checked out. – Mike Kwan Mar 14 '13 at 16:06
  • The OP specifically aims to defeat antivirus software. I wonder what is being written, then? – Martin James Mar 18 '13 at 13:11