I'm trying to send Shift+Enter key combination (new line in a textbox) to a window. I have already tested code below with no output:
win32gui.PostMessage(handle, win32con.WM_KEYDOWN, win32con.VK_SHIFT, 0)
win32gui.PostMessage(handle, win32con.WM_KEYDOWN, win32con.VK_RETURN, int('0x1C0001',0))
win32gui.PostMessage(handle, win32con.WM_KEYUP, win32con.VK_RETURN, int('0xC0000001',0))
win32gui.PostMessage(handle, win32con.WM_KEYUP, win32con.VK_SHIFT, 0)
I know that SendKeys
may work but I want to use the function when the target window does'nt have focus or other events and programs are running.
Any ideas?
User contributions licensed under CC BY-SA 3.0