@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Pauses, resumes, cancels, or restarts a print job on a specified printer. !!!!C# Signature: [DllImport("winspool.drv", EntryPoint="SetJobA")] static extern int SetJobA(IntPtr hPrinter, int JobId, int Level, ref byte pJob, int Command_Renamed); !!!!VB Signature: Declare Function SetJob Lib "winspool.drv" Alias "SetJobA" (hPrinter As IntPtr, JobId As Integer, Level As Integer, ByRef pJob As Byte, Command_Renamed As Integer) !!!!User-Defined Types: Used by sample code: PRINTER_DEFAULTS Public Const JOB_CONTROL_PAUSE = &H1 Public Const JOB_CONTROL_RESUME = &H2 Public Const JOB_CONTROL_RESTART = &H4 Public Const JOB_CONTROL_CANCEL = &H3 Public Const JOB_CONTROL_DELETE = &H5 Public Const JOB_CONTROL_RETAIN = &H8 Public Const JOB_CONTROL_RELEASE = &H9 !!!!Notes: None. !!!!Tips & Tricks: How to cancel a print job: C# int pHandle = 0; PRINTER_DEFAULTS defaults = new PRINTER_DEFAULTS(); byte b = 0; OpenPrinterA(printerName, ref pHandle, ref defaults); SetJobA(pHandle, (int)jobID, 0, ref b, JOB_CONTROL_CANCEL); ClosePrinter(pHandle); !!!!Sample Code: vb.net dim Result as long = SetJob(handle, jobid, 0, Nothing, JOB_CONTROL_RESUME) !!!!Alternative Managed API: The System.Management API allows for lots of printer stuff, but doesn't let you delete a print job in Win2K. Documentation: SetJob@msdn on MSDN
Edit winspool.SetJob
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.