网站首页  词典首页

请输入您要查询的函数:

 

术语 setjob
释义 SetJob
语法:
BOOL SetJob(
__in HANDLE hPrinter,
__in DWORD JobId,
__in DWORD Level,
__in LPBYTE pJob,
__in DWORD Command
);
SetJob功能
该SetJob功能暂停,恢复,取消,或重新启动指定的打印机上打印作业。您还可以使用SetJob函数来设置,例如打印作业优先级和文件名打印作业参数。
您可以使用SetJob功能给予一个命令来打印作业,或设置打印作业参数,或做同样的呼吁双方。该命令参数的值不会影响该函数使用Level和pJob参数。此外,您可以使用JOB_INFO_3 SetJob联系在一起的打印作业集。更多信息见备注。
参数
hPrinter [in]
句柄的利息打印机对象。使用OpenPrinter,OpenPrinter2,或添加打印机函数检索打印机处理。
的JobID [in]
标识符指定的打印作业。您获得通过调用AddJob函数或StartDoc函数打印作业标识符。
如果级别参数设置为3,的JobID参数必须匹配JOB_INFO_3结构的JobID成员所指向的pJob
Level [in]
就业信息的结构类型指向的pJob参数。
所有版本的Windows:您可以设置为0,1或2级参数。当您设置级别为0,pJob应为NULL。使用这些值当您不设定任何打印作业的参数。
您还可以设置参数为3级。
启动与Windows Vista:您还可以设置参数为4级。
pJob [in]
一个架构,设置打印作业参数的指针。
所有版本的Windows:pJob可以指向JOB_INFO_1或JOB_INFO_2结构。
pJob也可以指向一个JOB_INFO_3结构。您必须具有由JOB_INFO_3结构的JobID和NextJobId成员中指定的工作JOB_ACCESS_ADMINISTER访问权限。
启动与Windows Vista:pJob也可以指向一个JOB_INFO_4结构。
如果该参数为0级,pJob应为NULL。
命令 [in]
打印作业操作执行。此参数可以是下列值之一。
ValueMeaning
JOB_CONTROL_CANCELDo不能使用。要删除打印作业,使用JOB_CONTROL_DELETE。
JOB_CONTROL_PAUSEPause打印作业。
JOB_CONTROL_RESTARTRestart打印作业。一个工作只能重新启动如果是打印。
JOB_CONTROL_RESUMEResume暂停的打印作业。
JOB_CONTROL_DELETEDelete打印作业。
由端口监视器JOB_CONTROL_SENT_TO_PRINTERUsed结束打印作业。
由语言JOB_CONTROL_LAST_PAGE_EJECTEDUsed监测结束打印作业。
JOB_CONTROL_RETAINWindows Vista和更高版本:保持队列中的工作后,打印。
JOB_CONTROL_RELEASEWindows Vista和更高版本:发布打印作业。
您可以使用相同的调用SetJob函数来设置打印作业参数,并给予一个命令,以打印作业。因此,命令不需要为0,如果您设置打印作业参数,尽管它可以。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。
备注
您可以使用SetJob函数来设置通过提供一个指向JOB_INFO_1,JOB_INFO_2,JOB_INFO_3,或JOB_INFO_4结构,它包含了各种必要的数据打印作业参数。
要删除或删除特定的打印机的所有打印作业,要求其命令设置为PRINTER_CONTROL_PURGE参数SetPrinter功能。
一个JOB_INFO_1,JOB_INFO_2,或JOB_INFO_4结构的下列成员被忽略的一对SetJob电话:的JobID,pPrinterName,pMachineName,pUserName,pDrivername,大小,提交,时间和页。
您必须有一个打印机PRINTER_ACCESS_ADMINISTER访问权限,以改变打印作业在打印队列中的位置。
如果您不希望设置打印作业的打印队列中的位置,您应该设置JOB_INFO_1,JOB_INFO_2,或JOB_INFO_4结构中的地位成员JOB_POSITION_UNSPECIFIED。
使用与JOB_INFO_3结构SetJob功能联系在一起的打印作业集(也称为连锁)。这是非常有用的情况下一个单一文件中要分别呈现几个部分组成。要打印作业的A,B,C和D的顺序,调用JOB_INFO_4 SetJob连接A到B,B到C和C到D
如果您链接打印作业,注意以下几点:
作业可以被添加到开始或链的末端。
链中的所有工作必须有相同的数据类型。
连锁必须完全挂钩开始前,后台,否则后台打印程序可能会打印和删除后台的工作,然后再联系他们。有两种方法,以防止过早印刷链:
暂停链中的第一份工作,直到链完全联系在一起的。在暂停的第一份工作的国家管辖链中的所有作业的状态。
保持完整的第一份工作,就是不调用的第一份工作EndDoc或ScheduleJob。但是,如果'打印时后台'启用(默认),这种方法阻止,而链建立的端口,这也阻碍了非印刷有关的职位。
应用程序必须处理的情况下,用户删除一个链中的供应链工作完成之前,打印。 GetLastError返回INVALID_PARAMETER时的JobID不存在。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesSetJobW(Unicode)和SetJobA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
AddJob
GetJob
OpenPrinter
SetPrinter
JOB_INFO_1
JOB_INFO_2
JOB_INFO_3
JOB_INFO_4
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==SetJob Function
The SetJob function pauses, resumes, cancels, or restarts a print job on a specified printer. You can also use the SetJob function to set print job parameters, such as the print job priority and the document name.
You can use the SetJob function to give a command to a print job, or to set print job parameters, or to do both in the same call. The value of the Command parameter does not affect how the function uses the Level and pJob parameters. Also, you can use SetJob with JOB_INFO_3 to link together a set of print jobs. See Remarks for more information.
Syntax
BOOL SetJob(
__in HANDLE hPrinter,
__in DWORD JobId,
__in DWORD Level,
__in LPBYTE pJob,
__in DWORD Command
);
Parameters
hPrinter [in]
A handle to the printer object of interest. Use the OpenPrinter , OpenPrinter2 , or AddPrinter function to retrieve a printer handle.
JobId [in]
Identifier that specifies the print job. You obtain a print job identifier by calling the AddJob function or the StartDoc function.
If the Level parameter is set to 3, the JobId parameter must match the JobId member of the JOB_INFO_3 structure pointed to by pJob
Level [in]
The type of job information structure pointed to by the pJob parameter.
All versions of Windows: You can set the Level parameter to 0, 1, or 2. When you set Level to 0, pJob should be NULL. Use these values when you are not setting any print job parameters.
You can also set the Level parameter to 3.
Starting with Windows Vista: You can also set the Level parameter to 4.
pJob [in]
A pointer to a structure that sets the print job parameters.
All versions of Windows: pJob can point to a JOB_INFO_1 or JOB_INFO_2 structure.
pJob can also point to a JOB_INFO_3 structure. You must have JOB_ACCESS_ADMINISTER access permission for the jobs specified by the JobId and NextJobId members of the JOB_INFO_3 structure.
Starting with Windows Vista: pJob can also point to a JOB_INFO_4 structure.
If the Level parameter is 0, pJob should be NULL.
Command [in]
The print job operation to perform. This parameter can be one of the following values.
ValueMeaning
JOB_CONTROL_CANCELDo not use. To delete a print job, use JOB_CONTROL_DELETE.
JOB_CONTROL_PAUSEPause the print job.
JOB_CONTROL_RESTARTRestart the print job. A job can only be restarted if it was printing.
JOB_CONTROL_RESUMEResume a paused print job.
JOB_CONTROL_DELETEDelete the print job.
JOB_CONTROL_SENT_TO_PRINTERUsed by port monitors to end the print job.
JOB_CONTROL_LAST_PAGE_EJECTEDUsed by language monitors to end the print job.
JOB_CONTROL_RETAINWindows Vista and later: Keep the job in the queue after it prints.
JOB_CONTROL_RELEASEWindows Vista and later: Release the print job.

You can use the same call to the SetJob function to set print job parameters and to give a command to a print job. Thus, Command does not need to be 0 if you are setting print job parameters, although it can be.
Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero.
Remarks
You can use the SetJob function to set various print job parameters by supplying a pointer to a JOB_INFO_1, JOB_INFO_2, JOB_INFO_3, or JOB_INFO_4 structure that contains the necessary data.
To remove or delete all of the print jobs for a particular printer, call the SetPrinter function with its Command parameter set to PRINTER_CONTROL_PURGE.
The following members of a JOB_INFO_1, JOB_INFO_2, or JOB_INFO_4 structure are ignored on a call to SetJob: JobId, pPrinterName, pMachineName, pUserName, pDrivername, Size, Submitted, Time, and TotalPages.
You must have PRINTER_ACCESS_ADMINISTER access permission for a printer in order to change a print job's position in the print queue.
If you do not want to set a print job's position in the print queue, you should set the Position member of the JOB_INFO_1, JOB_INFO_2, or JOB_INFO_4 structure to JOB_POSITION_UNSPECIFIED.
Use the SetJob function with the JOB_INFO_3 structure to link together a set of print jobs (also known as a chain). This is useful in situations where a single document consists of several parts that you want to render separately. To print jobs A, B, C, and D in order, call SetJob with JOB_INFO_4 to link A to B, B to C, and C to D.
If you link print jobs, note the following:
Jobs can be added to the beginning or end of a chain.
All jobs in the chain must have the same data type.
The chain must be completely linked before spooling begins, otherwise the spooler may print and delete spooled jobs before you link them all. There are two ways to keep the chain from printing prematurely:
Pause the first job in the chain until the chain is completely linked. The paused state of the first job governs the state of all jobs in the chain.
Keep the first job incomplete, that is, do not call EndDoc or ScheduleJob for the first job. However, if 'print while spooling' is enabled (the default), this method blocks the port while the chain is built, which also prevents the printing of non-related jobs.
The application must handle the case where the user deletes a job in the chain before the chain finishes printing. GetLastError returns INVALID_PARAMETER when a JobID does not exist.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesSetJobW (Unicode) and SetJobA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
AddJob
GetJob
OpenPrinter
SetPrinter
JOB_INFO_1
JOB_INFO_2
JOB_INFO_3
JOB_INFO_4
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162978(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:21:04