?
Solved

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

Posted on 2004-11-04
2
Medium Priority
?
225 Views
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
(1)
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

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



0
Comment
Question by:jculkincys
2 Comments
 
LVL 17

Assisted Solution

by:zzzzzooc
zzzzzooc earned 1000 total points
ID: 12502920
You can use WH_JOURNALRECORD and WH_JOURNALPLAYBACK which allows you to get the window-handle from where the message was sent to.

http://www.vbaccelerator.com/home/VB/Code/Libraries/Hooks/Journal_Record_Hooks/article.asp
(the above uses the below DLL)
http://www.vbaccelerator.com/home/VB/Code/Libraries/Hooks/vbAccelerator_Hook_Library/article.asp
0
 
LVL 8

Accepted Solution

by:
rajaloysious earned 1000 total points
ID: 12504306
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..

Cheers
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

840 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