SetJob函数的用法

yuezifeng 2001-12-17 07:33:27
谁给我讲讲
Declare Function SetJob Lib "winspool.drv" Alias "SetJobA" (ByVal hPrinter As Long, ByVal JobId As Long, ByVal Level As Long, pJob As Byte, ByVal Command As Long) As Long

中的第三个参数和第四个参数怎么设置???
...全文
311 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuezifeng 2001-12-18
  • 打赏
  • 举报
回复
我想知道 VB中调用API时,遇到结构时,是不是都用Byval 0&来做参数?
要不 GetJob hPrinter, m_Jb.JobId, 1, ByVal 0&, 0, cbReq
为什么第三个参数为1时,第四个参数为ByVal 0&???
在VC中不是应该为JOB_INFO_1的吗?????????
lihonggen0 2001-12-18
  • 打赏
  • 举报
回复
SetJob

VB声明
Declare Function SetJob Lib "winspool.drv" Alias "SetJobA" (ByVal hPrinter As Long, ByVal JobId As Long, ByVal Level As Long, pJob As Byte, ByVal Command As Long) As Long
说明
对一个打印作业的状态进行控制
返回值
Long,非零表示成功,零表示失败。会设置GetLastError
参数表
参数 类型及说明
hPrinter Long,指定一个打开打印机的句柄(用OpenPrinter取得)
JobId Long,要修改的作业的编号
Level Long,0,1或2
pJob Byte,指定一个缓冲区。如级别(Level)设为1或2,那该缓冲区就包含了一个JOB_INFO_1或JOB_INFO_2结构。如级别为0,缓冲区为NULL(变成ByVal As Long,以便传递零值)。如指定了一个结构,则来自那个结构的信息会用于改变打印作业的设置(除JobId,pPrinterName,pMachineName,pDriverName,Size,Submitte以及Time字段外)
Command Long,下述常数之一:
JOB_CONTROL_CANCEL 取消作业
JOB_CONTROL_PAUSE 暂停作业
JOB_CONTROL_RESTART 重新启动一个已开始打印的作业
JOB_CONTROL_RESUME 恢复一个暂停的作业

Top

sonicdater 2001-12-17
  • 打赏
  • 举报
回复
你想知道 什么 ? 我给你翻译 :)
yuezifeng 2001-12-17
  • 打赏
  • 举报
回复
有没有搞错 弄了这个给我
sonicdater 2001-12-17
  • 打赏
  • 举报
回复
From MSDN

=============================================
pJob
[in] Pointer to a JOB_INFO_1 or JOB_INFO_2 structure. The function uses this structure to set print job parameters.
Windows NT/2000/XP: pJob can also point to a JOB_INFO_3 structure.

If the Level parameter is 0, pJob should be NULL.

If the Level parameter is 1, pJob should point to a JOB_INFO_1 structure. If the Level parameter is 2, pJob should point to a JOB_INFO_2 structure.

Windows NT/2000/XP: If the Level parameter is 3, pJob should 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.

Windows 95/98/Me: The function pays attention to this parameter only if the Command parameter is 0. If Command is nonzero, the function ignores this parameter and the Level parameter.

Command
[in] Specifies the print job operation to perform. This parameter can be one of the following values. Value Meaning
JOB_CONTROL_CANCEL Windows 95/98/Me, Windows NT 3.51 and earlier: Delete the print job.
Windows NT 4.0 and later: Do not use. To delete a print job, use JOB_CONTROL_DELETE.

JOB_CONTROL_PAUSE Pause the print job.
JOB_CONTROL_RESTART Restart the print job. A job can only be restarted if it was printing.
JOB_CONTROL_RESUME Resume a paused print job.
JOB_CONTROL_DELETE Windows NT 4.0 and later: Delete the print job.
JOB_CONTROL_SENT_TO_PRINTER Windows NT 4.0 and later: Used by port monitors to end the print job.
JOB_CONTROL_LAST_PAGE_EJECTED Windows NT 4.0 and later: Used by language monitors to end the print job.


Windows 95/98/Me: If you are using the SetJob function to set print job parameters, you must set the Command parameter to 0.

Windows NT/2000/XP: 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.

7,759

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧