I am doing GUI automation(winmerge) in python using win32api
.I have to select the winmerge window so that i can send some keyboard strokes to it using sendkeys function.However my keyboard strokes are going to python active shell and not to the desired window.I do not know the window handle so cant use findwindow function.Can you suggest a way to select the winmerge window.
P.S-i saw a function called Enumwindow(which requires a local callback function arguement.Could you also tell me what to pass as the local call function arguement)
Thanking you in advance.
My code till now-
import win32api
import win32com.client
import subprocess
import win32gui
subprocess.Popen(r'winmergeu {0} {1}'.format('file1','file2') )
shell=win32com.client.Dispatch("WScript.Shell")
shell.Sendkeys("""
%t
r
""")