GetWindowText
windows API is your friend:
[DllImport("user32.dll", EntryPoint = "GetWindowText", ExactSpelling = false, CharSet = CharSet.Auto, SetLastError = true)]
private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpWindowText, int nMaxCount);
you would have to get the handle of the other program's window then loop on all child windows/controls using EnumChildWindows
then get the text calling GetWindowText
against all those handles. In some cases you would not get a result as expected I guess or could be that some controls have no handle exposed.
[DllImport("user32")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i);
for details and answers on how to use EnumChildWindows
see here:
Why is EnumChildWindows skipping children?
have also a look here for some ideas and examples... Why does GetWindowText hang with a "closed" handle but not with a random one