EM_SETHANDLE

An application sends an EM_SETHANDLE message to set the handle of the memory that will be used by a multiline edit control.

EM_SETHANDLE 
wParam = (WPARAM) (HLOCAL) hloc; // handle of memory buffer 
lParam = 0;                      // not used; must be zero 
 

Parameters

hloc
Value of wParam. Handle to the memory the edit control uses to store the currently displayed text instead of allocating its own memory. If necessary, the control reallocates this memory.

Return Values

This message does not return a value.

Remarks

Before an application sets a new memory handle, it should send an EM_GETHANDLE message to retrieve the handle of the current memory buffer and should free that memory.

An edit control automatically reallocates the given buffer whenever it needs additional space for text, or it removes enough text so that additional space is no longer needed.

Sending an EM_SETHANDLE message clears the undo buffer (EM_CANUNDO returns zero) and the internal modification flag (EM_GETMODIFY returns zero). The edit control window is redrawn.

An application can send this message to a multiline edit control in a dialog box only if it has created the dialog box with the DS_LOCALEDIT style flag set.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Unsupported.
  Windows CE: Requires version 2.0 or later.
  Header: Declared in winuser.h.

See Also

Edit Controls Overview, Edit Control Messages, EM_CANUNDO, EM_GETHANDLE, EM_GETMODIFY