网站首页  词典首页

请输入您要查询的函数:

 

术语 enumprinterdata
释义 EnumPrinterData
语法:
DWORD EnumPrinterData(
__in HANDLE hPrinter,
__in DWORD dwIndex,
__out LPTSTR pValueName,
__in DWORD cbValueName,
__out LPDWORD pcbValueName,
__out LPDWORD pType,
__out LPBYTE pData,
__in DWORD cbData,
__out LPDWORD pcbData
);
EnumPrinterData功能
枚举函数的EnumPrinterData为指定的打印机配置数据。
要检索在一次调用的配置数据,使用EnumPrinterDataEx功能。
参数
hPrinter [in]
句柄到打印机的配置数据的获取。使用OpenPrinter或添加打印机函数检索打印机处理。
dwIndex [in]
索引值,指定配置数据值来检索。
将此参数设置为零先请一指定的打印机句柄EnumPrinterData。然后递增参数对涉及同一台打印机后续调用之一,直到函数返回ERROR_NO_MORE_ITEMS。请参阅更多信息下面备注部分。
如果您使用的cbValueName和cbData参数的描述中提到的技术,以获取足够的缓冲区大小值,设置这两个参数在第一次调用EnumPrinterData零一指定的打印机句柄的dwIndex值不为这一呼吁没有问题。设置dwIndex在下次调用零EnumPrinterData展开实际枚举过程。
配置数据值不是命令。新的值将有一个任意的索引。这意味着EnumPrinterData函数可能会返回任何顺序值。
pValueName [out]
阿一个缓冲区,它接收配置数据的值的名称,其中包括终止空字符指针。
cbValueName [in]
大小,指出以字节为缓冲区的pValueName。
如果您想拥有操作系统提供一个适当的缓冲区大小,都设置此参数和cbData参数零先请一指定的打印机句柄EnumPrinterData。当函数返回时,变量指向pcbValueName将包含一个缓冲区大小足够大,以成功地枚举打印机的配置名称的所有数据值。
pcbValueName [out]
一个变量,它接收到缓冲区的存储字节数指针指向pValueName。
pType [out]
一项阿变量收到代码,以显示在指定的值存储的数据类型的指针。对于可能的类型代码清单,请参阅注册表值类型。该pType参数可以是NULL类型代码是不需要的。
pData [out]
阿一个缓冲区,它接收配置数据值的指针。
此参数可以是NULL如果配置数据值不是必需的。
cbData [in]
大小,指出以字节为缓冲区的pData。
如果您想拥有操作系统提供一个适当的缓冲区大小,都设置此参数和cbValueName参数零先请一指定的打印机句柄EnumPrinterData。当函数返回时,变量指向pcbData将包含一个缓冲区大小足够大,以成功地枚举打印机的配置名称的所有数据值。
pcbData [out]
一个变量,它接收到缓冲区的存储字节数指针指向pData。
此参数可以为NULL,如果pData为NULL。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码。
该函数返回ERROR_NO_MORE_ITEMS时,没有更多的配置数据值来检索一个指定的打印机句柄。
备注
EnumPrinterData检索打印机配置功能的SetPrinterData数据集。打印机的配置数据由一组命名和类型值。该EnumPrinterData功能获得这些值之一,它的名称和类型代码,每次调用它。在连续几次调用EnumPrinterData函数以获取打印机的配置数据的所有值。
打印机配置数据存储在注册表中。虽然列举打印机配置数据,您应该避免调用注册表功能,可能会改变这些数据。
如果您想拥有操作系统提供一个适当的缓冲区大小,同时与设置为零cbValueName和cbData参数,先请EnumPrinterData,如前所述,在参数部分。在dwIndex值不为这一呼吁的问题。当函数返回时,* pcbValueName和* pcbData将包含缓冲区的大小是足够大,以枚举打印机的配置数据值名称和价值观念。在接下来的电话,分配值的名称和数据缓冲区,设置cbValueName和cbData在所分配的缓冲区的字节大小,并设置dwIndex为零。此后,继续要求EnumPrinterData功能,递增一个dwIndex每次,直到函数返回ERROR_NO_MORE_ITEMS。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesEnumPrinterDataW(Unicode)和EnumPrinterDataA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
DeletePrinterData
EnumPrinterDataEx
GetPrinterData
OpenPrinter
SetPrinter
SetPrinterData
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==EnumPrinterData Function
The EnumPrinterData function enumerates configuration data for a specified printer.
To retrieve the configuration data in a single call, use the EnumPrinterDataEx function.
Syntax
DWORD EnumPrinterData(
__in HANDLE hPrinter,
__in DWORD dwIndex,
__out LPTSTR pValueName,
__in DWORD cbValueName,
__out LPDWORD pcbValueName,
__out LPDWORD pType,
__out LPBYTE pData,
__in DWORD cbData,
__out LPDWORD pcbData
);
Parameters
hPrinter [in]
A handle to the printer whose configuration data is to be obtained. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
dwIndex [in]
An index value that specifies the configuration data value to retrieve.
Set this parameter to zero for the first call to EnumPrinterData for a specified 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.
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 specified 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 [out]
A pointer to a buffer that receives the name of the configuration data value, including a terminating null character.
cbValueName [in]
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 specified 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 [out]
A pointer to a variable that receives the number of bytes stored into the buffer pointed to by pValueName.
pType [out]
A pointer to a variable that receives a code indicating the type of data stored in the specified value. For a list of the possible type codes, see Registry Value Types . The pType parameter can be NULL if the type code is not required.
pData [out]
A pointer to a buffer that receives the configuration data value.
This parameter can be NULL if the configuration data value is not required.
cbData [in]
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 specified 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 [out]
A 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 Value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a system error code.
The function returns ERROR_NO_MORE_ITEMS when there are no more configuration data values to retrieve for a specified printer handle.
Remarks
EnumPrinterData retrieves printer configuration data set by the SetPrinterData function. 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.
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.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesEnumPrinterDataW (Unicode) and EnumPrinterDataA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
DeletePrinterData
EnumPrinterDataEx
GetPrinterData
OpenPrinter
SetPrinter
SetPrinterData
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162688(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:18:30