Why does GetWindowText hang with a "closed" handle but not with a random one
See the question and my original answer on StackOverflowRead here a description of GetWindowText undercovers: The secret life of GetWindowText.
I don't think you'll ever get a better one :-) If you really want to be 100% sure you won't hang calling it, you need to do it on another thread that you can manage yourself (ie: kill if you need to)