Click here to Skip to main content
6,292,426 members and growing! (9,936 online)
Email Password   helpLost your password?
Web Development » Applications & Tools » Tools with source code     Intermediate

Journaling Input Events

By Plamen Petrov

A tool for recording and playback of keyboard and mouse input
VC6, Windows, Dev
Posted:3 Mar 2001
Views:84,445
Bookmarked:38 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
31 votes for this article.
Popularity: 6.71 Rating: 4.50 out of 5

1
1 vote, 5.9%
2
1 vote, 5.9%
3
1 vote, 5.9%
4
14 votes, 82.4%
5
  • Download source files - 18 Kb
  • Download demo project - 74 Kb
  • Sample Image - HookManager.jpg

    Introduction

    This is an example for installing an application-defined hook procedures using Win32 SetWindowsHookEx() function. This project implements only WH_JOURNALRECORD and WH_JOURNALPLAYBACK hooks. I was looking for more information and sample programs, but the only sample I'd found was Hooks32, an old Win32 project. Because I didn't find any information about these problems into the developer sites (which I know), I decided to publish this simple tool.

    The application can be used to automate some routine tasks, for example - testing. Start the target application, launch the HookManager, and press the "Start Recording" button. Then HookManager minimizes itself and starts tracking keyboard and mouse events. When the recording is started, pressing CTRL+BREAK can stop it. Windows stops the recording and playback if the user presses CTRL+ALT+DEL or CTRL+ESC, which generates WM_CANCELJOURNAL system message. But, be careful when you are journaling the mouse events! The recorded mouse events are with the current pointer coordinates, and if you close the target application and open it again, it will appear on different position, so the mouse events will go to wrong place.

    This tool can be extended to do some more things. For example: the recorded events can be edited by changing the keystrokes (with different form data, etc.). But this is very precise work, because every pressed button generates 2 messages - WM_KEYDOWN and WM_KEYUP. The generated character depends from the state of other buttons - CTRL, SHIFT, CAPSLOCK, etc.

    I haven't tested the application on Windows NT yet, but with Win98 it works well. I will be glad to receive ideas about extending the functionality.

    Plamen Petrov, Varna, Bulgaria

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Plamen Petrov


    Member
    see www.geocities.com/plamen_petrov2000
    Occupation: Web Developer
    Location: Germany Germany

    Other popular Applications & Tools articles:

    Article Top
    You must Sign In to use this message board.
    FAQ FAQ 
     
    Noise Tolerance  Layout  Per page   
     Msgs 1 to 25 of 27 (Total in Forum: 27) (Refresh)FirstPrevNext
    GeneralVista PinmemberB4stard17:27 9 Aug '07  
    GeneralThank you Pinmemberjrivero10:57 19 Jan '07  
    Generaledit recorded events....? Pinmemberrm_pkt0:46 8 Nov '06  
    GeneralHow to capture the time user types the keyboard Pinmemberimagica7:44 2 Nov '06  
    QuestionJournalRecord and JournalPlayback on "Windows CE"?? Pinmemberponian1:03 23 Aug '06  
    GeneralRe: JournalRecord and JournalPlayback on "Windows CE"?? Pinmemberponian1:08 23 Aug '06  
    GeneralVS.NET users (VC7.1 +) - Compiler Error C2316 PinmemberIntellex9:18 15 Aug '05  
    GeneralMonitorize mouse global events in WINDOWS-CE; PinmemberXBSANTOS2:45 4 May '05  
    GeneralRe: Monitorize mouse global events in WINDOWS-CE; PinmemberRahul P. Shukla23:27 28 Jun '07  
    GeneralMacro PinmemberSaiprabhu19:55 28 Jun '04  
    GeneralHow to catch Ctrl-C PinmemberWill25:48 5 Jun '03  
    GeneralKeyboard only - doesn't work? PinmemberWill223:32 4 Jun '03  
    GeneralRe: Keyboard only - doesn't work? PinmemberWill223:48 4 Jun '03  
    GeneralHow to control your event play times.? PinsussAnonymous23:26 12 May '03  
    GeneralRe: How to control your event play times.? PinmemberPlamen Petrov23:48 12 May '03  
    GeneralRe: How to control your event play times.? PinmemberWayne Gibson5:44 16 Sep '03  
    GeneralIt can't work well with win98!!! Pinmembernavy4:51 5 Jan '03  
    GeneralRe: It can't work well with win98!!! Pinmembernavy17:40 5 Jan '03  
    GeneralLast character has been gone PinsussAnonymous8:06 7 Sep '02  
    GeneralThis source code are OK PinmemberRousset de Pina11:00 17 Feb '02  
    GeneralDON'T DO IT PinmemberAnonymous14:15 13 Feb '02  
    GeneralRe: DON'T DO IT PinmemberRousset de Pina10:54 17 Feb '02  
    GeneralRe: DON'T DO IT PinsussAnonymous4:08 3 Oct '02  
    GeneralRe: DON'T DO IT Pinmembertomaszkluska3:29 16 Dec '03  
    Generalscreen resolution PinmemberStephanie Harding16:59 5 Jun '01  

    General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    PermaLink | Privacy | Terms of Use
    Last Updated: 3 Mar 2001
    Editor: Erik Thompson
    Copyright 2001 by Plamen Petrov
    Everything else Copyright © CodeProject, 1999-2009
    Web16 | Advertise on the Code Project