INFO: EM_SETHANDLE and EM_GETHANDLE Messages Not Supported
Article ID: 130759
Article Last Modified on 7/11/2005
APPLIES TO
- Microsoft Platform Software Development Kit-January 2000 Edition, when used with:
This article was previously published under Q130759
SUMMARY
The EM_GETHANDLE and EM_SETHANDLE messages are not supported for edit
contols that are created as controls of a 32-bit application under Windows
95. This is due to the way USER is designed under Windows 95. 16-bit applications work the same way they did under Windows version 3.1. That is, they can use the EM_GET/SETHANDLE messages. Also Win32-based applications running under Windows NT will be able to use these messages.
MORE INFORMATION
The EM_GETHANDLE and EM_SETHANDLE messages are used to retrieve and set the
handle of the memory currently allocated for a multiline edit control's
text. USER under Windows 95 is a mixture of 16-bit and 32-bit code, so edit controls created inside a 32-bit application cannot use these messages to retrieve or set the handles. Trying to do so causes the application to cause a general protection (GP) fault and thereby be terminated by the System.
One workaround that involves a little code modification is to use the
GetWindowTextLengt(), GetWindowText(), and SetWindowText() APIs to retrieve
and set the text in a edit control.
NOTE: USER is almost completely 16-bit, so 32-bit applications thunk down
to the 16-bit USER. Also note that the EM_GETHANDLE and EM_SETHANDLE
messages cannot be used with Win32s-based applications either.
Keywords: kbinfo kbeditctrl kbctrl KB130759