none
How can I get which process invoke a printer job RRS feed

  • Question

  • Hi All,
    I can intercept the printer job by using "winspool.drv", however when the event coming, how to get the process information that it from which process? suce as Nodepad or Word?
    Thanks!

    Monday, January 11, 2010 8:35 AM

Answers

  • HI eryang,

    Thanks for your reply, I want to know the owner of the process is that we have a thrid part application which we can not change the source code.  This application uses the printer internal, not using the print dialog, thus we want to customize the print propertis by pops up the print dialog. This should only for this application, ignore other process. Currently, I can interrupt print process, but it will interrupt all process, like the Nodepad also be interrupt, that not I want.
    • Marked as answer by fhta0 Wednesday, January 13, 2010 7:00 AM
    Tuesday, January 12, 2010 11:05 AM

All replies

  • Hi,

    As far as I know, according to a printer job, we cannot find the corresponding owner process from which the job was launched.

    Do you mind provide more information about why we need to know the owner process of a printer job? If you want to distinguish whether a printer job is initiated by Word Documents, you can use Document.BeforePrint event.


    Sincerely,
    Eric

    Please remember to mark helpful replies as answers.
    Tuesday, January 12, 2010 4:16 AM
  • HI eryang,

    Thanks for your reply, I want to know the owner of the process is that we have a thrid part application which we can not change the source code.  This application uses the printer internal, not using the print dialog, thus we want to customize the print propertis by pops up the print dialog. This should only for this application, ignore other process. Currently, I can interrupt print process, but it will interrupt all process, like the Nodepad also be interrupt, that not I want.
    • Marked as answer by fhta0 Wednesday, January 13, 2010 7:00 AM
    Tuesday, January 12, 2010 11:05 AM
  • Hi,
    I understand your scenario, and there maybe two methods:
        1. Find out the owner process which initiated current printer job according to job information.
        2. Do more work on the third party dll, check whether it has any event handler that can let the caller know it is going to launch a printer job.
    I'm not sure how to achieve the first one, so I hope you can find something useful from the third party dll itself.
    Please feel free to let us know if you have any other concerns.
    Sincerely,
    Eric

    Please remember to mark helpful replies as answers.
    Wednesday, January 13, 2010 3:31 AM
  • I also vote for the first one, however I did not find something for the dll, we do not have the source code. So I will take some time on the winspool.drv driver, try to find something. thanks for your reply.

     

     

    Wednesday, January 13, 2010 7:12 AM
  • Is there any progress on this?

    I am trying to detect process id who originated job id. It seems like I can query different info about job using GetJob(...) function, but there is not process id there ... It will be really greate if there will be a function like PrinterJobIdIntoProcessId(...) or something like that.

     

    Friday, December 10, 2010 4:23 PM