I've tried searching for this for a while now, but I can't find any MS documentation which details what the maximum and minimum valid print job IDs are for windows.

Does anyone know of documentation anywhere that might provide this information?

The reason why I'm asking is because I need to know if 0 is a valid print job ID. I'm assuming not, but I don't really have much to base that on!

  • Are you programming? If so, add something to the queue, then retrieve the ID – Dave Oct 1 '12 at 8:24
  • Well, reason I'm asking is because I have a situation where I'm getting an unexpected event in my printer driver, giving me a job ID of 0. I then get the true job ID in the next event. So I'm just wondering if I can rely on 0 being an invalid job ID and throw the event away based on job ( (ID == 0) => invalid event). I think I'd need more confidence than making an assumption on a few valid IDs returned from a few prints. :) – Andy Oct 1 '12 at 8:28
  • No you can't rely on it - the ID has nothing to do with the state. This may help: support.microsoft.com/kb/202480 ~(It's a how to Determine Printer Status and Print Job Status from Visual Basic) – Dave Oct 1 '12 at 8:34
  • But how can you get the status of a print job that doesn't exist? ;) I guess I could try and get the print job, and if it doesn't exist, I know it's an invalid Job ID. I guess I was just wondering if there's documentation that would mean I can rely on a Job ID of 0 indicating an invalid event. – Andy Oct 1 '12 at 8:53
  • But a Job ID of 0 doesn't meant it doesn't exist - it means it is live and happy (or unhappy)! – Dave Oct 1 '12 at 9:04

Answered in the comments by OP

It (see source below) says under Job ID that 0 indicates a print job that hasn't been assigned an ID as yet. So it does exists, but it hasn't been assigned an ID (An ID being 1 or over).



According to the documentation for the Win32_PrintJob class, the JobId property is a uint32, so its value may range from 0 to 4,294,967,295 (232-1). Additional restrictions may apply, though.

  • That's the representable range, not all of which are necessarily valid. As a comment states, you can get jobID = 0 for an invalid job. – MSalters Oct 1 '12 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.