Click here to Skip to main content
13,054,615 members (64,729 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am writing a code where I am enumarating all jobs in printer spooler and getting JOB_INFO_4 ([^]);

if (::EnumJobs(hPrinter_, 0, 1, 2, pBuffer, bufferSize, &sizeNeeded, &numJobs) == 0)
					//DEVMODE opDevMode, ipDevMode = {0};
					//DWORD dwNeed = -1;
					DWORD err = GetLastError();
					SYSTEMTIME  st = {0};
					bufferSize = sizeNeeded;
					pBuffer = new BYTE[sizeNeeded];
					if(::EnumJobs(hPrinter_, 0, 1, 2, pBuffer, bufferSize, &sizeNeeded, &numJobs) != 0)
	JOB_INFO_4 *pJobInfo = reinterpret_cast<JOB_INFO_4*>(pBuffer);

Here " pJobInfo-> Status" is coming 1) zero for a offline printer;
2) 8210 for a printer with some error
3) 4096 for a prionter which is printing;

But according to MSDN, the value shoule be :
JOB_STATUS_BLOCKED_DEVQ The driver cannot print the job.
JOB_STATUS_DELETED Job has been deleted.
JOB_STATUS_DELETING Job is being deleted.
JOB_STATUS_ERROR An error is associated with the job.
JOB_STATUS_OFFLINE Printer is offline.
JOB_STATUS_PAPEROUT Printer is out of paper.
JOB_STATUS_PAUSED Job is paused.
JOB_STATUS_PRINTED Job has printed.
JOB_STATUS_PRINTING Job is printing.
JOB_STATUS_RESTART Job has been restarted.
JOB_STATUS_SPOOLING Job is spooling.
JOB_STATUS_USER_INTERVENTION Printer has an error that requires the user to do something.

Any idea why I am getting zero for offline printer?
Posted 30-Apr-13 7:00am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 30 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100