Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Send a keystroke to a hwnd window
Message
De
25/03/2004 13:37:04
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00889676
Message ID:
00889705
Vues:
35
Here's are a few sample commands for a starting point...
DECLARE Sleep IN WIN32API INTEGER nMilli
LOCAL oShell AS WScript.Shell

oShell = CREATEOBJ('Wscript.Shell')

oShell.AppActivate("whatever")
Sleep(1000)

*!*	**	Login
*!*	oShell.SendKeys(lcPassword)
*!*	Sleep(1000)
*!*	oShell.SendKeys("{TAB}")
*!*	Sleep(1000)
*!*	oShell.SendKeys("{ENTER}")
*!*	Sleep(1000*10)
*!*	oShell.SendKeys("%") &&  % = Alt (active menu)
*!*	Sleep(1000)
*!*	oShell.SendKeys("F")
*!*	Sleep(1000)
*!*	oShell.SendKeys("O")
*!*	Sleep(1000)
*!*	oShell.SendKeys("{ENTER}")
*!*	oShell.SendKeys("{TAB}")
*!*	Sleep(1000)
oShell = NULL
Hope this helps,
Guy



>>I have another app running that has a window up whose title is 'Password' so I can find it. However, how can I send a keystroke to it programmatically once I locate the window?
>
>Tracy,
>
>Is the WSH an option? If so, check out the October, 2000 issue of the VFUG newsletter. The late Ed Rauh and I wrote about using the WScript.Shell object in it. It has a SendKeys method that works perfectly.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform