Windows Dev Center

PRINTER_NOTIFY_INFO_DATA structure

The PRINTER_NOTIFY_INFO_DATA structure identifies a job or printer information field and provides the current data for that field.

The FindNextPrinterChangeNotification function returns a PRINTER_NOTIFY_INFO structure, which contains an array of PRINTER_NOTIFY_INFO_DATA structures.

Syntax


typedef struct _PRINTER_NOTIFY_INFO_DATA {
  WORD  Type;
  WORD  Field;
  DWORD Reserved;
  DWORD Id;
  union {
    DWORD  adwData[2];
    struct {
      DWORD  cbBuf;
      LPVOID pBuf;
    } Data;
  } NotifyData;
} PRINTER_NOTIFY_INFO_DATA, *PPRINTER_NOTIFY_INFO_DATA; ;

Members

Type

Indicates the type of information provided. This member can be one of the following values.

ValueMeaning
JOB_NOTIFY_TYPE
0x01

Indicates that the Field member specifies a JOB_NOTIFY_FIELD_* constant.

PRINTER_NOTIFY_TYPE
0x00

Indicates that the Field member specifies a PRINTER_NOTIFY_FIELD_* constant.

 

Field

Indicates the field that changed. For a list of possible values, see the Remarks section.

Reserved

Reserved.

Id

Indicates the job identifier if the Type member specifies JOB_NOTIFY_TYPE. If the Type member specifies PRINTER_NOTIFY_TYPE, this member is undefined.

NotifyData

A union of data information based on the Type and Field members. For a description of the type of data associated with each field, see the Remarks section.

adwData[2]

An array of two DWORD values. For information fields that use only a single DWORD, the data is in adwData [0].

Data
cbBuf

Indicates the size, in bytes, of the buffer pointed to by pBuf.

pBuf

Pointer to a buffer that contains the field's current data.

Remarks

If the Type member specifies PRINTER_NOTIFY_TYPE, the Field member can be one of the following values.

FieldType of dataValue
PRINTER_NOTIFY_FIELD_SERVER_NAMENot supported.0x00
PRINTER_NOTIFY_FIELD_PRINTER_NAMEpBuf is a pointer to a null-terminated string containing the name of the printer.0x01
PRINTER_NOTIFY_FIELD_SHARE_NAMEpBuf is a pointer to a null-terminated string that identifies the share point for the printer.0x02
PRINTER_NOTIFY_FIELD_PORT_NAMEpBuf is a pointer to a null-terminated string containing the name of the port that the print jobs will be printed to. If "Printer Pooling" is selected, this is a comma separated list of ports.0x03
PRINTER_NOTIFY_FIELD_DRIVER_NAMEpBuf is a pointer to a null-terminated string containing the name of the printer's driver.0x04
PRINTER_NOTIFY_FIELD_COMMENTpBuf is a pointer to a null-terminated string containing the new comment string, which is typically a brief description of the printer.0x05
PRINTER_NOTIFY_FIELD_LOCATIONpBuf is a pointer to a null-terminated string containing the new physical location of the printer (for example, "Bldg. 38, Room 1164").0x06
PRINTER_NOTIFY_FIELD_DEVMODEpBuf is a pointer to a DEVMODE structure that defines default printer data such as the paper orientation and the resolution.0x07
PRINTER_NOTIFY_FIELD_SEPFILEpBuf is a pointer to a null-terminated string that specifies the name of the file used to create the separator page. This page is used to separate print jobs sent to the printer.0x08
PRINTER_NOTIFY_FIELD_PRINT_PROCESSORpBuf is a pointer to a null-terminated string that specifies the name of the print processor used by the printer.0x09
PRINTER_NOTIFY_FIELD_PARAMETERSpBuf is a pointer to a null-terminated string that specifies the default print-processor parameters.0x0A
PRINTER_NOTIFY_FIELD_DATATYPEpBuf is a pointer to a null-terminated string that specifies the data type used to record the print job.0x0B
PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTORpBuf is a pointer to a SECURITY_DESCRIPTOR structure for the printer. The pointer may be NULL if there is no security descriptor.0x0C
PRINTER_NOTIFY_FIELD_ATTRIBUTESadwData [0] specifies the printer attributes, which can be one of the following values:
PRINTER_ATTRIBUTE_QUEUED
PRINTER_ATTRIBUTE_DIRECT
PRINTER_ATTRIBUTE_DEFAULT
PRINTER_ATTRIBUTE_SHARED
0x0D
PRINTER_NOTIFY_FIELD_PRIORITYadwData [0] specifies a priority value that the spooler uses to route print jobs.0x0E
PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITYadwData [0] specifies the default priority value assigned to each print job.0x0F
PRINTER_NOTIFY_FIELD_START_TIMEadwData [0] specifies the earliest time at which the printer will print a job. (This value is specified in minutes elapsed since 12:00 A.M.)0x10
PRINTER_NOTIFY_FIELD_UNTIL_TIMEadwData [0] specifies the latest time at which the printer will print a job. (This value is specified in minutes elapsed since 12:00 A.M.)0x11
PRINTER_NOTIFY_FIELD_STATUSadwData [0] specifies the printer status. For a list of possible values, see the PRINTER_INFO_2 structure.0x12
PRINTER_NOTIFY_FIELD_STATUS_STRINGNot supported.0x13
PRINTER_NOTIFY_FIELD_CJOBSadwData [0] specifies the number of print jobs that have been queued for the printer.0x14
PRINTER_NOTIFY_FIELD_AVERAGE_PPMadwData [0] specifies the average number of pages per minute that have been printed on the printer.0x15
PRINTER_NOTIFY_FIELD_TOTAL_PAGESNot supported.0x16
PRINTER_NOTIFY_FIELD_PAGES_PRINTEDNot supported.0x17
PRINTER_NOTIFY_FIELD_TOTAL_BYTESNot supported.0x18
PRINTER_NOTIFY_FIELD_BYTES_PRINTEDNot supported.0x19
PRINTER_NOTIFY_FIELD_OBJECT_GUIDThis is set if the object GUID changes.0x1A
PRINTER_NOTIFY_FIELD_FRIENDLY_NAMEThis is set if the printer connection is renamed.0x1B

 

If the Type member specifies JOB_NOTIFY_TYPE, the Field member can be one of the following values.

FieldType of dataValue
JOB_NOTIFY_FIELD_PRINTER_NAMEpBuf is a pointer to a null-terminated string containing the name of the printer for which the job is spooled.0x00
JOB_NOTIFY_FIELD_MACHINE_NAMEpBuf is a pointer to a null-terminated string that specifies the name of the machine that created the print job.0x01
JOB_NOTIFY_FIELD_PORT_NAMEpBuf is a pointer to a null-terminated string that identifies the port(s) used to transmit data to the printer. If a printer is connected to more than one port, the names of the ports are separated by commas (for example, "LPT1:,LPT2:,LPT3:").0x02
JOB_NOTIFY_FIELD_USER_NAMEpBuf is a pointer to a null-terminated string that specifies the name of the user who sent the print job.0x03
JOB_NOTIFY_FIELD_NOTIFY_NAMEpBuf is a pointer to a null-terminated string that specifies the name of the user who should be notified when the job has been printed or when an error occurs while printing the job.0x04
JOB_NOTIFY_FIELD_DATATYPEpBuf is a pointer to a null-terminated string that specifies the type of data used to record the print job.0x05
JOB_NOTIFY_FIELD_PRINT_PROCESSORpBuf is a pointer to a null-terminated string that specifies the name of the print processor to be used to print the job.0x06
JOB_NOTIFY_FIELD_PARAMETERSpBuf is a pointer to a null-terminated string that specifies print-processor parameters.0x07
JOB_NOTIFY_FIELD_DRIVER_NAMEpBuf is a pointer to a null-terminated string that specifies the name of the printer driver that should be used to process the print job.0x08
JOB_NOTIFY_FIELD_DEVMODEpBuf is a pointer to a DEVMODE structure that contains device-initialization and environment data for the printer driver.0x09
JOB_NOTIFY_FIELD_STATUSadwData [0] specifies the job status. For a list of possible values, see the JOB_INFO_2 structure.0x0A
JOB_NOTIFY_FIELD_STATUS_STRINGpBuf is a pointer to a null-terminated string that specifies the status of the print job.0x0B
JOB_NOTIFY_FIELD_SECURITY_DESCRIPTORNot supported.0x0C
JOB_NOTIFY_FIELD_DOCUMENTpBuf is a pointer to a null-terminated string that specifies the name of the print job (for example, "MS-WORD: Review.doc").0x0D
JOB_NOTIFY_FIELD_PRIORITYadwData [0] specifies the job priority.0x0E
JOB_NOTIFY_FIELD_POSITIONadwData [0] specifies the job's position in the print queue.0x0F
JOB_NOTIFY_FIELD_SUBMITTEDpBuf is a pointer to a SYSTEMTIME structure that specifies the time when the job was submitted.0x10
JOB_NOTIFY_FIELD_START_TIMEadwData [0] specifies the earliest time that the job can be printed. (This value is specified in minutes elapsed since 12:00 A.M.)0x11
JOB_NOTIFY_FIELD_UNTIL_TIMEadwData [0] specifies the latest time that the job can be printed. (This value is specified in minutes elapsed since 12:00 A.M.)0x12
JOB_NOTIFY_FIELD_TIMEadwData [0] specifies the total time, in seconds, that has elapsed since the job began printing.0x13
JOB_NOTIFY_FIELD_TOTAL_PAGESadwData [0] specifies the size, in pages, of the job.0x14
JOB_NOTIFY_FIELD_PAGES_PRINTEDadwData [0] specifies the number of pages that have printed.0x15
JOB_NOTIFY_FIELD_TOTAL_BYTESadwData [0] specifies the size, in bytes, of the job.0x16
JOB_NOTIFY_FIELD_BYTES_PRINTEDadwData [0] specifies the number of bytes that have been printed on this job. For this field, the change notification object is signaled when bytes are sent to the printer.0x17

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winspool.h (include Windows.h)

See also

Printing
Print Spooler API Structures
DEVMODE
FindNextPrinterChangeNotification
JOB_INFO_2
PRINTER_INFO_2
PRINTER_NOTIFY_INFO
SECURITY_DESCRIPTOR
SYSTEMTIME

 

 

Community Additions

ADD
Show:
© 2015 Microsoft