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.
HRESULT RegisterForPrintAsyncNotifications(
LPCWSTR pName,
PrintAsyncNotificationType *pSchema,
PrintAsyncNotifyUserFilter filter,
PrintAsyncNotifyConversationStyle directionality,
IPrintAsyncNotifyCallback *pCallback,
HANDLE *pRegistrationHandler
);
pName is a pointer to the name of the print object you want to monitor. If you want alerts from all objects, you can pass NULL here (or so I've observed!)
pSchema is a pointer to a
schema that the client expects. This is…