Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending keystrokes to another program
Message
 
À
29/06/2006 11:30:42
Barbara Hill
B.L. Hill Applications Limited
Halifax, Nouvelle-Écosse, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01132552
Message ID:
01132807
Vues:
18
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform