How to subscribe to Printer Spooler Events/ Win32_PrintJob Events using C# ?

Strawhat007 40 Reputation points
2023-02-03T04:18:38.8166667+00:00

Hi,

I am trying to find how to subscribe to Printer Spooler Events and Poll the same from the spooler.
Till now I have only found some C++ API and most of them are VB and PowerShell based solution in the documentation.

Win32_PrintJob : https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printjob

Can you please tell me if anything is available in C# ? How to subscribe to those events ?
and if you have some sample code regarding the same ?

Thanks,
Chitranshu

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
698 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,358 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,979 questions
Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
630 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 80,911 Reputation points
    2023-02-03T04:33:51.17+00:00

    The usual way is with FindNextPrinterChangeNotification

    You can find samples on Google, like Monitor jobs in a printer queue (.NET)

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful