To import text, an application sends the MLM_IMPORT message to the MLE field
control. This message requires two parameters: plOffset and cbCopy.
The plOffset parameter is a pointer to a variable that specifies
the position in the MLE field where the text from the buffer is to be placed.
The position is an offset from the beginning of the MLE text, that
is, the number of characters from the beginning of the MLE text. If plOffset
points to a variable that equals -1, the MLE field control places the
text starting at the current cursor position. On return, this variable contains
the offset to the first character beyond the imported text. The cbCopy
parameter of the MLM_IMPORT message points to a variable that specifies
the number of bytes to import.
The following criterias apply when importing MLE text:
- If the text ends by a line feed (LF), the import logic
generates a blank line.
- If the text ends by a carriage return (CR), MLE prevents
a line break (LB) but flags the condition.
- If the plOffset field points to the current
cursor position (-1) and the import text contains a LF:
- If the MLE text is imported before the text being
edited, then the cursor does not move and the text being edited is shifted
down to make room for the text being imported.
- If the MLE text is imported after the text being
edited, then the cursor does not move and the text being imported is inserted
starting at the current cursor position.
If
the plOffset field points to the current cursor position (-1) and
the import text does not contain a LF:
- If the MLE text is imported before the text being
edited, then the cursor does not move and the text being edited is shifted
to the right to make room for the text being imported.
- If the MLE text is imported after the text being
edited, then the cursor does not move and the text being imported is inserted
starting at the current cursor position.
[Back]
[Next]