DWORD DrvDeviceCapabilities(
HANDLE hPrinter, | |
PWSTR pDeviceName, | |
WORD iDevCap, | |
VOID *pvOutput, | |
DEVMODE *pDevMode | |
); |
DrvDeviceCapabilities provides information about the specified device and its capabilities.
Parameters
hPrinter
Identifies a printer object.
pDeviceName
Points to a zero-terminated string that specifies the name of the device.
iDevCap
Specifies the device capability about which information is requested. This parameter can be one of the following values:
Flag | Capability |
DC_FIELDS | Returns the dmFields member of the printer driver’s DEVMODE structure, indicating which members in the device-independent portion of the structure are supported by the printer driver. |
DC_PAPERS | Retrieves a list of the indexes of the supported forms to pvOutput. Return value is set to the number of supported forms. |
DC_PAPERSIZE | Retrieves a list of the supported form sizes, in .01mm increments, to pvOutput. Return value is set to the number of supported form sizes. |
DC_PAPERNAMES | Retieves a list of supported form names to pvOutput. Return value is set to the number of supported form names. |
DC_MINEXTENT | Returns the minimum allowable values for dmPaperLength and dmPaperWidth members of the printer driver’s DEVMODE structure. |
DC_MAXEXTENT | Returns the maximum allowable values for dmPaperLength and dmPaperWidth members of the printer driver’s DEVMODE structure. |
DC_BINS | Retrieves a list of the indexes of the input bins in pvOutput. Returns the count of the input bins. |
DC_BINNAMES | Retrieves a list of the names of the input bins in pvOutput. Returns the count of the input bins. |
DC_DUPLEX | Returns one if the printer supports duplex printing, otherwise zero. |
DC_SIZE | Returns the size in bytes of the printer driver’s DEVMODE structure. |
DC_EXTRA | Returns the size in bytes of the driver-specific portion of the DEVMODE structure. |
DC_VERSION | Returns the dmSpecVersion member of driver’s DEVMODE structure. |
DC_DRIVER | Returns the dmDriverVersion member of driver’s DEVMODE structure. |
DC_ENUMRESOLUTIONS | Retrieves a list of printer supported resolutions in pvOutput. Returns the count of printer-supported resolutions. |
DC_FILEDEPENDENCIES | Retrieves a list of filenames (to be loaded when the driver is installed) in pvOutput. |
DC_TRUETYPE | Returns one if the driver can use TrueType font, otherwise zero. |
DC_ORIENTATION | Returns the relationship between portrait and landscape orientations for a device. The return value is in terms of the number of degrees that portrait is rotated counterclockwise to produce landscape orientation. |
DC_COPIES | Returns the maximum number of copies of a document the printer can print simultaneously. |
pvOutput
Points to the output buffer.
pDevModes
Points to the source DEVMODE structure.
Return Value
DrvDeviceCapabilities returns the specified device’s capabilities. The actual value depends on iDevCap. The driver should turn off the iDevCap bit for any feature it does not support and return a single value for that value. For example, if the device does not support multiple resolutions, the drivers returns only one resolution when queried with an iDevCap value of DC_ENUMRESOLUTIONS.
This function returns GDI_ERROR if it fails.