winspool Topic

Windows Print Spooler APIs

The Print Spooler API provides an interface to the print spooler for applications to manage printers and print jobs.

Functions

AbortPrinter(int hPrinter) int winspool
The AbortPrinter function deletes a printer's spool file if the printer is configured for spooling. [...]
ClosePrinter(int hPrinter) int winspool
The ClosePrinter function closes the specified printer object. [...]
CloseSpoolFileHandle(int hPrinter, int hSpoolFile) int winspool
The CloseSpoolFileHandle function closes a handle to a spool file associated with the print job currently submitted by the application. [...]
CommitSpoolData(int hPrinter, int hSpoolFile, int cbCommit) int winspool
The CommitSpoolData function notifies the print spooler that a specified amount of data has been written to a specified spool file and is ready to be rendered. [...]
ConfigurePort(Pointer<Utf16> pName, int hWnd, Pointer<Utf16> pPortName) int winspool
The ConfigurePort function displays the port-configuration dialog box for a port on the specified server. [...]
ConnectToPrinterDlg(int hwnd, int Flags) int winspool
The ConnectToPrinterDlg function displays a dialog box that lets users browse and connect to printers on a network. If the user selects a printer, the function attempts to create a connection to it; if a suitable driver is not installed on the server, the user is given the option of creating a printer locally. [...]
DeleteForm(int hPrinter, Pointer<Utf16> pFormName) int winspool
The DeleteForm function removes a form name from the list of supported forms. [...]
DeletePrinter(int hPrinter) int winspool
The DeletePrinter function deletes the specified printer object. [...]
DeletePrinterConnection(Pointer<Utf16> pName) int winspool
The DeletePrinterConnection function deletes a connection to a printer that was established by a call to AddPrinterConnection or ConnectToPrinterDlg. [...]
DeletePrinterData(int hPrinter, Pointer<Utf16> pValueName) int winspool
The DeletePrinterData function deletes specified configuration data for a printer. A printer's configuration data consists of a set of named and typed values. The DeletePrinterData function deletes one of these values, specified by its value name. [...]
DeletePrinterDataEx(int hPrinter, Pointer<Utf16> pKeyName, Pointer<Utf16> pValueName) int winspool
The DeletePrinterDataEx function deletes a specified value from the configuration data for a printer. A printer's configuration data consists of a set of named and typed values stored in a hierarchy of registry keys. The function deletes a specified value under a specified key. [...]
DeletePrinterKey(int hPrinter, Pointer<Utf16> pKeyName) int winspool
The DeletePrinterKey function deletes a specified key and all its subkeys for a specified printer. [...]
DocumentProperties(int hWnd, int hPrinter, Pointer<Utf16> pDeviceName, Pointer<DEVMODE> pDevModeOutput, Pointer<DEVMODE> pDevModeInput, int fMode) int winspool
The DocumentProperties function retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer. [...]
EndDocPrinter(int hPrinter) int winspool
The EndDocPrinter function ends a print job for the specified printer. [...]
EndPagePrinter(int hPrinter) int winspool
The EndPagePrinter function notifies the print spooler that the application is at the end of a page in a print job. [...]
EnumForms(int hPrinter, int Level, Pointer<Uint8> pForm, int cbBuf, Pointer<Uint32> pcbNeeded, Pointer<Uint32> pcReturned) int winspool
The EnumForms function enumerates the forms supported by the specified printer. [...]
EnumJobs(int hPrinter, int FirstJob, int NoJobs, int Level, Pointer<Uint8> pJob, int cbBuf, Pointer<Uint32> pcbNeeded, Pointer<Uint32> pcReturned) int winspool
The EnumJobs function retrieves information about a specified set of print jobs for a specified printer. [...]
EnumPrinterData(int hPrinter, int dwIndex, Pointer<Utf16> pValueName, int cbValueName, Pointer<Uint32> pcbValueName, Pointer<Uint32> pType, Pointer<Uint8> pData, int cbData, Pointer<Uint32> pcbData) int winspool
The EnumPrinterData function enumerates configuration data for a specified printer. [...]
EnumPrinterDataEx(int hPrinter, Pointer<Utf16> pKeyName, Pointer<Uint8> pEnumValues, int cbEnumValues, Pointer<Uint32> pcbEnumValues, Pointer<Uint32> pnEnumValues) int winspool
The EnumPrinterDataEx function enumerates all value names and data for a specified printer and key. [...]
EnumPrinterKey(int hPrinter, Pointer<Utf16> pKeyName, Pointer<Utf16> pSubkey, int cbSubkey, Pointer<Uint32> pcbSubkey) int winspool
The EnumPrinterKey function enumerates the subkeys of a specified key for a specified printer. [...]
EnumPrinters(int Flags, Pointer<Utf16> Name, int Level, Pointer<Uint8> pPrinterEnum, int cbBuf, Pointer<Uint32> pcbNeeded, Pointer<Uint32> pcReturned) int winspool
The EnumPrinters function enumerates available printers, print servers, domains, or print providers. [...]
FindClosePrinterChangeNotification(int hChange) int winspool
The FindClosePrinterChangeNotification function closes a change notification object created by calling the FindFirstPrinterChangeNotification function. The printer or print server associated with the change notification object will no longer be monitored by that object. [...]
FindFirstPrinterChangeNotification(int hPrinter, int fdwFilter, int fdwOptions, Pointer<NativeType> pPrinterNotifyOptions) int winspool
The FindFirstPrinterChangeNotification function creates a change notification object and returns a handle to the object. You can then use this handle in a call to one of the wait functions to monitor changes to the printer or print server. [...]
FindNextPrinterChangeNotification(int hChange, Pointer<Uint32> pdwChange, Pointer<NativeType> pvReserved, Pointer<Pointer<NativeType>> ppPrinterNotifyInfo) int winspool
The FindNextPrinterChangeNotification function retrieves information about the most recent change notification for a change notification object associated with a printer or print server. Call this function when a wait operation on the change notification object is satisfied. [...]
FlushPrinter(int hPrinter, Pointer<NativeType> pBuf, int cbBuf, Pointer<Uint32> pcWritten, int cSleep) int winspool
The FlushPrinter function sends a buffer to the printer in order to clear it from a transient state. [...]
FreePrinterNotifyInfo(Pointer<PRINTER_NOTIFY_INFO> pPrinterNotifyInfo) int winspool
The FreePrinterNotifyInfo function frees a system-allocated buffer created by the FindNextPrinterChangeNotification function. [...]
GetDefaultPrinter(Pointer<Utf16> pszBuffer, Pointer<Uint32> pcchBuffer) int winspool
The GetDefaultPrinter function retrieves the printer name of the default printer for the current user on the local computer. [...]
GetJob(int hPrinter, int JobId, int Level, Pointer<Uint8> pJob, int cbBuf, Pointer<Uint32> pcbNeeded) int winspool
The GetJob function retrieves information about a specified print job. [...]
GetPrinter(int hPrinter, int Level, Pointer<Uint8> pPrinter, int cbBuf, Pointer<Uint32> pcbNeeded) int winspool
The GetPrinter function retrieves information about a specified printer. [...]
GetPrinterData(int hPrinter, Pointer<Utf16> pValueName, Pointer<Uint32> pType, Pointer<Uint8> pData, int nSize, Pointer<Uint32> pcbNeeded) int winspool
The GetPrinterData function retrieves configuration data for the specified printer or print server. [...]
GetPrinterDataEx(int hPrinter, Pointer<Utf16> pKeyName, Pointer<Utf16> pValueName, Pointer<Uint32> pType, Pointer<Uint8> pData, int nSize, Pointer<Uint32> pcbNeeded) int winspool
The GetPrinterDataEx function retrieves configuration data for the specified printer or print server. GetPrinterDataEx can retrieve values that the SetPrinterData function stored. In addition, GetPrinterDataEx can retrieve values that the SetPrinterDataEx function stored under a specified key. [...]
GetPrintExecutionData(Pointer<PRINT_EXECUTION_DATA> pData) int winspool
The GetPrintExecutionData retrieves the current print context. [...]
IsValidDevmode(Pointer<DEVMODE> pDevmode, int DevmodeSize) int winspool
The IsValidDevmode function verifies that the contents of a DEVMODE structure are valid. [...]
OpenPrinter(Pointer<Utf16> pPrinterName, Pointer<IntPtr> phPrinter, Pointer<PRINTER_DEFAULTS> pDefault) int winspool
The OpenPrinter function retrieves a handle to the specified printer or print server or other types of handles in the print subsystem. [...]
OpenPrinter2(Pointer<Utf16> pPrinterName, Pointer<IntPtr> phPrinter, Pointer<PRINTER_DEFAULTS> pDefault, Pointer<PRINTER_OPTIONS> pOptions) int winspool
Retrieves a handle to the specified printer, print server, or other types of handles in the print subsystem, while setting some of the printer options. [...]
PrinterProperties(int hWnd, int hPrinter) int winspool
The PrinterProperties function displays a printer-properties property sheet for the specified printer. [...]
ReadPrinter(int hPrinter, Pointer<NativeType> pBuf, int cbBuf, Pointer<Uint32> pNoBytesRead) int winspool
The ReadPrinter function retrieves data from the specified printer. [...]
ReportJobProcessingProgress(int printerHandle, int jobId, int jobOperation, int jobProgress) int winspool
Reports to the Print Spooler service whether an XPS print job is in the spooling or the rendering phase and what part of the processing is currently underway. [...]
ResetPrinter(int hPrinter, Pointer<PRINTER_DEFAULTS> pDefault) int winspool
The ResetPrinter function specifies the data type and device mode values to be used for printing documents submitted by the StartDocPrinter function. These values can be overridden by using the SetJob function after document printing has started. [...]
ScheduleJob(int hPrinter, int JobId) int winspool
The ScheduleJob function requests that the print spooler schedule a specified print job for printing. [...]
SetDefaultPrinter(Pointer<Utf16> pszPrinter) int winspool
The SetDefaultPrinter function sets the printer name of the default printer for the current user on the local computer. [...]
SetForm(int hPrinter, Pointer<Utf16> pFormName, int Level, Pointer<Uint8> pForm) int winspool
The SetForm function sets the form information for the specified printer. [...]
SetJob(int hPrinter, int JobId, int Level, Pointer<Uint8> pJob, int Command) int winspool
The SetJob function pauses, resumes, cancels, or restarts a print job on a specified printer. You can also use the SetJob function to set print job parameters, such as the print job priority and the document name. [...]
SetPort(Pointer<Utf16> pName, Pointer<Utf16> pPortName, int dwLevel, Pointer<Uint8> pPortInfo) int winspool
The SetPort function sets the status associated with a printer port. [...]
SetPrinter(int hPrinter, int Level, Pointer<Uint8> pPrinter, int Command) int winspool
The SetPrinter function sets the data for a specified printer or sets the state of the specified printer by pausing printing, resuming printing, or clearing all print jobs. [...]
SetPrinterData(int hPrinter, Pointer<Utf16> pValueName, int Type, Pointer<Uint8> pData, int cbData) int winspool
The SetPrinterData function sets the configuration data for a printer or print server. [...]
SetPrinterDataEx(int hPrinter, Pointer<Utf16> pKeyName, Pointer<Utf16> pValueName, int Type, Pointer<Uint8> pData, int cbData) int winspool
The SetPrinterDataEx function sets the configuration data for a printer or print server. The function stores the configuration data under the printer's registry key. [...]
StartDocPrinter(int hPrinter, int Level, Pointer<DOC_INFO_1> pDocInfo) int winspool
The StartDocPrinter function notifies the print spooler that a document is to be spooled for printing. [...]
StartPagePrinter(int hPrinter) int winspool
The StartPagePrinter function notifies the spooler that a page is about to be printed on the specified printer. [...]
WritePrinter(int hPrinter, Pointer<NativeType> pBuf, int cbBuf, Pointer<Uint32> pcWritten) int winspool
The WritePrinter function notifies the print spooler that data should be written to the specified printer. [...]