Oct-18-2020, 08:53 AM
Hi,
I used the below to get the Window Handle of an app and bring it to be the focus. I want to type in a string of characters into the app. But using win32api.keybd_event, I am able to type in only single characters? Is there a way to type in a string of characters?
Eg, "I am happy"
Thank you
I used the below to get the Window Handle of an app and bring it to be the focus. I want to type in a string of characters into the app. But using win32api.keybd_event, I am able to type in only single characters? Is there a way to type in a string of characters?
Eg, "I am happy"
Thank you
import win32gui import win32api import win32con hld = win32gui.FindWindow (None, "UNTITLED") # Returns the handle of the window titled UNTITLED if hld>0: win32gui.SetForegroundWindow(hld) win32api.keybd_event(0x46, 0, ) # F