|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| No
| Win32s
| No
| Import Library
| winspool.lib
| Header File
| winspool.h
| Unicode
| WinNT
| Platform Notes
| None
|
|
|
EnumPrinterData
[New - Windows NT]
The EnumPrinterData function enumerates configuration data for a specified printer.
A printer's configuration data consists of a set of named and typed values.
The EnumPrinterData function obtains one of these values, and its name and a type code, each time
you call it. Call the EnumPrinterData function several times in succession to obtain all of a printer's
configuration data values.
Printer configuration data is stored in the registry. While enumerating
printer configuration data, you should avoid calling registry functions that might
change that data.
DWORD EnumPrinterData(
HANDLE hPrinter,
| // handle to printer of interest
| DWORD dwIndex,
| // index of value to retrieve
| LPTSTR pValueName,
| // pointer to buffer to receive value name
| DWORD cbValueName,
| // size in bytes of value name buffer
| LPDWORD pcbValueName,
| // pointer to variable to receive number of bytes stored into value name buffer
| LPDWORD pType,
| // pointer to variable to receive value type code
| LPBYTE pData,
| // pointer to buffer to receive value data
| DWORD cbData,
| // size in bytes of value data buffer
| LPDWORD pcbData
| // pointer to variable to receive number of bytes stored into value data buffer
| );
|
|
Parameters
hPrinter
Handle to the printer whose configuration data is to be obtained.
You obtain this printer handle by calling the OpenPrinter function.
dwIndex
An index value that specifies the configuration data value to retrieve.
Set this parameter to zero for the first call to EnumPrinterData for a given printer handle. Then increment the parameter by one for
subsequent calls involving the same printer, until the function returns
ERROR_NO_MORE_ITEMS. See the following Remarks section for further information.
Note: If you use the technique mentioned in the descriptions of the cbValueName and cbData parameters to obtain adequate buffer size values, setting both those
parameters to zero in a first call to EnumPrinterData for a given printer handle, the value of dwIndex does not matter for that call. Set dwIndex to zero in the next call to EnumPrinterData to start the actual enumeration process.
Configuration data values are not ordered. New values will have an arbitrary
index. This means that the EnumPrinterData function may return values in any order.
pValueName
Pointer to a buffer that receives the name of the configuration data value,
including a terminating null character.
cbValueName
Specifies the size, in bytes, of the buffer pointed to by pValueName.
If you want to have the operating system supply an adequate buffer size, set
both this parameter and the cbData parameter to zero for the first call to EnumPrinterData for a given printer handle. When the function returns, the variable pointed
to by pcbValueName will contain a buffer size that is large enough to successfully enumerate all
of the printer's configuration data value names.
pcbValueName
Pointer to a variable that receives the number of bytes stored into the buffer
pointed to by pValueName.
pType
Pointer to a variable that receives a type code for the value specified by dwIndex. The type code can be one of the following values:
Value
| Meaning
| REG_BINARY
| Binary data in any form.
| REG_DWORD
| A 32-bit number.
| REG_DWORD_LITTLE_ENDIAN
| A 32-bit number in little-endian format. This is equivalent to REG_DWORD.
In little-endian format, a multi-byte value is stored in memory from the
lowest byte (the "little end") to the highest byte. For example, the value
0x12345678 is stored as (0x78 0x56 0x34 0x12) in little-endian format.
Windows NT and Windows 95 are designed to run on little-endian computer
architectures. A user may connect to computers that have big-endian architectures,
such as some UNIX systems.
| REG_DWORD_BIG_ENDIAN
| A 32-bit number in big-endian format.
In big-endian format, a multi-byte value is stored in memory from the highest
byte (the "big end") to the lowest byte. For example, the value 0x12345678 is
stored as (0x12 0x34 0x56 0x78) in big-endian format.
Windows NT and Windows 95 are designed to run on little-endian computer
architectures. A user may connect to computers that have big-endian architectures,
such as some UNIX systems.
| REG_EXPAND_SZ
| A null-terminated string that contains unexpanded references to environment
variables (for example, "%PATH%"). It will be a Unicode or ANSI string depending
on whether you use the Unicode or ANSI functions.
| REG_LINK
| A Unicode symbolic link.
| REG_MULTI_SZ
| An array of null-terminated strings, terminated by two null characters.
| REG_NONE
| No defined value type.
| REG_RESOURCE_LIST
| A device-driver resource list.
| REG_SZ
| A null-terminated string. It will be a Unicode or ANSI string, depending on
whether you use the Unicode or ANSI functions.
|
The pType parameter can be NULL if the type code is not required.
pData
Pointer to a buffer that receives the configuration data value.
This parameter can be NULL if the configuration data value is not required.
cbData
Specifies the size, in bytes, of the buffer pointed to by pData.
If you want to have the operating system supply an adequate buffer size, set
both this parameter and the cbValueName parameter to zero for the first call to EnumPrinterData for a given printer handle. When the function returns, the variable pointed
to by pcbData will contain a buffer size that is large enough to successfully enumerate all
of the printer's configuration data value names.
pcbData
Pointer to a variable that receives the number of bytes stored into the buffer
pointed to by pData.
This parameter can be NULL if pData is NULL.
Return Values
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a Win32 error value.
The function returns ERROR_NO_MORE_ITEMS when there are no more configuration
data values to retrieve for a given printer handle.
Remarks
EnumPrinterData retrieves printer configuration data set by the SetPrinterData function.
If you want to have the operating system supply an adequate buffer size, first
call EnumPrinterData with both the cbValueName and cbData parameters set to zero, as noted earlier in the Parameters section. The value of dwIndex does not matter for this call. When the function returns, *pcbValueName and *pcbData will contain buffer sizes that are large enough to enumerate all of the
printer's configuration data value names and values. On the next call, allocate
value name and data buffers, set cbValueName and cbData to the sizes in bytes of the allocated buffers, and set dwIndex to zero. Thereafter, continue to call the EnumPrinterData function, incrementing dwIndex by one each time, until the function returns ERROR_NO_MORE_ITEMS.
See Also
DeletePrinterData, GetPrinterData, OpenPrinter, SetPrinter, SetPrinterData
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|