BOOL (WINAPI *pfnEndDocPort)(
HANDLE hPort | |
); |
EndDocPort performs end-of-print-job tasks on the specified port.
Parameters
hPort
Handle to the port through which the document was printed.
Return Value
The return value is TRUE if the function is successful.
Comments
The spooler calls EndDocPort after it has finished sending the print job to the printer by way of WritePort.
Monitors should call the Win32 SetJob function to inform the spooler that a print job is completed. A port monitor's EndDocPort routine should call SetJob with the dwCommand parameter set to JOB_CONTROL_SENT_TO_PRINTER. When a print job goes through a language monitor, the spooler ignores any JOB_CONTROL_SENT_TO_PRINTER notifications that it receives from the port monitor. Consequently, a monitor that can determine true end-of-job status should delay calling SetJob until the printer notifies it that the print job has been completely printed. A language monitor's EndDocPort routine can setup to listen for end-of-job notification from the printer. This monitor should pass JOB_CONTROL_LAST_PAGE_EJECTED when it does receive notification from a bidirectional printer that printing has been completed.
Monitors might wish to modify their behavior when a user deletes or restarts a print job. To determine whether this has occurred, monitors can call the Win32 GetJob function and check the job status for the JOB_STATUS_DELETING or JOB_STATUS_RESTART flags.
EndDocPort should also free any per-print-job resources that were allocated by StartDocPort.
Both port and language monitors must implement EndDocPort.
See Also