다음을 통해 공유


RefreshPrinterChangeNotification function

Warning  

Starting with Windows 10, the APIs which support third-party print providers are deprecated. Microsoft does not recommend any investment into third-party print providers. Additionally, on Windows 8 and newer products where the v4 print driver model is available, third-party print providers may not create or manage queues which use v4 print drivers.

 

A print provider's RefreshPrinterChangeNotification function returns change notification information to the caller.

Syntax

BOOL RefreshPrinterChangeNotification(
   HANDLE hPrinter,
   DWORD  Reserved,
   PVOID  pvReserved,
   PVOID  pPrinterNotifyInfo
);

Parameters

  • hPrinter
    Caller-supplied printer handle, identifying the printer for which event notification information is being requested. This handle must have been previously obtained from OpenPrinter (described in the Microsoft Windows SDK documentation).

  • Reserved
    Not used.

  • pvReserved
    Not used.

  • pPrinterNotifyInfo
    Caller-supplied address to receive a pointer to a provider-allocated PRINTER_NOTIFY_INFO structure (described in the Windows SDK documentation).

Return value

If the operation succeeds, the function returns TRUE. Otherwise the function returns FALSE. The caller can obtain an error code by calling GetLastError (described in the Windows SDK documentation).

Remarks

A print provider's RefreshPrinterChangeNotification function is called when an application calls FindNextPrinterChangeNotification (described in the Windows SDK documentation) with the PRINTER_NOTIFY_OPTIONS_REFRESH flag set. Applications are supposed to set this flag if a previous call to FindNextPrinterChangeNotification returns a PRINTER_NOTIFY_INFO structure with the PRINTER_NOTIFY_INFO_DISCARDED flag set. This flag means the spooler's copy of printer change information is no longer valid, so the print provider must return a new copy. (The print provider can mark the spooler's copy of printer change information as invalid by calling PartialReplyPrinterChangeNotification with a NULLpInfoDataSrc argument.)

The provider must call RouterAllocPrinterNotifyInfo to allocate a PRINTER_NOTIFY_INFO structure (described in the Windows SDK documentation). The provider must then call AppendPrinterNotifyInfoData to load the structure with requested information, as indicated by the contents of the PRINTER_NOTIFY_OPTIONS structure (described in the Windows SDK documentation) that was previously received by the print provider's FindFirstPrinterChangeNotification function. (The calling application is responsible for deallocating the PRINTER_NOTIFY_INFO structure.)

For additional information, see Supporting Printer Change Notifications.

Requirements

Target platform

Desktop

Header

Winsplp.h (include Winsplp.h)

Library

Spoolss.lib

See also

PartialReplyPrinterChangeNotification

RouterAllocPrinterNotifyInfo

AppendPrinterNotifyInfoData

FindFirstPrinterChangeNotification

 

 

Send comments about this topic to Microsoft