TPVAPIOpenDocumentInfo

Description

This structure defines the parameters used by the VAPIMWP_INIT_OPEN_DOCUMENT message to open a document.

Syntax

#include <kvvapi.h>
typedef struct tag_TPVAPIOpenDocumentInfo
{
    int                size;
    LPSTR              lpszFilePath;
    KPTPIOobj*         lpIOobj;
    adDocDesc*         lpadDocDesc;
    BOOL               bADInstallViewer;
    int                nViewAsMode;
    LPSTR              lpszOrigFilePath;
    Int                nFlags;
    LPSTR              lpszResID;
    LPSTR              lpszVMLFilePath;
    Void*              lpOptions;
    HGLOBAL            hGlobalMem;
    DWORD              dwcbGlobalMem;
    BOOL               bWait;
    int                nGeneralTab;
    BOOL               bAutoViewAsText;
    LPSTR              lpszHighLight;
    BOOL               bMatchHighLightCase;
} 
TPVAPIOpenDocumentInfo;

Members

size

This parameter must be initialized to sizeof(TPVAPIOpenDocumentInfo) before calling VAPIMWP_INIT_OPEN_DOCUMENT.

lpszFilePath

A string containing the full file path of the document to open. This is not required if you are using lpIOobj or hGlobalMem.

lpIOobj

A pointer to a KPTPIOobj structure that contains the I/O object of the document to open. This is not required if you are using lpszFilePath or hGlobalMem.

lpadDocDesc

A pointer to an adDocDesc structure that contains the document format information. Set this to NULL.

bADInstallViewer

A flag to install Viewer if the document is not supported (optional).

nViewAsMode

A flag to display the document as formatted text, text, or hexadecimal (optional). The options are described in Options for nViewAsMode.

lpszOrigFilePath

If lpszFilePath is not the original file path, this optional string contains the full path to the original file.

nFlags

A bit field that contains additional options for opening a document (optional). The options are described in Options for nFlags.

lpszResID

A string that contains the resource ID to use (optional).

lpszVMLFilePath

Reserved. Set this to NULL.

lpOptions

A pointer to an ALL_OPTIONS_EX structure to change the default options for the document (optional). See Change Document Options for more information.

hGlobalMem

A block of memory that contains the input file data (optional). If you use this member, lpIOobj and lpszFilePath must be NULL.

dwcbGlobalMem

The size in bytes of the memory specified by hGlobalMem. This is ignored if hGlobalMem is not used.

bWait

Set to TRUE to make SendMessage() on open not return until the document is fully processed.

This ensures that the document is fully processed before an operation (such as printing, converting, or searching) is performed, and is useful when you want to use an operation immediately after opening the document.

If you are opening a document for viewing only, set this to FALSE so that the first page of the document can be viewed as soon as it is processed.

If you are drawing a word processing document and only want to process it up to the specified page, set bWait to FALSE. When the specified page is reached, processing is paused. This setting minimizes delays.

nGeneralTab

This parameter must be set to 0.

bAutoViewAsText

If you set this flag to TRUE, the document is automatically displayed as unformatted text when the document format cannot be determined or is not supported (optional).

This member will be deprecated in a future release. To display an unknown or unsupported format as text or hexadecimal, set nViewAsMode to VIEW_MODE_AUTO_TEXT or VIEW_MODE_AUTO_HEX.

lpszHighLight

A string that contains text to be highlighted if it is found in the document (optional). You can either search for an intact string or for individual words that might or might not be adjacent. To search for individual words, separate each word with \t, which indicates a tab.

bMatchHighLightCase

A flag to indicate if the text in lpszHighLight is to be matched case-sensitively (TRUE if it is case sensitive).

Discussion

Options for nViewAsMode

Option

Description

VIEW_MODE_NORMAL

Displays the document as formatted text when the format can be determined and is supported. This is the default.

VIEW_MODE_TEXT

Displays each byte as ASCII when the format can be determined.

VIEW_MODE_HEX

Displays each byte as hexadecimal when the format can be determined.

VIEW_MODE_AUTO_TEXT

Automatically displays each byte as ASCII when the format cannot be determined or is not supported. This option overrides the setting in bAutoViewAsText.

VIEW_MODE_AUTO_HEX

Automatically displays each byte as hexadecimal when the format cannot be determined or is not supported. This option overrides the setting in bAutoViewAsText.

File characteristic

Behavior

The file format cannot be determined

The VAPI_RETURN_UNKNOWN_FORMAT message is returned, and the file is displayed as hexadecimal.

The file format can be determined, but is not supported

TheVAPI_RETURN_NO_VIEWER message is returned, and the file is displayed as ASCII text.

The file format can be determined and is supported

The VAPI_RETURN_SUCCESS message is returned, and the file is displayed as ASCII text.


_HP_HTML5_bannerTitle.htm