GetForm

  BOOL GetForm(hPrinter, pFormName, Level, pForm, cbBuf, pcbNeeded)    
  HANDLE hPrinter;    
  LPSTR pFormName;    
  DWORD Level;    
  LPBYTE pForm;    
  DWORD cbBuf;    
  LPDWORD pcbNeeded;    

This function retrieves a FORM_INFO_1 structure based upon the pFormName and the specified Printer.

Parameters

hPrinter

performed upon. This Handle is obtained with the OpenPrinter function.

pFormName

This specifies the Form to retrieve

Level

This value must be 1

pForm

This value points to a buffer which will be filled with a FORM_INFO_1 structure

cbBuf

This value specifies the size of the buffer pointed to by pForm.

pcbNeeded

This points to a variable that will be updated to contain the actual buffer size required that is pointed to by pForm. If cbBuf is too small then GetLastError will indicate ERROR_BUFFER_TOO_SMALL, and pcbNeeded will contain the size required. If cbBuf is large enough, then pcbNeeded will contain the number of bytes that were copied.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. To obtain extended error information, use the GetLastError function.