Scared to use GetWindowText!!
Well GetWindowText has got some problem with it that if you invoke this API on a window that is hung, you application also get’s hung!
Well what to do?
Microsoft has provided an undocumented API which they say is deprecated, but I find it irresistible…
The documentation says this ( http://msdn2.microsoft.com/en-us/library/ms633523.aspx )…
This function is similar to the GetWindowText function. However, it obtains the window text directly from the window structure associated with the specified window’s handle and then always provides the text as a unicode string. This is unlike GetWindowText which obtains the text by sending the window a WM_GETTEXT message. If the specified window is a control, the text of the control is obtained.
The docs also says this…
…However, this function is deprecated and not intended for general use. It is recommended that you do not use it in new programs because it might be altered or unavailable in subsequent versions of Windows.
I don’t know why they are deprecating it. This is what the doctor ordered but they!!! 😐