Are already enqueued print-jobs affected by SetPrinter(..) function?

คำตอบ Are already enqueued print-jobs affected by SetPrinter(..) function?

ตอบทั้งหมด

  • 15 มีนาคม 2555 2:00
    ผู้ดูแล
     
     คำตอบ

    Hi Dan,
     
    According to the document you posted about SetPrinter function, we know that this function sets the data for a specified printer or sets the state of the specified printer by pausing printing, resuming printing, or clearing all print jobs.

    Pausing and clearing actions affect all the print jobs except the current one. I think all the print jobs which have not started will be involved. That is, the whole print jobs which wait for printing will be involved. If the old jobs are still waiting for printing, the changes will apply to them, too.
     
    I hope this reply is helpful to you. If you have any questions, please feel free to let us know.
    Best regards,


    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us

    • ทำเครื่องหมายเป็นคำตอบโดย Helen ZhaoModerator 23 มีนาคม 2555 5:41
    •  
  • 16 มีนาคม 2555 21:33
     
     

    Thank you for reply, Helen.

    Do Windows applications use some other API for printing?

    'Cos it looks reasonable that if printer settings are modified by some application for its printing job they mustn't affect existing print-jobs of other applications. Either this is incorrect or some other API is used.

    From the document I posted it is not clear whether "this function" sets both DATA and STATE of the specified printer by "pausing printing, resuming printing, or clearing all print jobs" or just sets the STATE of the specified printer by "pausing printing and ...".

    Moreover the SetPrinter function has special argument telling to pause printing, resume printing or clear the jobs.

  • 19 มีนาคม 2555 5:19
    ผู้ดูแล
     
     คำตอบ

    Hi Dan,
     
    According to the MSDN document of SetPrinter, we know that the third parameter (pPrinter) is a pointer to a buffer containing data to set for the printer, or containing information for the command specified by the Command parameter. The type of data in the buffer is determined by the value of Level. If the last parameter is PRINTER_CONTROL_SET_STATUS, it must contain a DWORD value that specifies the new printer status to set.
     
    That is, if level is 0 and the last parameter is PRINTER_CONTROL_SET_STATUS, pPrinter contain a DWORD value that specifies the new printer status to set.
    While, if level is one of 2 to 9, it should be PRINT_INFO_2 (to 9) structure containing information about printer. Whether to set DATA or STATUS of the specified printer is determined by the parameters of SetPrinter function. 
     
    The first parameter of SetPrinter is a handle to the printer. If two applications do not use the handle, changes done on the one with not affect the other.
     
    This link have listed functions which add and configure the printers that the print spooler user. Please refer to it for information about Windows APIs for printing: http://msdn.microsoft.com/en-us/library/dd162861(v=vs.85).aspx#printer_functions.
     
    Best regards,
    Helen Zhao


    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us

    • ทำเครื่องหมายเป็นคำตอบโดย Helen ZhaoModerator 23 มีนาคม 2555 5:41
    •