网站首页  词典首页

请输入您要查询的函数:

 

术语 setprinterdata
释义 SetPrinterData
语法:
DWORD SetPrinterData(
__in HANDLE hPrinter,
__in LPTSTR pValueName,
__in DWORD Type,
__in LPBYTE pData,
__in DWORD cbData
);
SetPrinterData功能
该SetPrinterData函数设置打印机或打印服务器的配置数据。
要指定的注册表项来存储数据,调用SetPrinterDataEx功能。调用SetPrinterData等效于调用设置为“PrinterDriverData的pKeyName参数SetPrinterDataEx功能”。
参数
hPrinter [in]
句柄到打印机或打印服务器该函数设置配置数据。使用OpenPrinter或添加打印机函数检索打印机处理。
pValueName [in]
一个指向 null 结尾的字符串指针标识数据集。
打印机,这个字符串是根据打印机的名称注册表值在注册表中的“PrinterDriverData”键。
对于打印服务器,这个字符串是在以下备注一节中列出的预定义字符串之一。
类型 [in]
阿代码,以显示的数据类型指向的pData参数。对于可能的类型代码清单,请参阅注册表值类型。
pData [in]
一个字节数组,包含打印机配置数据的指针。
cbData [in]
大小,以字节数组的。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个错误值。
备注
要检索现有的打印机配置数据,调用GetPrinterDataEx或GetPrinterData功能。
如果hPrinter是一个句柄到打印服务器,pValueName可以指定以下预定义值之一。
ValueComments
SPLREG_ALLOW_USER_MANAGEFORMSWindows XP的,SP2或更高版本
Windows Server 2003的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的地位启用。“
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesSetPrinterDataW(Unicode)和SetPrinterDataA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
GetPrinter
GetPrinterData
GetPrinterDataEx
OpenPrinter
SetPrinterDataEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==SetPrinterData Function
The SetPrinterData function sets the configuration data for a printer or print server.
To specify the registry key under which to store the data, call the SetPrinterDataEx function. Calling SetPrinterData is equivalent to calling the SetPrinterDataEx function with the pKeyName parameter set to "PrinterDriverData".
Syntax
DWORD SetPrinterData(
__in HANDLE hPrinter,
__in LPTSTR 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.
pValueName [in]
A pointer to a null-terminated string that identifies the data to set.
For printers, this string is the name of a registry value under the printer's "PrinterDriverData" key in the registry.
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 .
pData [in]
A pointer to an array of bytes 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 or GetPrinterData 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, SP2 or later
Windows Server 2003, SP1 or 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 or later
SPLREG_OS_VERSIONEX
SPLREG_PORT_THREAD_PRIORITY_DEFAULT
SPLREG_PORT_THREAD_PRIORITY
SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATORWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_GROUPSWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLEWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLEWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT Windows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICYWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICYWindows 7 or 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 or 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."
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesSetPrinterDataW (Unicode) and SetPrinterDataA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
GetPrinter
GetPrinterData
GetPrinterDataEx
OpenPrinter
SetPrinterDataEx
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd145083(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:17:27