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(
PRINTER_HANDLE hPrinter) → bool winspool - Deletes a printers spool file if the printer is configured for spooling.
-
AddForm(
PRINTER_HANDLE hPrinter, int level, Pointer< winspoolUint8> pForm) → bool - Adds a form to the list of available forms that can be selected for the specified printer.
-
AddJob(
PRINTER_HANDLE hPrinter, int level, Pointer< winspoolUint8> ? pData, int cbBuf, Pointer<Uint32> pcbNeeded) → bool - Adds a print job to the list of print jobs that can be scheduled by the print spooler.
-
AddPrinter(
PCWSTR? pName, int level, Pointer< winspoolUint8> pPrinter) → Win32Result<PRINTER_HANDLE> - Adds a printer to the list of supported printers for a specified server.
-
AddPrinterConnection(
PCWSTR pName) → bool winspool - Adds a connection to the specified printer for the current user.
-
AddPrinterConnection2(
HWND? hWnd, PCWSTR pszName, int dwLevel, Pointer< winspoolNativeType> pConnectionInfo) → bool - Adds a connection to the specified printer for the current user and specifies connection details.
-
AdvancedDocumentProperties(
HWND hWnd, PRINTER_HANDLE hPrinter, PCWSTR pDeviceName, Pointer< winspoolDEVMODE> ? pDevModeOutput, Pointer<DEVMODE> ? pDevModeInput) → int - Displays a printer-configuration dialog box for the specified printer, allowing the user to configure that printer.
-
ClosePrinter(
PRINTER_HANDLE hPrinter) → Win32Result< winspoolbool> - Closes the specified printer object.
-
CloseSpoolFileHandle(
PRINTER_HANDLE hPrinter, HANDLE hSpoolFile) → bool winspool - Closes a handle to a spool file associated with the print job currently submitted by the application.
-
CommitSpoolData(
PRINTER_HANDLE hPrinter, HANDLE hSpoolFile, int cbCommit) → HANDLE winspool - 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(
PCWSTR? pName, HWND hWnd, PCWSTR pPortName) → bool winspool - Displays the port-configuration dialog box for a port on the specified server.
-
ConnectToPrinterDlg(
HWND hwnd, int flags) → HANDLE winspool - Displays a dialog box that lets users browse and connect to printers on a network.
-
DeleteForm(
PRINTER_HANDLE hPrinter, PCWSTR pFormName) → bool winspool - Removes a form name from the list of supported forms.
-
DeletePrinter(
PRINTER_HANDLE hPrinter) → Win32Result< winspoolbool> - Deletes the specified printer object.
-
DeletePrinterConnection(
PCWSTR pName) → bool winspool - Deletes a connection to a printer that was established by a call to AddPrinterConnection or ConnectToPrinterDlg.
-
DeletePrinterData(
PRINTER_HANDLE hPrinter, PCWSTR pValueName) → int winspool - Deletes specified configuration data for a printer.
-
DeletePrinterDataEx(
PRINTER_HANDLE hPrinter, PCWSTR pKeyName, PCWSTR pValueName) → int winspool - Deletes a specified value from the configuration data for a printer.
-
DeletePrinterKey(
PRINTER_HANDLE hPrinter, PCWSTR pKeyName) → int winspool - Deletes a specified key and all its subkeys for a specified printer.
-
DocumentProperties(
HWND? hWnd, PRINTER_HANDLE hPrinter, PCWSTR pDeviceName, Pointer< winspoolDEVMODE> ? pDevModeOutput, Pointer<DEVMODE> ? pDevModeInput, int fMode) → int - Retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer.
-
EndDocPrinter(
PRINTER_HANDLE hPrinter) → bool winspool - Ends a print job for the specified printer.
-
EndPagePrinter(
PRINTER_HANDLE hPrinter) → bool winspool - Notifies the print spooler that the application is at the end of a page in a print job.
-
EnumForms(
PRINTER_HANDLE hPrinter, int level, Pointer< winspoolUint8> ? pForm, int cbBuf, Pointer<Uint32> pcbNeeded, Pointer<Uint32> pcReturned) → bool - Enumerates the forms supported by the specified printer.
-
EnumJobs(
PRINTER_HANDLE hPrinter, int firstJob, int noJobs, int level, Pointer< winspoolUint8> ? pJob, int cbBuf, Pointer<Uint32> pcbNeeded, Pointer<Uint32> pcReturned) → Win32Result<bool> - Retrieves information about a specified set of print jobs for a specified printer.
-
EnumPrinterData(
PRINTER_HANDLE hPrinter, int dwIndex, PWSTR pValueName, int cbValueName, Pointer< winspoolUint32> pcbValueName, Pointer<Uint32> ? pType, Pointer<Uint8> ? pData, int cbData, Pointer<Uint32> ? pcbData) → int - Enumerates configuration data for a specified printer.
-
EnumPrinterDataEx(
PRINTER_HANDLE hPrinter, PCWSTR pKeyName, Pointer< winspoolUint8> ? pEnumValues, int cbEnumValues, Pointer<Uint32> pcbEnumValues, Pointer<Uint32> pnEnumValues) → int - Enumerates all value names and data for a specified printer and key.
-
EnumPrinterKey(
PRINTER_HANDLE hPrinter, PCWSTR pKeyName, PWSTR? pSubkey, int cbSubkey, Pointer< winspoolUint32> pcbSubkey) → int - Enumerates the subkeys of a specified key for a specified printer.
-
EnumPrinters(
int flags, PCWSTR? name, int level, Pointer< winspoolUint8> ? pPrinterEnum, int cbBuf, Pointer<Uint32> pcbNeeded, Pointer<Uint32> pcReturned) → Win32Result<bool> - Enumerates available printers, print servers, domains, or print providers.
-
FindClosePrinterChangeNotification(
FINDPRINTERCHANGENOTIFICATION_HANDLE hChange) → bool winspool - Closes a change notification object created by calling the FindFirstPrinterChangeNotification function.
-
FindFirstPrinterChangeNotification(
PRINTER_HANDLE hPrinter, int fdwFilter, int fdwOptions, Pointer< winspoolNativeType> ? pPrinterNotifyOptions) → FINDPRINTERCHANGENOTIFICATION_HANDLE - Creates a change notification object and returns a handle to the object.
-
FindNextPrinterChangeNotification(
FINDPRINTERCHANGENOTIFICATION_HANDLE hChange, Pointer< winspoolUint32> ? pdwChange, Pointer<Pointer< ? ppPrinterNotifyInfo) → boolNativeType> > - Retrieves information about the most recent change notification for a change notification object associated with a printer or print server.
-
FlushPrinter(
PRINTER_HANDLE hPrinter, Pointer< winspoolNativeType> ? pBuf, int cbBuf, Pointer<Uint32> pcWritten, int cSleep) → bool - Sends a buffer to the printer in order to clear it from a transient state.
-
FreePrinterNotifyInfo(
Pointer< winspoolPRINTER_NOTIFY_INFO> pPrinterNotifyInfo) → bool - Frees a system-allocated buffer created by the FindNextPrinterChangeNotification function.
-
GetDefaultPrinter(
PWSTR? pszBuffer, Pointer< winspoolUint32> pcchBuffer) → bool - Retrieves the printer name of the default printer for the current user on the local computer.
-
GetForm(
PRINTER_HANDLE hPrinter, PCWSTR pFormName, int level, Pointer< winspoolUint8> ? pForm, int cbBuf, Pointer<Uint32> pcbNeeded) → bool - Retrieves information about a specified form.
-
GetJob(
PRINTER_HANDLE hPrinter, int jobId, int level, Pointer< winspoolUint8> ? pJob, int cbBuf, Pointer<Uint32> pcbNeeded) → bool - Retrieves information about a specified print job.
-
GetPrinter(
PRINTER_HANDLE hPrinter, int level, Pointer< winspoolUint8> ? pPrinter, int cbBuf, Pointer<Uint32> pcbNeeded) → Win32Result<bool> - Retrieves information about a specified printer.
-
GetPrinterData(
PRINTER_HANDLE hPrinter, PCWSTR pValueName, Pointer< winspoolUint32> ? pType, Pointer<Uint8> ? pData, int nSize, Pointer<Uint32> pcbNeeded) → int - Retrieves configuration data for the specified printer or print server.
-
GetPrinterDataEx(
PRINTER_HANDLE hPrinter, PCWSTR pKeyName, PCWSTR pValueName, Pointer< winspoolUint32> ? pType, Pointer<Uint8> ? pData, int nSize, Pointer<Uint32> pcbNeeded) → int - Retrieves configuration data for the specified printer or print server.
-
GetPrintExecutionData(
Pointer< winspoolPRINT_EXECUTION_DATA> pData) → bool - The GetPrintExecutionData retrieves the current print context.
-
GetSpoolFileHandle(
PRINTER_HANDLE hPrinter) → Win32Result< winspoolHANDLE> - Retrieves a handle for the spool file associated with the job currently submitted by the application.
-
IsValidDevmode(
Pointer< winspoolDEVMODE> ? pDevmode, int devmodeSize) → bool - Verifies that the contents of a DEVMODE structure are valid.
-
OpenPrinter(
PCWSTR? pPrinterName, Pointer< winspoolPointer< phPrinter, Pointer<NativeType> >PRINTER_DEFAULTS> ? pDefault) → Win32Result<bool> - Retrieves a handle to the specified printer or print server or other types of handles in the print subsystem.
-
OpenPrinter2(
PCWSTR? pPrinterName, Pointer< winspoolPointer< phPrinter, Pointer<NativeType> >PRINTER_DEFAULTS> ? pDefault, Pointer<PRINTER_OPTIONS> ? pOptions) → Win32Result<bool> - 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(
HWND hWnd, PRINTER_HANDLE hPrinter) → bool winspool - Displays a printer-properties property sheet for the specified printer.
-
ReadPrinter(
PRINTER_HANDLE hPrinter, Pointer< winspoolNativeType> pBuf, int cbBuf, Pointer<Uint32> pNoBytesRead) → bool - Retrieves data from the specified printer.
-
ReportJobProcessingProgress(
HANDLE printerHandle, int jobId, EPrintXPSJobOperation jobOperation, EPrintXPSJobProgress jobProgress) → void 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(
PRINTER_HANDLE hPrinter, Pointer< winspoolPRINTER_DEFAULTS> ? pDefault) → bool - Specifies the data type and device mode values to be used for printing documents submitted by the StartDocPrinter function.
-
ScheduleJob(
PRINTER_HANDLE hPrinter, int jobId) → bool winspool - Requests that the print spooler schedule a specified print job for printing.
-
SetDefaultPrinter(
PCWSTR? pszPrinter) → bool winspool - Sets the printer name of the default printer for the current user on the local computer.
-
SetForm(
PRINTER_HANDLE hPrinter, PCWSTR pFormName, int level, Pointer< winspoolUint8> pForm) → bool - Sets the form information for the specified printer.
-
SetJob(
PRINTER_HANDLE hPrinter, int jobId, int level, int command) → bool winspool - Pauses, resumes, cancels, or restarts a print job on a specified printer.
-
SetPort(
PCWSTR? pName, PCWSTR pPortName, int dwLevel, Pointer< winspoolUint8> pPortInfo) → Win32Result<bool> - Sets the status associated with a printer port.
-
SetPrinter(
PRINTER_HANDLE hPrinter, int level, Pointer< winspoolUint8> ? pPrinter, int command) → Win32Result<bool> - 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(
PRINTER_HANDLE hPrinter, PCWSTR pValueName, int type, Pointer< winspoolUint8> pData, int cbData) → int - Sets the configuration data for a printer or print server.
-
SetPrinterDataEx(
PRINTER_HANDLE hPrinter, PCWSTR pKeyName, PCWSTR pValueName, int type, Pointer< winspoolUint8> pData, int cbData) → int - Sets the configuration data for a printer or print server.
-
StartDocPrinter(
PRINTER_HANDLE hPrinter, int level, Pointer< winspoolDOC_INFO_1> pDocInfo) → int - Notifies the print spooler that a document is to be spooled for printing.
-
StartPagePrinter(
PRINTER_HANDLE hPrinter) → bool winspool - Notifies the spooler that a page is about to be printed on the specified printer.
-
WritePrinter(
PRINTER_HANDLE hPrinter, Pointer< winspoolNativeType> pBuf, int cbBuf, Pointer<Uint32> pcWritten) → bool - Notifies the print spooler that data should be written to the specified printer.