Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
    
Are you programming? If so, add something to the queue, then retrieve the ID –  Dave Rook 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 Rook 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 Rook Oct 1 '12 at 9:04

2 Answers 2

up vote 0 down vote accepted

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).

Source

share|improve this answer

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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