EM_SETHANDLE

This message establishes the text buffer used to hold the contents of the control window.

Parameter Description  

wParam Contains a handle to the buffer. The handle must be a local handle to a location in the application's data segment. The edit control uses this buffer to store the currently displayed text, instead of allocating its own buffer. If necessary, the control reallocates this buffer.  
Parameter Description  

lParam Is not used.  

Comments

This message will not be processed by single-line edit controls.

If the EM_SETHANDLE message is used to change the text buffer used by an edit control, the previous text buffer is not destroyed. The application must retrieve the previous buffer handle before setting the new handle, and must free the old handle by using the LocalFree function.

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. An application may send this message to a control only if it has created the dialog box containing the control with the DS_LOCALEDIT style flag set.