网站首页  词典首页

请输入您要查询的函数:

 

术语 setprinterdataex
释义 SetPrinterDataEx
语法:
DWORD SetPrinterDataEx(
__in HANDLE hPrinter,
__in LPCTSTR pKeyName,
__in LPCTSTR pValueName,
__in DWORD Type,
__in LPBYTE pData,
__in DWORD cbData
);
SetPrinterDataEx功能
该SetPrinterDataEx函数设置打印机或打印服务器的配置数据。函数的配置数据存储在打印机的注册表项。
参数
hPrinter [in]
句柄到打印机或打印服务器该函数设置配置数据。使用OpenPrinter或添加打印机函数检索打印机处理。
pKeyName [in]
一个空指针结尾的字符串指定的主要包含值来设置。如果指定的键或子项不存在,函数创建它们。
来存储配置,可以在目录服务(DS),公布指定以下一个数据预定义的注册表项。
ValueMeaning
SPLDS_DRIVER_KEYPrinter驱动程序使用此键来存储驱动程序属性。
SPLDS_SPOOLER_KEYReserved。只有打印后台处理程序用于存储内部的后台处理程序的属性。
SPLDS_USER_KEYApplications使用此键来存储如打印机资产数字打印机属性。
值存储在SPLDS_USER_KEY关键是在公布的目录服务,只有有一个架构相应的属性。域管理员必须创建财产,如不存在。要发布一个用户定义的属性在使用SetPrinterDataEx添加或更改值,请SetPrinter与Level = 7,并与PRINTER_INFO_7 dwAction成员设置为DSPRINT_UPDATE。
您可以指定其他键来存储无DS配置数据。使用反斜杠(\\)作为分隔符指定的路径有一个或多个子项。
如果hPrinter是一个句柄到打印机和pKeyName是NULL或空字符串,SetPrinterDataEx返回ERROR_INVALID_PARAMETER。
如果hPrinter是一个句柄到打印服务器,pKeyName被忽略。
请注意,不要使用SPLDS_SPOOLER_KEY。为了改变后台打印程序打印机属性与Level = 2,使用SetPrinter。
pValueName [in]
一个指向 null 结尾的字符串指针标识数据集。
对于打印机,此字符串指定下pKeyName关键的值的名称。
对于打印服务器,这个字符串是在以下备注一节中列出的预定义字符串之一。
类型 [in]
阿代码,以显示的数据类型指向的pData参数。对于可能的类型代码清单,请参阅注册表值类型。
如果pKeyName指定预定义的目录服务的关键因素之一,必须是REG_SZ类型,均为REG_MULTI_SZ,REG_DWORD,或REG_BINARY。如果REG_BINARY使用,cbData必须等于1,目录服务视为一个布尔值的数据。
pData [in]
一个缓冲区,其中包含打印机配置数据的指针。
cbData [in]
大小,以字节数组的。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个错误值。
备注
要检索现有的打印机配置数据,调用GetPrinterDataEx功能。
如果hPrinter是一个句柄到打印服务器,pValueName可以指定以下预定义值之一。
ValueComments
SPLREG_ALLOW_USER_MANAGEFORMSWindows XP的带有Service Pack 2(SP2)和更高版本
的Windows Server 2003带有Service Pack 1(SP1)和更高版本
SPLREG_ARCHITECTURE
SPLREG_BEEP_ENABLED
SPLREG_DEFAULT_SPOOL_DIRECTORY
SPLREG_DNS_MACHINE_NAME
SPLREG_DS_PRESENTOn成功返回,pData包含0x0001如果机器上的DS域,否则为0的。
SPLREG_DS_PRESENT_FOR_USEROn成功返回,pData包含0x0001如果用户到一个DS域,否则为0记录。
SPLREG_EVENT_LOG
SPLREG_MAJOR_VERSION
SPLREG_MINOR_VERSION
SPLREG_NET_POPUP
SPLREG_NET_POPUP_TO_COMPUTEROn成功返回,pData包含1如果工作通知应发送到客户端计算机,或者0,如果工作通知应发送给用户。
SPLREG_OS_VERSIONWindows XP和更高
SPLREG_OS_VERSIONEX
SPLREG_PORT_THREAD_PRIORITY_DEFAULT
SPLREG_PORT_THREAD_PRIORITY
SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATORWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_GROUPSWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLEWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLEWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT Windows 7和更高版本
SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICYWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICYWindows 7及更高版本
SPLREG_REMOTE_FAXOn成功返回,pData包含0x0001如果传真服务支持远程客户端,否则为0。
SPLREG_RETRY_POPUPOn成功返回,pData包含1如果服务器设置为重试所有工作,或0弹出窗口,如果服务器不重试所有职位弹出窗口。
SPLREG_SCHEDULER_THREAD_PRIORITY
SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT
SPLREG_WEBSHAREMGMTWindows Server 2003和更高
SPLREG_W3SVCINSTALLED
对pValueName下面的值确定池印刷的行为发生错误时。
ValueComments
SPLREG_RESTART_JOB_ON_POOL_ERRORThe的pData值表示时间,以秒,当工作在另一个端口重新启动后就会出现错误。此设置用于SPLREG_RESTART_JOB_ON_POOL_ENABLED。
SPLREG_RESTART_JOB_ON_POOL_ENABLEDA在pData非零值表明SPLREG_RESTART_JOB_ON_POOL_ERROR启用。
在SPLREG_RESTART_JOB_ON_POOL_ERROR指定的时间是最短的时间。实际的时间可以更长,这取决于以下端口监视器设置,这是发现在HKLM \\系统\\ CurrentControlSet \\控制\\打印\\监视器\\ MonitorName \\端口。
端口监视器settingMeaning
StatusUpdateEnabledIf一个非零值,使端口监视器更新与端口的地位后台处理程序。
StatusUpdateIntervalSpecifies的时间间隔,以秒为单位,当端口监视器更新与端口的地位后台处理程序。
为确保后台处理程序重定向到下一个工作在池中可用的打印机(打印作业时,没有在规定的时间印),端口监视器必须支持SNMP和池中的网络端口必须配置为“启用SNMP的地位。“端口监视器,支持SNMP是标准TCP / IP端口监视器。
调用设置为“PrinterDriverData的pKeyName参数SetPrinterDataEx”等同于调用SetPrinterData功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesSetPrinterDataExW(Unicode)和SetPrinterDataExA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
GetPrinterDataEx
OpenPrinter
SetPrinter
PRINTER_INFO_7
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==SetPrinterDataEx Function
The SetPrinterDataEx function sets the configuration data for a printer or print server. The function stores the configuration data under the printer's registry key.
Syntax
DWORD SetPrinterDataEx(
__in HANDLE hPrinter,
__in LPCTSTR pKeyName,
__in LPCTSTR pValueName,
__in DWORD Type,
__in LPBYTE pData,
__in DWORD cbData
);
Parameters
hPrinter [in]
A handle to the printer or print server for which the function sets configuration data. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
pKeyName [in]
A pointer to a null-terminated string that specifies the key containing the value to set. If the specified key or subkeys do not exist, the function creates them.
To store configuration data that can be published in the directory service (DS), specify one of the following predefined registry keys.
ValueMeaning
SPLDS_DRIVER_KEYPrinter drivers use this key to store driver properties.
SPLDS_SPOOLER_KEYReserved. Used only by the print spooler to store internal spooler properties.
SPLDS_USER_KEYApplications use this key to store printer properties such as printer asset numbers.

Values stored under the SPLDS_USER_KEY key are published in the directory service only if there is a corresponding property in the schema. A domain administrator must create the property if it doesn't already exist. To publish a user-defined property after you use SetPrinterDataEx to add or change a value, call SetPrinter with Level = 7 and with the dwAction member of PRINTER_INFO_7 set to DSPRINT_UPDATE.
You can specify other keys to store non-DS configuration data. Use the backslash ( \\ ) character as a delimiter to specify a path that has one or more subkeys.
If hPrinter is a handle to a printer and pKeyName is NULL or an empty string, SetPrinterDataEx returns ERROR_INVALID_PARAMETER.
If hPrinter is a handle to a print server, pKeyName is ignored.
Note, do not use SPLDS_SPOOLER_KEY. In order to change the spooler printer properties, use SetPrinter with Level = 2.
pValueName [in]
A pointer to a null-terminated string that identifies the data to set.
For printers, this string specifies the name of a value under the pKeyName key.
For print servers, this string is one of the predefined strings listed in the following Remarks section.
Type [in]
A code indicating the type of data pointed to by the pData parameter. For a list of the possible type codes, see Registry Value Types .
If pKeyName specifies one of the predefined directory service keys, Type must be REG_SZ, REG_MULTI_SZ, REG_DWORD, or REG_BINARY. If REG_BINARY is used, cbData must be equal to 1, and the directory service treats the data as a Boolean value.
pData [in]
A pointer to a buffer that contains the printer configuration data.
cbData [in]
The size, in bytes, of the array.
Return Value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is an error value.
Remarks
To retrieve existing configuration data for a printer, call the GetPrinterDataEx function.
If hPrinter is a handle to a print server, pValueName can specify one of the following predefined values.
ValueComments
SPLREG_ALLOW_USER_MANAGEFORMSWindows XP with Service Pack 2 (SP2) and later
Windows Server 2003 with Service Pack 1 (SP1) and later
SPLREG_ARCHITECTURE
SPLREG_BEEP_ENABLED
SPLREG_DEFAULT_SPOOL_DIRECTORY
SPLREG_DNS_MACHINE_NAME
SPLREG_DS_PRESENTOn successful return, pData contains 0x0001 if the machine is on a DS domain, 0 otherwise.
SPLREG_DS_PRESENT_FOR_USEROn successful return, pData contains 0x0001 if the user is logged onto a DS domain, 0 otherwise.
SPLREG_EVENT_LOG
SPLREG_MAJOR_VERSION
SPLREG_MINOR_VERSION
SPLREG_NET_POPUP
SPLREG_NET_POPUP_TO_COMPUTEROn successful return, pData contains 1 if job notifications should be sent to the client computer, or 0 if job notifications are to be sent to the user.
SPLREG_OS_VERSIONWindows XP and later
SPLREG_OS_VERSIONEX
SPLREG_PORT_THREAD_PRIORITY_DEFAULT
SPLREG_PORT_THREAD_PRIORITY
SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATORWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_GROUPSWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLEWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLEWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT Windows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICYWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICYWindows 7 and later
SPLREG_REMOTE_FAXOn successful return, pData contains 0x0001 if the FAX service supports remote clients, 0 otherwise.
SPLREG_RETRY_POPUPOn successful return, pData contains 1 if server is set to retry PopUps for all jobs, or 0 if server does not retry PopUps for all jobs.
SPLREG_SCHEDULER_THREAD_PRIORITY
SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT
SPLREG_WEBSHAREMGMTWindows Server 2003 and later
SPLREG_W3SVCINSTALLED

The following values of pValueName determine the pool printing behavior when an error occurs.
ValueComments
SPLREG_RESTART_JOB_ON_POOL_ERRORThe value of pData indicates the time, in seconds, when a job is restarted on another port after an error occurs. This setting is used with SPLREG_RESTART_JOB_ON_POOL_ENABLED.
SPLREG_RESTART_JOB_ON_POOL_ENABLEDA nonzero value in pData indicates that SPLREG_RESTART_JOB_ON_POOL_ERROR is enabled.

The time specified in SPLREG_RESTART_JOB_ON_POOL_ERROR is a minimum time. The actual time can be longer, depending on the following port monitor settings, which are found under HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors\\MonitorName\\Ports.
Port monitor settingMeaning
StatusUpdateEnabledIf a nonzero value, enables the port monitor to update the spooler with the port status.
StatusUpdateIntervalSpecifies the interval, in seconds, when the port monitor updates the spooler with the port status.

To ensure that the spooler redirects jobs to the next available printer in the pool (when the print job is not printed within the set time), the port monitor must support SNMP and the network ports in the pool must be configured as "SNMP status enabled." The port monitor that supports SNMP is Standard TCP/IP port monitor.
Calling SetPrinterDataEx with the pKeyName parameter set to "PrinterDriverData" is equivalent to calling the SetPrinterData function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesSetPrinterDataExW (Unicode) and SetPrinterDataExA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
GetPrinterDataEx
OpenPrinter
SetPrinter
PRINTER_INFO_7
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd145084(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:24:54