8 replies
by sl-campbell
Goto:
http://www.vbcity.com/page.asp?p=source
In the middle of this site you will see a topic "Printer Spool Moniter". Download this source code.
If you have problems finding it, or whatever, POST a comment to your question and I will get back to you.
by dejisys
by 3wadman
Download: http://support.microsoft.com/default.aspx?scid=http://download.microsoft.com/download/platformsdk/sample48/1/W9XNT4/EN-US/PrintMon.exe
Read: http://support.microsoft.com/support/kb/articles/Q196/8/05.ASP
This is a C++ app but you can usethe same API calls in VB
by 3wadman
Sorry, that download like need some fix'en. Use this one:
http://download.microsoft.com/download/platformsdk/sample48/1/W9XNT4/EN-US/PrintMon.exe
by dejisys
Hi,Source code U can use.
Type SYSTEMTIME
Type JOB_INFO_1
Type FILETIME
Declare Function EnumJobs ...
Declare Function OpenPrinter ...
Declare Function lstrcpy ...
Declare Sub MoveMemory ...
Declare Function FileTimeToLocalFileTime ...
Declare Function FileTimeToSystemTime ...
Declare Function SystemTimeToFileTime ...
Sub Form_Load()
Dim Result1,Result2,nJobs,I
Dim TheJob() As JOB_INFO_1,ByteBuf() As Byte,ReturnedBytes,NumOfJobs,STime As String,PrntH
Dim UFT As FILETIME,LFT As FILETIME,LST As SYSTEMTIME
nJobs=9
LVPrinterJobs.ListItems.Clear
Result1=OpenPrinter(Printer.DeviceName,PrntH,ByVal vbNull)
If Result1>0 Then
Result2=EnumJobs(PrntH,0,nJobs,1,ByVal "",0,ReturnedBytes,NumOfJobs)
If ReturnedBytes=0 Then Exit Sub'NoJobs
ReDim TheJob(ReturnedBytes-1)
ReDim ByteBuf(ReturnedBytes-1)
Result2=EnumJobs(PrntH,0,nJobs,1,ByteBuf(0),ReturnedBytes,ReturnedBytes,NumOfJobs)
If Result2>0 Then
MoveMemory TheJob(0),ByteBuf(0),Len(TheJob(0))* NumOfJobs
For I=0 To NumOfJobs-1
Result1=SystemTimeToFileTime(TheJob(I).Submitted,UFT)
Result1=FileTimeToLocalFileTime(UFT,LFT)
Result1=FileTimeToSystemTime(LFT,LST)
STime=LST.wHour & ":" & LST.wMinute
With LVPrinterJobs
.ListItems.Add,,TheJob(I).JobId
.ListItems(.ListItems.Count).ListSubItems.Add 1,,LPSTRtoVBString(TheJob(I).pPrinterName)
'Cont. to add to LV.
End With
Next
End If
End If
End Sub
Function LPSTRtoVBString(ByVal LPSTR As String,Optional ByVal maxlen As Long =256) As String
Dim sBuff As String
If LPSTR <> "" Then
sBuff = String$(maxlen,0)
If 0<>lstrcpy(StrPtr(sBuff),LPSTR) Then
LPSTRtoVBString=Left$(sBuff,InStr(sBuff,vbNullChar)-1)
LPSTRtoVBString=StrConv(LPSTRtoVBString,vbUnicode)
End If
End If
End Function
Function GetStatus(JStatus As Long) As String
If JStatus=0 Then Exit Function
'Get status string
End Function
I Hope I helped.Coz size limit I cut the code.If u want source file contact me.
by dejisys
by dejisys
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending