Help about keylogger.
Hi, does anyone know how to create an application using C# that can't be detected by a keylogger. Any kind of help would be appreciated. Thank You
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Danatas GerviRank #4,152 · 361 reputationPosted Sep 21, 2009, 3:22 AM EDT
here is example.
This is the simplest way to get global hook in your own form:
namespace FormGlobalHook
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Application.AddMessageFilter(new GlobalHook());
}
}
public class GlobalHook : IMessageFilter
{
public bool PreFilterMessage(ref Message msg)
{
const int WM_KEYDOWN = 0x100;
const int WM_SYSKEYDOWN = 0x104;
//const int WM_KEYUP = 0x101;
//const int WM_SYSKEYUP = 0x105;
if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
{
char pressedKey = (char)msg.WParam;
File.AppendAllText(@"c:\spy.txt", pressedKey.ToString());
}
return false;
}
}
}
Kiko De leon4 reputationPosted Sep 21, 2009, 5:05 AM EDT
Danatas GerviRank #4,152 · 361 reputationPosted Sep 21, 2009, 11:26 PM EDT
:-(
Lets wait for reliase of managed OS.
:-)