EM_SETHANDLE and EM_GETHANDLE Messages Not Supported

Last reviewed: September 29, 1995
Article ID: Q130759
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows 95 version 4.0
    

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 reference words: 4.00 user controls GPF
KBCategory: kbui
KBSubcategory: UsrCtl


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.