PRB: Sending a WM_GETTEXT Does Not Return a String for Non-Text Static Controls

ID: Q226323


The information in this article applies to:


SYMPTOMS

BETA INFORMATION BETA INFORMATION BETA INFORMATION

This article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this Beta product. For information about obtaining support for a Beta release, please see the documentation included with the Beta product files, or check the Web location from which you downloaded the release.

BETA INFORMATION BETA INFORMATION BETA INFORMATION


Sending a WM_GETTEXT message to a non-text static control, such as a static bitmap or static icon control, does not return a string value.


CAUSE

The behavior of non-text-mode static controls (for example, SS_BITMAP, SS_ICON, and so forth, styles are set) was changed in Windows 2000 so that WM_GETTEXT does not return a string. In addition, WM_GETTEXTLENGTH also returns zero for these types of controls.


STATUS

This behavior is by design.


MORE INFORMATION

In earlier versions of Windows and Windows NT, applications send a WM_GETTEXT message to a non-text static control to retrieve the control's ID.

Applications can use GetWindowLong, passing GWL_ID as the index value, or GetWindowLongPtr, using GWLP_ID to retrieve a control's ID.

Additional query words: WM_GETTEXT WM_GETTEXTLENGTH GetWindowText GetWindowTextLength static control


Keywords          : kbWinOS2000 kbSDKPlatform kbStaticCtrl kbGrpUser 
Version           : WINDOWS:
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: April 30, 1999