Information générale
Catégorie:
Fonctions Windows API
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement