Click here to Skip to main content
14,218,975 members
Rate this:
Please Sign up or sign in to vote.
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100