Are you sure that you have a ANSI window created and not a Unicode one?
For Unicode text you would need to use GetWindowTextW, which would also support retrieving ANSI text.
You can then use various functions to convert from Unicode to ANSI text for further processing.