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

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.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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)
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..


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.