Discussion:
is there an API to know the printer status?
(too old to reply)
neoLeoX
2005-09-15 18:11:52 UTC
Permalink
Hi group

is there an API to know the printer status?


this is because SYS(13) seems always return "READY" . Even if is "Spooling"
or "Printing" or Stuck!! (while Status is 'Printing")

thanks in advance

VFP 9
OS WinXP Pro
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
L.Ortega
El Paso Texas
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Mike Gagnon
2005-09-15 18:53:19 UTC
Permalink
If you are up to doing some translation here is how to do it in VB
http://support.microsoft.com/default.aspx?scid=kb;en-us;202480

or use WMI

strComputer = "."
objWMIService = Getobject("winmgmts:"+ "{impersonationLevel=impersonate}!\\"
+ strComputer + "\root\cimv2")
colInstalledPrinters = objWMIService.ExecQuery("SELECT * FROM
Win32_Printer")
For Each objPrinter In colInstalledPrinters
?"Name: " + objPrinter.Name
Do Case
Case objPrinter.PrinterStatus = 1
strPrinterStatus = "Other"
Case objPrinter.PrinterStatus = 2
strPrinterStatus = "Unknown"
Case objPrinter.PrinterStatus = 3
strPrinterStatus = "Idle"
Case objPrinter.PrinterStatus = 4
strPrinterStatus = "Printing"
Case objPrinter.PrinterStatus = 5
strPrinterStatus = "Warmup"
Endcase
? "Printer Status: " + strPrinterStatus
Next
Post by neoLeoX
Hi group
is there an API to know the printer status?
this is because SYS(13) seems always return "READY" . Even if is
"Spooling" or "Printing" or Stuck!! (while Status is 'Printing")
thanks in advance
VFP 9
OS WinXP Pro
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
L.Ortega
El Paso Texas
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
neoLeoX
2005-09-15 23:55:32 UTC
Permalink
The one am interested is the one on the link...
but would like to know if there's is somebody had translated it to VFP
already...

if not.. well... looks like a 2 or 3 days of work!! :)

thanks a lot Mike
Post by Mike Gagnon
If you are up to doing some translation here is how to do it in VB
http://support.microsoft.com/default.aspx?scid=kb;en-us;202480
or use WMI
strComputer = "."
objWMIService = Getobject("winmgmts:"+
"{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
colInstalledPrinters = objWMIService.ExecQuery("SELECT * FROM
Win32_Printer")
For Each objPrinter In colInstalledPrinters
?"Name: " + objPrinter.Name
Do Case
Case objPrinter.PrinterStatus = 1
strPrinterStatus = "Other"
Case objPrinter.PrinterStatus = 2
strPrinterStatus = "Unknown"
Case objPrinter.PrinterStatus = 3
strPrinterStatus = "Idle"
Case objPrinter.PrinterStatus = 4
strPrinterStatus = "Printing"
Case objPrinter.PrinterStatus = 5
strPrinterStatus = "Warmup"
Endcase
? "Printer Status: " + strPrinterStatus
Next
Post by neoLeoX
Hi group
is there an API to know the printer status?
this is because SYS(13) seems always return "READY" . Even if is
"Spooling" or "Printing" or Stuck!! (while Status is 'Printing")
thanks in advance
VFP 9
OS WinXP Pro
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
L.Ortega
El Paso Texas
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Loading...