Windows GDI
AddForm
The AddForm function adds a form to the list of available forms that can be selected for the specified printer.
BOOL AddForm(
HANDLE hPrinter, // handle to printer object
DWORD Level, // data-structure level
LPBYTE pForm // form information buffer
);
Parameters
- hPrinter
- [in] Handle to the printer that supports printing with the specified form. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
- Level
- [in] Specifies the level 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
An application can determine which forms are available for a printer by calling the EnumForms function.
If pForm points to a FORM_INFO_2, then AddForm will fail if either a form with the specified name already exists or the structure's pKeyword value already exists.
Windows NT/2000/XP/Vista: Included in Windows NT 3.51 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, EnumForms, FORM_INFO_1, FORM_INFO_2, OpenPrinter