MLM_SETFORMATRECT
Appearance
This message sets the format dimensions and mode.
Syntax
param1 PPOINTL pFormatRect; /* New format dimensions. */ param2 ULONG flFlags; /* Flags governing interpretation of dimensions. */
Parameters
- pFormatRect (PPOINTL) - input
- New format dimensions.
- NULL: A null value sets both dimensions to the current window size.
- Other: The structure is a pair of LONGs designating the diagonally-opposite
- corner of the rectangle, assuming 0,0 for the first. Therefore, they are the width
- and height in pels of the format rectangle. These dimensions are used as the
- word-wrap and text-size limiting boundaries. Negative values for either
- dimension cause the MLE to substitute the current window size (the MLE window rectangle
- minus margins).
- If the rectangle specified has either or both of the limits set, and the
- size is inadequate to contain the text, rc is set to FALSE and the rectangle
- dimensions are replaced with the overflow amounts.
- flFlags (ULONG) - input
- Flags governing interpretation of dimensions.
- MLFFMTRECT_MATCHWINDOW: The dimensions of the format rectangle are always to
- be kept the same as the window size minus the margins. This causes the MLE
- implicitly to do a MLM_SETFORMATRECT each time the window is resized, and effectively
- causes any other dimensions to be ignored. Resizing of the window can cause this
- setting to be automatically negated (see MLN_OVERFLOW).
- MLFFMTRECT_LIMITHORZ: The width of any line in the MLE cannot exceed the given
- horizontal dimension. If word-wrap is on, this limit has no effect. Word-wrap can
- result in trailing blanks beyond the right limit. These do not cause an overflow
- notification.
- MLFFMTRECT_LIMITVERT: The vertical height of the total text, as displayed, is limited to that which fits totally within the vertical dimension of the format rectangle.
- MLFFMTRECT_MATCHWINDOW: The dimensions of the format rectangle are always to
Returns
- rc (BOOL) - return
- Success indicator.
- TRUE: Successful completion.
- FALSE: An error occurred.
Remarks
The multi-line entry field control window procedure responds to this message by setting formatting dimensions and mode.
Any addition of text that causes the text to exceed the rectangle limits causes a notification before proceeding (see MLN_PIXHORZOVERFLOW and MLN_PIXVERTOVERFLOW).
Any activity that would cause the rectangle to be unable to contain the existing text (resize, undo, increasing font size, or word-wrap on or off) is rejected and results in a notification message for information (see MLN_OVERFLOW).
Default Processing
The default window procedure takes no action on this message, other than to set rc to FALSE.