how can I display the "print que" ??
Printable View
how can I display the "print que" ??
I don't claim to know how but I'm fairly sure it would involve unmanaged code. There may be a Windows API function or two, or maybe you could use WMI.
Edit: Just had a quick look at the API Guide and there's an EnumJobs function in the Windows API. That would be worth a look.
By the way, it's "queue", not "que".
There is also the QueryInformationJobObject for getting details that you may need to also display about print jobs in the "Q" :D
I have seen "q" spelled 3-4 different ways.Quote:
Originally Posted by jmcilhinney
Then you've seen it spelled wrongly 2-3 different ways. The word is "queue".
There is an API call "EnumJobs" that lists the jobs in a given print queue:
The source code for the printer usage monitoring application uses this and the related API calls - I'd suggest you download that as a reference...Code:' JobInfoLevels - The level (JOB_LEVEL_n) structure to read from the spooler
Public Enum JobInfoLevels
' JobInfoLevel1 - Read a JOB_INFO_1 structure
JobInfoLevel1 = &H1
' JobInfoLevel2 - Read a JOB_INFO_2 structure
JobInfoLevel2 = &H2
' JobInfoLevel3 - Read a JOB_INFO_3 structure
JobInfoLevel3 = &H3
End Enum
<DllImport("winspool.drv", EntryPoint:="EnumJobs", _
SetLastError:=True, CharSet:=CharSet.Ansi, _
ExactSpelling:=False, _
CallingConvention:=CallingConvention.StdCall)> _
Public Function EnumJobs _
(<InAttribute()> ByVal hPrinter As IntPtr, _
<InAttribute()> ByVal FirstJob As Int32, _
<InAttribute()> ByVal NumberOfJobs As Int32, _
<InAttribute(), MarshalAs(UnmanagedType.U4)> ByVal Level As JobInfoLevels, _
<OutAttribute()> ByVal pbOut As IntPtr, _
<InAttribute()> ByVal cbIn As Int32, _
<OutAttribute()> ByRef pcbNeeded As Int32, _
<OutAttribute()> ByRef pcReturned As Int32 _
) As Boolean
End Function
Quote:
Originally Posted by Merrion
ok and thanks!!!