Microsoft KB Archive/226323

{|
 * width="100%"|

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

 * }

Q226323

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * the operating system: Microsoft Windows 2000

-

SYMPTOMS
Sending a WM_GETTEXT message to a non-text static control, such as a static bitmap or static icon control, does not retrieve 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 retrieve 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 : kbOSWin2000 kbSDKPlatform kbStaticCtrl kbGrpDSUser

Issue type : kbprb

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch