What kind of text are you trying to obtain? There are a lot of different types of applications like dialog based etc. Is it text in the titlebar,on a label, textbox or some sort of document?
The GetWindowText function copies the text of the specified window’s title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. You might also want to look at the api function
GetWindow to enumerate all the child windows.
You could use GetWindow to enumerate all the sub windows and call
GetWindowText to retrieve whatever you find.
Thats about all the help I can be without knowing more about what you are trying to do.