BOOL EngEnumForms(
HANDLE hPrinter, | |
DWORD dwLevel, | |
LPBYTE lpbForms, | |
DWORD cbBuf, | |
LPDWORD pcbNeeded, | |
LPDWORD pcbReturned | |
); |
EngEnumForms enumerates the forms supported by the specified printer.
Parameters
hPrinter
PDEV handle of the printer for which the forms should be enumerated. This is the handle that is passed as the hDriver parameter of DrvEnablePDEV.
dwLevel
Specifies the version of the structure pointed to by lpbForms. This value must be 1, which indicates that the enumerated forms are to be returned in FORM_1_INFO structures.
lpbForms
Pointer to an array of bytes in which the enumerated FORM_INFO_1 structures are written.
cbBuf
Specifies the size, in bytes, of lpbForms.
pcbNeeded
Address of the value that specifies the number of bytes copied into lpbForm if the copy is completed successfully. If lpbForms is too small to contain all the enumerated forms’ data, this parameter specifies the number of bytes required.
pcbReturned
Address of the value that specifies the number of FORM_INFO_1 structures copied into lpbForms.
Return Value
EngEnumForms returns TRUE if all parameters are valid and the enumerated form data is successfully copied into lpbForms. Otherwise, it returns FALSE and an error message is logged. To get error information, call EngGetLastError.
Comments
A printer driver can call EngEnumForms to have GDI obtain the list of forms supported by a particular printer. The enumerated information is returned as an array of FORM_INFO_1 structures pointed to by lpbForms. If the array pointed to by lpbForms is not large enough to hold the enumerated data, the requisite array size is instead returned in pcbNeeded.
See Also