2

Im currently writing a kinda print monitor app to run on a print server. The request is as follows:

When a user is printing on a specific application, the information about the application which initiated the print job is necessary. When monitoring the printer queue it gives me user information and lots of other stuff, but querying the information about the application which had initiated the printjob cannot be found.

Questions are:

Is there a C#/.NET way to find out which application (e.g. winword, excel, etc) has initiated a print job?

Is this information stored in the PrintQueue or the printspooler or anywhere else? How can this be done using the System.Printing Namespace or Win32Api ?

Any Ideas?

Ondrej Janacek
  • 12,486
  • 14
  • 59
  • 93
  • Welcome to Stack Overflow! Please, do not include information about a language used in a question title unless it wouldn't make sense without it. Tags serve this purpose. – Ondrej Janacek Mar 08 '14 at 14:57

1 Answers1

0

I am not sure but I think you could get the required info from PrintSystemJobInfo.

PrintJobInfoCollection collection = LocalPrintServer.GetDefaultPrintQueue().GetPrintJobInfoCollection();

Iterate the collection and get the PrintSystemJobInfo instances.

Junaith
  • 3,298
  • 24
  • 34