[DllImport("winspool.drv", CharSet=CharSet.Auto, SetLastError=true)]
static extern int OpenPrinter(string pPrinterName, out IntPtr phPrinter, PRINTER_DEFAULTS pDefault);
It seems to me that the last parameter should be ref PRINTER_DEFAULTS pDefault.
As always, only do SetLastError=true if you actually intend to call GetLastError.
How to cancel a print job:
IntPtr pHandle;
PRINTER_DEFAULTS defaults = new PRINTER_DEFAULTS();
byte b = 0;
OpenPrinter(printerName, out pHandle, defaults);
SetJobA(pHandle, (int)jobID, 0, ref b, (int)Job_Control.Cancel);
ClosePrinter(pHandle);
The System.Management API allows for lots of printer stuff, but doesn't let you delete a print job in Win2K.