Windows GDI
GetForm
The GetForm function retrieves information about a specified form.
BOOL GetForm(
HANDLE hPrinter, // handle to printer
LPTSTR pFormName, // form name
DWORD Level, // information level
LPBYTE pForm, // array of forms
DWORD cbBuf, // bytes in array
LPDWORD pcbNeeded // bytes received or required
);
Parameters
- hPrinter
- [in] Handle to the printer. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
- pFormName
- [in] Pointer to a null-terminated string that specifies the name of the form. To get the names of the forms supported by the printer, call the EnumForms function.
- Level
- [in] Specifies the version of the structure to which pForm points. This value must be 1 or 2.
- pForm
- [out] Pointer to an array of bytes that receives the initialized FORM_INFO_1 or FORM_INFO_2 structure.
- cbBuf
- [in] Specifies the size, in bytes, of the pForm array.
- pcbNeeded
- [out] 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 a nonzero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the caller is remote, and the Level is 2, the StringType value of the returned FORM_INFO_2 will always be STRING_LANGPAIR.
Windows NT/2000/XP/Vista: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Unsupported.
Header: Declared in Winspool.h; include Windows.h.
Library: Use Winspool.lib.
Unicode: Implemented as Unicode and ANSI versions.
See Also
Printing and Print Spooler Overview, Printing and Print Spooler Functions, AddForm, DeleteForm, OpenPrinter, SetForm