public static extern int GetWindowText(IntPtr hWnd, out STRINGBUFFER text, int maxCount); [DllImport("user32.dll", CharSet=CharSet.Auto)]