EngGetForm

BOOL EngGetForm(

HANDLE hPrinter,
LPWSTR pFormName,
DWORD dwLevel,
LPBYTE lpbForm,
DWORD cbBuf,
LPDWORD pcbNeeded
);

EngGetForm gets the FORM_INFO_1 details for the specified form.

Parameters

hPrinter

Handle that identifies the printer for which the form is being specified.

pFormName

Pointer to a string that specifies the name of the form.

dwLevel

Specifies the version of the form structure to which lpbForm points. This value must be 1, which indicates that the form information will be returned in a FORM_INFO_1 structure.

lpbForm

Pointer to an array of bytes in which the initialized FORM_INFO_1 structure will be written.

cbBuf

Specifies the size, in bytes, of lpbForm.

pcbNeeded

Points to a value that specifies the number of bytes copied into lpbForm if the function succeeds. The value is the number of bytes required to perform the copy if cbBuf is too small.

Return Value

EngGetForm returns TRUE if the form structure is successfully copied into lpbForm. Otherwise, it logs an error message and returns FALSE. To get the error information, call EngGetLastError.

Comments

EngGetForm returns a FORM_INFO_1 structure containing the form data associated with pFormName. The written data and its size are returned to the caller via lpbForm and pcbNeeded, respectively. If the array pointed to by lpbForm is not large enough to hold the form data, the requisite array size is instead returned in pcbNeeded.

To get a list of all supported forms, the printer driver should call EngEnumForms.

See Also

EngGetLastError