VAPIM_ENABLEINDEX
Enables index-only mode, also called document filtering. This generates text buffer (VAPINM_TEXTBUFFER) notification messages with document viewing disabled. The first text buffer notification message is generated after a VAPIMWP_INIT_OPEN_DOCUMENT message is sent. To get additional text buffer notification messages in this mode, call the VAPIM_GETNEXTTEXTBUFFER message.
Syntax
#include <kvvapi.h> SendMessage(hWndVAPI, VAPIM_ENABLEINDEX, (WPARAM) n_IndexMode, (LPARAM) (TPVAPIHiLiteColor*) lpHiLiteColor );
Arguments
|
Argument |
Description |
|---|---|
|
|
The handle of the VAPI window. |
|
|
0 – Combined mode (document view and text buffers) 1 – Text buffers only 2 – Disable index (document view only) |
|
|
A pointer to a TPVAPIHiLiteColor structure that defines the highlight color used to signify an index hit. |
Returns
SendMessage() returns TRUE if successful; FALSE otherwise.
Discussion
-
This message is passed to the VAPI control window to notify the Viewing display engine that a document index is under way. This message must be sent before the VAPIMWP_INIT_OPEN_DOCUMENT message. Check the return value from
VAPIMWP_INIT_OPEN_DOCUMENTto make sure that indexing was really supported. -
Calling this message produces a sequence of
VAPINM_TEXTBUFFERnotification messages to the calling window—that is, the parent of the VAPI window—as well as enabling the viewing engine to handle highlight and annotation requests. If you are using index-only mode, the VAPI window should be hidden and destroyed when the index is complete. No GDI output is generated and no information is stored to render the document. This results in a faster initial index of the document.When Viewing is in index-only mode,
VAPIM_GETNEXTTEXTBUFFERmessages must be used to drive Viewing to obtainVAPINM_TEXTBUFFERnotification messages, with the exception of the very first buffer. In other words, after you send aVAPIMWP_INIT_OPEN_DOCUMENTmessage, you either get back oneVAPINM_TEXTBUFFERnotification message automatically, or two when there is only one buffer in the file. When you need more, request it. -
When text buffers are no longer necessary, send
VAPIM_ENABLEINDEXwithn_IndexModeset to2and reopen the same document.