I have a C program that has a textbox component. I want to have a python GUI write text to this text box. Currently, I can write to the textbox HWND using:
def winFunc(hwnd, lparam):
s = win32gui.GetWindowText(hwnd)
if s == "":
win32gui.SendMessage(hwnd, win32con.WM_SETTEXT, 0, lparam)
hwnd = win32gui.FindWindow("Graph Program", None)
win32gui.EnumChildWindows(hwnd, winFunc, text)
This code will write text to the textbox but it cannot append text on a newline to the textbox. Is it possible to read in the text that is currently in the textbox or is it possible to add text to a textbox? I am new to using the windows API. Also, Is it possible to write text as a different color? The text box class is RICHEDIT20A.