1

My friend and I are making an app called K.S.I.L.T (Key Stroke Invisible Launcher Tool) that allows you to open up apps and basically executable files in general by using key shortcuts.

We want to make it hidden to the user but if they pressed say "Alt + numpad8" it would open up the selected app. However

this.Hide(); + 
this.ShowinTaskbar = false; 

do not work because they disable key/keycode input. Note: we are using

Process.Start(filepath*); 

to open the files inside of an if statement taking the keycodes.

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
  • I think that'd be something that would not be possible. That'd make it far too easy to make a key logger. I'd think Windows itself would block that kind of behavior. – krillgar Apr 03 '15 at 19:50
  • o :( ... Thanks for the input thoe – user3560875 Apr 03 '15 at 19:58
  • It can be done, but this is a duplicate of other questions, including http://stackoverflow.com/questions/1161053/capturing-keystrokes-without-focus – Rufus L Apr 03 '15 at 19:59
  • Praveen has a good point in his answer. When I was saying it wouldn't be possible, I meant through typical .NET code. However, it is possible if you go down to the lower level instructions, there is eventually a way to do it. – krillgar Apr 03 '15 at 22:04

1 Answers1

3

What you have been trying so far in terms of capturing KeyCode will only work when your application is in focus and is generally used on the screen in focus. To achieve a Key Logging functionality, you will have to get lower in the API, to capture keyboard strokes a.k.a. Win32 API

Most functions regarding Keyboard capture can be found in user32.dll. These low level functions will allow you to intercept keys irrespective of the application in focus.

This article details the basics of Low Level Keyboard Hooks http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx

Praveen Paulose
  • 5,741
  • 1
  • 15
  • 19