So i wanted to grab the text from moh console but doesn't seem to work with the following code:
hwnd = win32gui.FindWindow("MOHAA WinConsole", None)
texthwnd = win32gui.FindWindowEx(hwnd, None, "Edit", None)
buffer = win32gui.PyMakeBuffer(2555)
length = win32gui.SendMessage(texthwnd, win32con.WM_GETTEXT, 2555, buffer)
result = buffer[:length]
print result
The code above works for notepad if i change MOHAA WinConsole to Notepad and then it grabs what i typed in notepad.
So i select the MOHAA console which does work because i can change the window title etc. But when i use spy++ to see what class the console is, its "Edit" and when i try to use it, it just doesn't give me anything.
Anyone had this issue before or knows what im doing wrong?