GetForm

The GetForm function initializes a FORM_INFO_1 structure with data describing the specified form for a printer.

BOOL GetForm(
  HANDLE hPrinter,   // handle to printer
  LPTSTR pFormName,  // address of form name
  DWORD Level,       // structure level
  LPBYTE pForm,      // address of structure array
  DWORD cbBuf,       // count of bytes in array
  LPDWORD pcbNeeded  // addr. of variable with count of bytes 
                     // retrieved (or required)
);
 

Parameters

hPrinter
Handle to the printer.
pFormName
Pointer to a null-terminated string that specifies the name of the form.
Level
Specifies the version of the structure to which pForm points. This value must be 1.
pForm
Pointer to an array of bytes that receives the initialized FORM_INFO_1 structure.
cbBuf
Specifies the size, in bytes, of the pForm array.
pcbNeeded
Pointer to a value that specifies the number of bytes copied if the function succeeds or the number of bytes required if cbBuf is too small.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The printer handle hPrinter is obtained by calling the OpenPrinter function.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in winspool.h.
  Import Library: Use winspool.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Printing and Print Spooler Overview, Printing and Print Spooler Functions, AddForm, DeleteForm, OpenPrinter, SetForm