Printing

RegisterForPrintAsyncNotifications

I am using the AsyncUI sample code provided with t…

Sangeeta - Apr 4, 2008

I am using the AsyncUI sample code provided with the printer samples. The
AsyncUIMessageBox displays correctly on the server when the printer is
installed as the local printer on Vista.
I cannot get the message box to appaer on the client PC though. The
RegisterForPrintAsyncNotifications function on the client PC never returns
when a remote printer name is passed to it. The
documentation(http://msdn2.microsoft.com/en-us/library/aa506182.aspx)
suggests that a local/remote printer or server name can be passed to this
function.

RegisterForPrintAsyncNotifications

I write this in hopes of saving you some time, if you’re looking at MSFT’s new RegisterForPrintAsyncNotifications API (new in Vista and Server 2008).

At first glance (and second, and third) glance, this API doesn’t seem to work. It promises to provide asynchronous notifications of state changes to the print objects in the spooler, but how the $#@^ does it work? Let’s look at it more closely. (It’s defined int he file prnasnot.h, if you’ve got your sdk handy.

Cups...er, I mean XPS

So, I’m reading through the documentation on Windows printing, trying to learn what this is all about. My team writes stuff that sits between the Windows Spooler (spoolsrv.exe) and the Kernel-model communications pieces.

Anyway, so I come to a great fork in the road: GDI and XPS. GDI (Graphical Device Interface) is the way that earlier windows programs (Win32) talk to the display and printing subsystem. Essentially, everything in GDI is a bitmap. This is “the old way of doing things”.