INFO: EM_SETHANDLE and EM_GETHANDLE Messages Not Supported

ID: Q130759


The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK), used with:
    • Microsoft Windows 95
  • Microsoft Windows 2000


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- 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.

Additional query words:

Keywords : kbCtrl kbEditCtrl kbWinOS2000 kbSDKWin32 kbGrpUser kbWinOS95
Version : WINDOWS:95
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: February 2, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.