Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling other applications from VFP
Message
From
09/09/2010 20:33:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Controlling other applications from VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01480741
Message ID:
01480741
Views:
183
I need to be able to send data to another application that is running as if the data were typed into the keyboard. My VFP program uses the Win32API to BringWindowToTop and then ShowWindow. It was suggested that I use some code similar to the following to "pass" data to the application but it sends it to the first text box in what I would call the tab order. I need the character string to be inserted at the current cursor location. Tried this but didn't quite work the way I need it too.

oWSH = CREATEOBJECT("wscript.shell")
oWSH.AppActivate({Application Name Goes Here})
oWSH.SendKeys("12345")

The field I need the data to go into is currently active field after I issue a _SCREEN.WindowState=1. This field also in not in the TAB rotation, so i cannot just issue several tabs until its on the correct field.
Reply
Map
View

Click here to load this message in the networking platform