Key Logger

How to log key strokes

Page 1 of 1

4 Replies - 5272 Views - Last Post: 15 April 2009 - 05:18 PM Rate Topic: -----

#1 blake912   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 15-April 09

Key Logger

Post icon  Posted 15 April 2009 - 02:22 PM

Hi, I am trying to create a WPF or windows forms app (preferably WPF) that will log key strokes while the program is active and periodically update a text file with them.

I am thinking that a timer event needs to be triggered because how else would it know how often to save what it's retrieved to the file.

i am thinking i could just change the form opacity to 100% to keep it from being noticed by the user.

So a couple of questions:

How do you do this in general?

I don't know how to capture Keyboard events. (this is the main issue)
Also... should this program be arranged in multiple classes? or would it be ok in one?

This post has been edited by blake912: 15 April 2009 - 02:24 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Key Logger

#2 papuccino1   User is offline

  • His name was Robert Paulson.
  • member icon

Reputation: 63
  • View blog
  • Posts: 1,121
  • Joined: 02-March 08

Re: Key Logger

Posted 15 April 2009 - 04:34 PM

Hello and welcome to DIC.

I think you shouldn't set the opacity to 100% because the user could still accidentally click on the program, right?

That's about all the tips I can give without some of your code. If you post some code I'll help out some more.
Was This Post Helpful? 0
  • +
  • -

#3 blake912   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 15-April 09

Re: Key Logger

Posted 15 April 2009 - 04:52 PM

View Postpapuccino1, on 15 Apr, 2009 - 03:34 PM, said:

Hello and welcome to DIC.

I think you shouldn't set the opacity to 100% because the user could still accidentally click on the program, right?

That's about all the tips I can give without some of your code. If you post some code I'll help out some more.


Thanks :)

And i was kinda thinking the same thing... but i don't know how else to do it honestly. I still want it to run "in the background". know what i mean?

Mainly i was trying to find a method to capture keyboard events.
Was This Post Helpful? 0
  • +
  • -

#4 papuccino1   User is offline

  • His name was Robert Paulson.
  • member icon

Reputation: 63
  • View blog
  • Posts: 1,121
  • Joined: 02-March 08

Re: Key Logger

Posted 15 April 2009 - 05:05 PM

Well you can make a program fairly hidden with some ingenuity. ;)

To start, you can hide your form immediately after loading. Hide in the system tray on your Windows. Maybe you could change the program icon to mimic something the user would have on his PC. For instance mimic the icon to the sound mixer icon and change the text on mouse over to the same text property.

Lastly disable the double function of the icon so the user doesn't accidentally open your program will figuring out what the hell it is.

So in short, you need to read up on this:
  • How to minimize program to tray.
  • How to change tray icon and mouse over text of your program.
  • How to disable double click feature to avoid someone opening your program.
  • How to change the name of your process so it doesn't appear on the Process list like "MyXProgram.exe" in Task Manager. Make it blend in nicely you know?

Good luck and if I find something I'll let you know, ok?

This post has been edited by papuccino1: 15 April 2009 - 05:07 PM

Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1663
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Key Logger

Posted 15 April 2009 - 05:18 PM

Unfortunately I cannot come up with a legitimate reason one would need a key logger, not to mention it's against site policy. Closed :)
Was This Post Helpful? 1

Page 1 of 1