Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendKeys stops sending keys???

Status
Not open for further replies.

oltran

Technical User
Dec 26, 2002
19
US
Hi,

I have an HTML form that when filled out will run a DOS like program and send keys to it to automate a few processes. The problem is that somewhere in the middle sendkeys stops. I ran the program using notepad and sendkeys completes but using this other application it stops at the same place every time. I'm not doing anything fancy like using sendkeys to File>Edit... just to send text to the program. Also, its not stopping in an obvious place where the program would reject anything sent to it, it stops in the middle of a note field in the program.

any ideas?

Thanks a bunch!
Jason
 
SendKeys isn't really very reliable. Any number of things can happen to stop your SendKeys messages from reaching the right program.

"DOS-like?" File|Edit sounds more like a GUI program, even if a DOS GUI-ish program like Edit.exe or something.

If it were a simple DOS program I'd suggest using WShell.Exec instead of WShell.Run, then send stuff to the program's stdin stream. I don't know how to send things like ALT keys via stdin though: such programs usually read the keyboard messages from Windows (or for DOS the keyboard buffer) directly.

Does this external program expose an OLE Automation interface you can script?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top