Home > Windows API > Scared to use GetWindowText!!

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…

InternalGetWindowText 😀

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!!! 😐

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: