PRINTER_STATUS

PRINTER_STATUS

Postby Otto » Sat May 15, 2010 12:54 pm

Is there a function to get the PRINTER_STATUS or JOB_INFO.

Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: PRINTER_STATUS

Postby ukoenig » Sat May 15, 2010 1:01 pm

Hello Otto,

have a look at FWH\samples\prnstat.prg

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: PRINTER_STATUS

Postby Otto » Sat May 15, 2010 1:49 pm

Hello Uwe,
thank you for your help. But I think to get the JOB_INFO I need to search inside the printer queue.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: PRINTER_STATUS

Postby ukoenig » Sat May 15, 2010 2:40 pm

Hello Otto,

have a look at FWH\samples\shtest.prg

Maybe it is, what You are looking for ? :

@ 90, 25 BUTTON "&Print Property" ACTION SHPrnProperty( oDlg:hWnd, cPrinter ) ;
SIZE 100, 15 PIXEL

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: PRINTER_STATUS

Postby Otto » Sat May 15, 2010 4:08 pm

Uwe,

This opens the standard dialog "Printer properties".
But how to access the properties values?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: PRINTER_STATUS

Postby ukoenig » Sat May 15, 2010 4:52 pm

A quick VBS-Script-Solution :

Returns the job ID, user name, and total pages for each print job on a computer.
Save the following Lines to a Filename like : Pjob.vbs
You can use Winexec from inside Your application
Winexec('WSCRIPT.exe Pjob.VBS')
or DoubleClick on the File.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPrintJobs = objWMIService.ExecQuery _
("Select * from Win32_PrintJob")
Wscript.Echo "Print Queue, Job ID, Owner, Total Pages"
For Each objPrintJob in colPrintJobs
strPrinter = Split(objPrintJob.Name,",",-1,1)
Wscript.Echo strPrinter(0) & ", " & _
objPrintJob.JobID & ", " & objPrintJob.Owner & ", " _
& objPrintJob.TotalPages
Next


Some more Informations for testing :

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_PrinterConfiguration")
For Each objPrinter in colInstalledPrinters
Wscript.Echo "Name: " & objPrinter.Name
Wscript.Echo "Collate: " & objPrinter.Collate
Wscript.Echo "Copies: " & objPrinter.Copies
Wscript.Echo "Driver Version: " & objPrinter.DriverVersion
Wscript.Echo "Duplex: " & objPrinter.Duplex
Wscript.Echo "Horizontal Resolution: " & _
objPrinter.HorizontalResolution
If objPrinter.Orientation = 1 Then
strOrientation = "Portrait"
Else
strOrientation = "Landscape"
End If
Wscript.Echo "Orientation : " & strOrientation
Wscript.Echo "Paper Length: " & objPrinter.PaperLength / 254
Wscript.Echo "Paper Width: " & objPrinter.PaperWidth / 254
Wscript.Echo "Print Quality: " & objPrinter.PrintQuality
Wscript.Echo "Scale: " & objPrinter.Scale
Wscript.Echo "Specification Version: " & _
objPrinter.SpecificationVersion
If objPrinter.TTOption = 1 Then
strTTOption = "Print TrueType fonts as graphics."
Elseif objPrinter.TTOption = 2 Then
strTTOption = "Download TrueType fonts as soft fonts."
Else
strTTOption = "Substitute device fonts for TrueType fonts."
End If
Wscript.Echo "True Type Option: " & strTTOption
Wscript.Echo "Vertical Resolution: " & objPrinter.VerticalResolution
Next


Best Regards
Uwe :lol:
Last edited by ukoenig on Sat May 15, 2010 5:52 pm, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: PRINTER_STATUS

Postby Otto » Sat May 15, 2010 5:49 pm

Uwe, thank you for your help.
Best regrads,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests