VAPINM_TEXTBUFFER
Syntax
#include <kvvapi.h> VAPINM_TEXTBUFFER = uMsg; (wParam is unused). TPVAPITextInfo lpTextInfo = (TPVAPITextInfo*) lParam;
Arguments
Argument |
Description |
---|---|
|
Pointer to a TPVAPITextInfo structure that defines the text buffer. |
Returns
None
Discussion
-
The
lpTextInfo->cbText
parameter is the number of bytes of text in the buffer. Typically, the buffer is approximately 4 KB, but might be larger. It cannot exceed 10 KB.Text buffers are usually created at an even boundary, such as the end of a paragraph, table row, or page column. However, if a table row or page column contains a large amount of text, it might be split across text buffers to make sure that
lpTextInfo->cbText
does not exceed 10 K. Individual words are never split across buffers. IflpTextInfo
isNULL
, the end of the document is reached. -
The
lpTextInfo->lpText
parameter is a pointer to the buffer of characters. Typically, the buffer is in the Windows ANSI character set; however, the Viewing API allows the user to select either the OEM or ANSI character set for text files. Depending on your integration of Viewing, this might or might not be an issue.The buffer is zero-terminated. The terminator is not counted in the byte count. The text is an allocated buffer returned to the system upon return of this message. Therefore, you can write within this buffer if it is convenient.
Embedded control codes exist as follows:
KV_EOP
0x01
End of paragraph.
KV_EOC
0x02
End of cell.
KV_PIC
0x03
Picture exists at this logical address.
-
To form a logical address from a
TEXTBUFFER
message, take the base address and add to it the number ofBYTES
from the start of the text buffer (lpText
) that the base address references.For example, the following
TEXTBUFFER
messages might occur in a document:{ 0, 1000, xxxx } { 1000, 2300, yyyy } { 3300, 1000, zzzz }
In this case, addresses 0 through 999 exist in the first
TEXTBUFFER
, addresses 1000 through 3299 in the second buffer, and 3300 through 4299 in the third buffer.