Record Keystrokes and Reexecute them in 2 programs - Like a Macro

Posted on 2004-11-04
Last Modified: 2010-05-02
Hello I need help making a program (or 2 programs) in VB6 that will record keystrokes in 2 programs and then execute them at a predefined time later.

So two make parts
recording the keystrokes (fyi this will include a switch between programs - maybe using alt tab but I would like a slicker way in case the user has a different number of programs open at run time)

This does not have to be a recorder that runs in the background. We can write down the needed keystrokes and executre them again when this program is started

So this is probably the simplier half. It would be nice to recorded the switch from program 1 to program 2 but if that is too much then thats fine - we can just figure out the point where it happened and deal with that in part 2 when we are executing the keystrokes

getting the window handle for the correct window and reexecuting the appropirate keystrokes in them

** This has nothing to do with spyware **
It will be used to speed up prodcution - it will not require the user to keep doing the same list of commands in 2 programs every time they want to complete a process.

Question by:jculkincys
    LVL 17

    Assisted Solution

    You can use WH_JOURNALRECORD and WH_JOURNALPLAYBACK which allows you to get the window-handle from where the message was sent to.
    (the above uses the below DLL)
    LVL 8

    Accepted Solution

    Have a thought...
    I guess a better idea would be call the integface of the second program from the first to save information or do processing.

    If you persist with the  recording key strokes, ou can find the window handles using properties like caption etc..


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now