Click here to Skip to main content
11,490,282 members (54,036 online)
Click here to Skip to main content

Journaling Input Events

, 3 Mar 2001 113.2K 3.7K 52
Rate this:
Please Sign up or sign in to vote.
A tool for recording and playback of keyboard and mouse input
<!-- Download Links -->
  • Download source files - 18 Kb
  • Download demo project - 74 Kb
  • <!-- Article image -->

    Sample Image - HookManager.jpg

    <!-- Main HTML starts here -->

    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

    Share

    About the Author

    Plamen Petrov
    Software Developer
    Bulgaria Bulgaria
    see www.geocities.com/plamen_petrov2000

    Comments and Discussions

     
    Generalutility to record mouse and keyboard inputs Pin
    Member 1096510122-Jul-14 22:09
    memberMember 1096510122-Jul-14 22:09 
    Suggestionhttp://automatemytasks.weebly.com Pin
    Member 1093440018-Jul-14 3:55
    memberMember 1093440018-Jul-14 3:55 
    QuestionMouse cursor disappears Pin
    Chris Hills2-Mar-10 12:54
    memberChris Hills2-Mar-10 12:54 
    GeneralVista Pin
    B4stard9-Aug-07 17:27
    memberB4stard9-Aug-07 17:27 
    GeneralThank you Pin
    jrivero19-Jan-07 10:57
    memberjrivero19-Jan-07 10:57 
    Questionedit recorded events....? Pin
    rm_pkt8-Nov-06 0:46
    memberrm_pkt8-Nov-06 0:46 
    QuestionHow to capture the time user types the keyboard Pin
    imagica2-Nov-06 7:44
    memberimagica2-Nov-06 7:44 
    QuestionJournalRecord and JournalPlayback on "Windows CE"?? Pin
    ponian23-Aug-06 1:03
    memberponian23-Aug-06 1:03 
    Is it possible to do journalRecord and journalPlayback on Windows CE? I tried it but in vain! Sniff | :^)
    GeneralRe: JournalRecord and JournalPlayback on "Windows CE"?? Pin
    ponian23-Aug-06 1:08
    memberponian23-Aug-06 1:08 
    GeneralVS.NET users (VC7.1 +) - Compiler Error C2316 Pin
    Intellex15-Aug-05 9:18
    memberIntellex15-Aug-05 9:18 
    GeneralMonitorize mouse global events in WINDOWS-CE; Pin
    XBSANTOS4-May-05 2:45
    memberXBSANTOS4-May-05 2:45 
    GeneralRe: Monitorize mouse global events in WINDOWS-CE; Pin
    Rahul P. Shukla28-Jun-07 23:27
    memberRahul P. Shukla28-Jun-07 23:27 
    GeneralMacro Pin
    Saiprabhu28-Jun-04 19:55
    memberSaiprabhu28-Jun-04 19:55 
    QuestionHow to catch Ctrl-C Pin
    Will25-Jun-03 5:48
    memberWill25-Jun-03 5:48 
    QuestionKeyboard only - doesn't work? Pin
    Will24-Jun-03 23:32
    memberWill24-Jun-03 23:32 
    AnswerRe: Keyboard only - doesn't work? Pin
    Will24-Jun-03 23:48
    memberWill24-Jun-03 23:48 
    QuestionHow to control your event play times.? Pin
    Anonymous12-May-03 23:26
    sussAnonymous12-May-03 23:26 
    AnswerRe: How to control your event play times.? Pin
    Plamen Petrov12-May-03 23:48
    memberPlamen Petrov12-May-03 23:48 
    GeneralRe: How to control your event play times.? Pin
    Wayne Gibson16-Sep-03 5:44
    memberWayne Gibson16-Sep-03 5:44 
    GeneralIt can't work well with win98!!! Pin
    navy5-Jan-03 4:51
    membernavy5-Jan-03 4:51 
    GeneralRe: It can't work well with win98!!! Pin
    navy5-Jan-03 17:40
    membernavy5-Jan-03 17:40 
    GeneralLast character has been gone Pin
    Anonymous7-Sep-02 8:06
    sussAnonymous7-Sep-02 8:06 
    GeneralThis source code are OK Pin
    Rousset de Pina17-Feb-02 11:00
    memberRousset de Pina17-Feb-02 11:00 
    GeneralDON'T DO IT Pin
    Anonymous13-Feb-02 14:15
    memberAnonymous13-Feb-02 14:15 
    GeneralRe: DON'T DO IT Pin
    Rousset de Pina17-Feb-02 10:54
    memberRousset de Pina17-Feb-02 10:54 
    GeneralRe: DON'T DO IT Pin
    Anonymous3-Oct-02 4:08
    sussAnonymous3-Oct-02 4:08 
    GeneralRe: DON'T DO IT Pin
    tomaszkluska16-Dec-03 3:29
    membertomaszkluska16-Dec-03 3:29 
    Generalscreen resolution Pin
    Stephanie Harding5-Jun-01 16:59
    memberStephanie Harding5-Jun-01 16:59 
    GeneralExcelent idea Pin
    eqnet5-Mar-01 11:10
    membereqnet5-Mar-01 11:10 
    GeneralRe: Excelent idea Pin
    Plamen Petrov6-Mar-01 20:21
    memberPlamen Petrov6-Mar-01 20:21 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    | Advertise | Privacy | Terms of Use | Mobile
    Web04 | 2.8.150520.1 | Last Updated 4 Mar 2001
    Article Copyright 2001 by Plamen Petrov
    Everything else Copyright © CodeProject, 1999-2015
    Layout: fixed | fluid