Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending keystrokes to another program
Message
 
To
29/06/2006 11:30:42
Barbara Hill
B.L. Hill Applications Limited
Halifax, Nova Scotia, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01132552
Message ID:
01132807
Views:
17
>Thank you very much. I greatly appreciate your help.
>
>Barb

Here other example. Run some application, wait untill it become available, activate it and send keys:
LOCAL oWS AS Wscript.Shell
DECLARE INTEGER FindWindow          IN WIN32API STRING lcClass, STRING lcCaption
Declare INTEGER SetForegroundWindow IN WIN32API INTEGER hwnd
lcWindowCaption = [Untitled - Notepad]  && Here you must set caption of the application
oWSH            = CREATEOBJECT([Wscript.Shell])
oWSH.Run([NotePad.Exe])
lnHwnd = 0
lnTime = DATETIME()
DO WHILE lnHwnd == 0 AND DATETIME() - lnTime < 10 && Wait untill find the window or 10 seconds timeout
   lnHwnd = FindWindow(NULL, lcWindowCaption)
   DOEVENTS
ENDDO
IF lnHwnd > 0 && No timeout, we found the window
   SetForegroundWindow(lnHwnd)        && Activate the application
   oWSH.SendKeys([This is a Test])    && Send Keys
ENDIF
CLEAR DLLS FindWindow, SetForegroundWindow
Follow the link provided by Farhad to see what Keys you can send.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform