Thread: Tracking number of keystrokes

  1. #1
    thecow
    Guest

    Tracking number of keystrokes

    If been searching here and the MSDN for a few hours now, and I have a question. If I want to track just the number of keystrokes and not what keys were actually pressed, do I have to go the route of a dll, or is there a easier way.

    dlls may actually seem the easy way to some of you, but I have no idea about using/creating them. If this is the only way, does anyone have a suggestion for a good dll tutorial?

    Just to clarify, I am not trying to build a keystroke logger - I am just wanting to keep track of the number of keystrokes.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Bump a counter everytime a WM_KEYDOWN message comes in?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    thecow
    Guest
    I tried that, but I want to count all keystrokes (like figuring avg words per minute etc.). That function only works when my app has focus, and I want to count the keystrokes in a different app.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by thecow
    I tried that, but I want to count all keystrokes (like figuring avg words per minute etc.). That function only works when my app has focus, and I want to count the keystrokes in a different app.
    To that you should use a global hook.......but for that you need to understand dlls.....

    DO a search on the site for dll tutorials....it's a pretty common question and your sure to turn something up

  5. #5
    thecow
    Guest
    Well, I searched a long time here and at msdn - but the only examples I found were full of uncommented nasty code. Finally, I decide to search google for 'keyboard hook programs', and the 3rd page down has a very simple example, without any extra code. I will never forsake Google again, lol. Thanks for posting. Sorry for the bother.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. adding a number to a number
    By bigmac(rexdale) in forum C Programming
    Replies: 11
    Last Post: 10-24-2007, 12:56 PM
  2. Finding a number within a number
    By jeev2005 in forum C Programming
    Replies: 2
    Last Post: 01-10-2006, 08:57 PM
  3. help with a source code..
    By venom424 in forum C++ Programming
    Replies: 8
    Last Post: 05-21-2004, 12:42 PM
  4. parsing a number
    By juancardenas in forum C Programming
    Replies: 1
    Last Post: 02-19-2003, 01:10 PM
  5. Random Number problem in number guessing game...
    By -leech- in forum Windows Programming
    Replies: 8
    Last Post: 01-15-2002, 05:00 PM