Sets the formatting rectangle of a multiline edit control. The formatting rectangle is the limiting rectangle into which the control draws the text. The limiting rectangle is independent of the size of the edit control window.
This message is processed only by multiline edit controls. You can send this message to either an edit control or a rich edit control.
Rich Edit 2.0 and later: Indicates whether lParam specifies absolute or relative coordinates. A value of zero indicates absolute coordinates. A value of 1 indicates offsets relative to the current formatting rectangle. (The offsets can be positive or negative.)
Edit controls and Rich Edit 1.0: This parameter is not used and must be zero.
A pointer to a RECT structure that specifies the new dimensions of the rectangle. If this parameter is NULL, the formatting rectangle is set to its default values.
This message does not return a value.
Setting lParam to NULL has no effect if a touch device is installed, or if EM_SETRECT is sent from a thread that has a hook installed (see SetWindowsHookEx). In these cases, lParam should contain a valid pointer to a RECT structure.
The EM_SETRECT message causes the text of the edit control to be redrawn. To change the size of the formatting rectangle without redrawing the text, use the EM_SETRECTNP message.
When an edit control is first created, the formatting rectangle is set to a default size. You can use the EM_SETRECT message to make the formatting rectangle larger or smaller than the edit control window.
If the edit control does not have a horizontal scroll bar, and the formatting rectangle is set to be larger than the edit control window, lines of text exceeding the width of the edit control window (but smaller than the width of the formatting rectangle) are clipped instead of wrapped.
If the edit control contains a border, the formatting rectangle is reduced by the size of the border. If you are adjusting the rectangle returned by an EM_GETRECT message, you must remove the size of the border before using the rectangle with the EM_SETRECT message.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. The formatting rectangle does not include the selection bar, which is an unmarked area to the left of each paragraph. When the user clicks in the selection bar, the corresponding line is selected. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Minimum supported client
|Windows 2000 Professional [desktop apps only]|
Minimum supported server
|Windows 2000 Server [desktop apps only]|