Windows GDI
SetForm
The SetForm function sets the form information for the specified printer.
BOOL SetForm(
HANDLE hPrinter, // handle to printer object
LPTSTR pFormName, // form name
DWORD Level, // information level
LPBYTE pForm // form buffer
);
Parameters
- hPrinter
- [in] Handle to the printer for which the form information is set. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
- pFormName
- [in] Pointer to a null-terminated string that specifies the form name for which the form information is set.
- Level
- [in] Specifies the version of the structure to which pForm points. This value must be 1 or 2.
- pForm
- [in] Pointer to a FORM_INFO_1 or FORM_INFO_2 structure.
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
SetForm can be called multiple times for an existing FORM_INFO_2, each call adding additional pairs of pDisplayName and wLangId values. All languages versions of the form will get the Size and ImageableArea values of the FORM_INFO_2 in the most recent call to SetForm.
If the caller is remote and the Level is 2, the StringType value of the FORM_INFO_2 cannot be STRING_MUIDLL.
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, GetForm, OpenPrinter, FORM_INFO_1,
FORM_INFO_2