GetPrinterInfo

This function is used to obtain information about printers, such as the name of the printer or whether the printer can print in color.

DWORD WINAPI GetPrinterInfo(
HANDLE hPrint,
DWORD dwOption,
PVOID pBuff, 
PDWORD pBuffLen );

Parameters

  • [IN] hPrint
    Handle obtained from the PrinterOpen function.

  • [IN] dwOption
    Specifies the printer option to retrieve. The following options are available in Windows CE 2.10 and later:

    Value Description
    PRINTER_ID Retrieves the name of the printer. The pBuff parameter must point to a string previously allocated by the calling application. If pBuff is NULL, this function returns ERROR_SUCCESS, and pBuffLen contains the number of characters needed to store the printer name, including the terminating null character. If pBuffLen is NULL, this function returns ERROR_INVALID_PARAMETER. If pBuffLen is not long enough to hold the name of the printer, this function returns ERROR_MORE_DATA along with the correct number of characters needed, including the terminating null character in pBuffLen.
    PRINTER_PEN Retrieves the color or black-and-white capabilities of the ink cartridge currently in an InkJet printer. The pBuff parameter points to a DWORD containing one of the values PEN_BLACK or PEN_COLOR. These values are declared in the Prnport.h header file.
  • [OUT] pBuff
    If pBuff is NULL, this function returns the size of the requested information in the pBufLen parameter, including any terminating null characters. If pBuff is not NULL, this function returns the requested information in the location pointed to by pBuff.

  • [IN/OUT] pBuffLen
    On output, pBufLen contains the size of the requested data. If pBufLen is NULL, this function returns ERROR_INVALID_PARAMETER.

Return values

ERROR_SUCCESS indicates success. One of the following values indicates failure:

  • ERROR_INVALID_PARAMETER
  • ERROR_DEVICE_NOT_READY
  • ERROR_OPENING_PRINT_DEVICE
  • ERROR_NOT_SUPPORTED
  • ERROR_MORE_DATA

Remarks

In Windows CE 2.10, This function supports only printers that connect by means of the parallel port.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.10 and later      

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.