|
-
Dec 31st, 2007, 07:35 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] print que
how can I display the "print que" ??
-
Dec 31st, 2007, 09:28 PM
#2
Re: 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".
-
Dec 31st, 2007, 10:42 PM
#3
Re: print que
There is also the QueryInformationJobObject for getting details that you may need to also display about print jobs in the "Q"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 1st, 2008, 06:16 AM
#4
Thread Starter
Fanatic Member
Re: print que
 Originally Posted by jmcilhinney
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".
I have seen "q" spelled 3-4 different ways.
-
Jan 1st, 2008, 06:30 AM
#5
Re: print que
Then you've seen it spelled wrongly 2-3 different ways. The word is "queue".
-
Jan 1st, 2008, 06:31 AM
#6
Re: print que
There is an API call "EnumJobs" that lists the jobs in a given print queue:
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
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...
-
Jan 1st, 2008, 06:33 AM
#7
Thread Starter
Fanatic Member
Re: print que
 Originally Posted by Merrion
There is an API call "EnumJobs" that lists the jobs in a given print queue:
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
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...
ok and thanks!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|