Hi Dan,
try this
Dieter
// Delete Job with Id nJobId
OSVERSIONINFO osInfo;
BOOL bResult;
HANDLE hPrinter = NULL;
if (!OpenPrinter (pPrinterName, &hPrinter, NULL))
{
...
}
ZeroMemory (&osInfo, sizeof (OSVERSIONINFO));
osInfo.dwOSVersionInfoSize = sizeof ( OSVERSIONINFO);
GetVersionEx (&osInfo);
if (osInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ||
osInfo.dwMajorVersion < 4)
{
// Windows 95/98/Me, Windows NT 3.51 and earlier
bResult = SetJob (hPrinter, nJobId, 0, NULL, JOB_CONTROL_CANCEL);
}
else
{
// Windows NT4.0 and later
bResult = SetJob (hPrinter, nJobId, 0, NULL, JOB_CONTROL_DELETE);
}
if (hPrinter)
{
ClosePrinter (hPrinter);
hPrinter = NULL;
}