Simplified and working code below, but only works once then not again until the window is restarted. Is there some sort of finish set text missing or some other limitation? Can't find any results on google, Thanks
import win32api
import win32gui
import win32con
handle = windowName #Script is working with actual window name
mainWindowHWND = win32gui.FindWindow(None, handle)
win32api.SendMessage(mainWindowHWND, win32con.WM_SETTEXT, 0, "test")