Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending keystrokes to non VFP windows
Message
 
À
18/11/1998 10:01:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00158751
Message ID:
00159125
Vues:
27
>Is there any way to send keystrokes to other windows. I want to automate the filling in of several screens.Any ideas would be greatly appreciated.

Here's how I send Ctrl+V to the active application from a C++ program:

keybd_event(VK_CONTROL, 0, 0, 0);
keybd_event('V', 0, 0, 0);
keybd_event('V', 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);

I won't bother posting the defines for VK_CONTROL, etc., since no doubt you'll have others you need. The point is that the process is rather low-level, to say the least: for each key, you have to send the keycode for the downstroke and the upstroke. Furthermore, giving any particular app the keyboard focus is not something I've been able to figure out how to do in Windows 98.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform