Microsoft Windows CE 3.0  

GetPrinterInfo

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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 PrinterOpenfunction.
[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 pBuffparameter must point to a string previously allocated by the calling application. If pBuffis NULL, this function returns ERROR_SUCCESS, and pBuffLencontains the number of characters needed to store the printer name, including the terminating null character. If pBuffLenis NULL, this function returns ERROR_INVALID_PARAMETER. If pBuffLenis 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 pBuffparameter points to a DWORDcontaining one of the values PEN_BLACK or PEN_COLOR. These values are declared in the Prnport.h header file.
[OUT] pBuff
If pBuffis NULL, this function returns the size of the requested information in the pBufLenparameter, including any terminating null characters. If pBuffis not NULL, this function returns the requested information in the location pointed to by pBuff.
[IN/OUT] pBuffLen
On output, pBufLencontains the size of the requested data. If pBufLenis 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

    © 2004 Microsoft Corporation. All rights reserved.