This should do it:
public static IEnumerable<string> GetScreenContents(AutomationElement window)
{
var systemButton = window.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.NameProperty, "System"));
var pattern = (ExpandCollapsePattern)systemButton.GetCurrentPattern(ExpandCollapsePattern.Pattern);
pattern.Expand();
SendKeys.SendWait("E");
SendKeys.SendWait("S");
Thread.Sleep(100);
pattern.Expand();
SendKeys.SendWait("E");
SendKeys.SendWait("Y");
Thread.Sleep(100);
var clipText = Clipboard.GetText();
var screenWidth = 150;
return Enumerable.Range(0, clipText.Length / screenWidth)
.Select(i => clipText.Substring(i * screenWidth, screenWidth));
}
The first 2/3 of it go to a given AutomationElement, find the system button (the top left widget which has a drop-down menu for system functions), and then select "Edit->Select All". It then does this again, only with "Edit->Copy".
The final third takes this text and splits it into chunks the width of the screen (150 characters in my case).
You get the AutomationElement from a given hWnd using the following:
var window = AutomationElement.FromHandle(hWnd);