Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have created a monitoring for the Windows Spooler for the printjobs in C# and C++, and I'm looking for a way to retrieve the program name who has sent the job to the printer Spooler. The printjob has the printProcessor (I get the JOB_INFO_2, this information is in WMI Win32_PrintJob PrintProcessor), but not the program such as Winword, Excel, Notepad, Explorer, whatever...

The jobname is not a trusted way, so:
Is there any way I could get the program that the user use to print a document programmatically?

I'm using Windows 10, .NET Framework 4.5, C#, C++, but any suggestion in other language would be appreciated.

Best regards.

What I have tried:

I achieved to get the JOB_INFO_2 structure, but the program that the user use to print a document is not there.
Posted
Comments
Richard MacCutchan 10-Mar-17 9:03am    
If the source application name is not saved in the job queue then there is no way to find it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900