views:

96

answers:

1

I have in C# this function , for key press. When you press a key will be executed function a()

protected virtual void OnKeyPress(object sender, KeyPressEventArgs e) { a(); }

I need a method which to execute a function globally, in outside of my application , in outside of .NET Framework , anywhere in Windows.

Advanced thanks you!

PS: I don`t want to develop a malicious application, a constructive (antikeylogger method) ;)

+1  A: 

This article at CodeProject describes how you can install a Global Keyboard hook using .Net/C# to get that event you need.

http://www.codeproject.com/KB/cs/globalhook.aspx

Sijin