General information
Category:
Windows API functions
>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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only