Is there a .net namespace or similar/simpler way to get text from windows and child classes (controls) other than using a Win32 API messages?
You can use the GetWindowText
API, which is a bit easier than sending a WM_GETTEXT
message. But this will only work for a window, not a for a control inside a window.
I think there is a way to get the handle of the active window in .net without WinAPI. Anyone know what namespace/class does that?
I don't think there is anything like that in the framework. You can, however, retrieve the handle to the main window of a process, using the Process.MainWindowHandle
property