Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printer Status
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01118502
Message ID:
01118797
Vues:
40
>Here is one using WMI
>
>
strComputer = "."
>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
>
>
>>>Yes, such function exists - GetPrinter. I already have a code that returns printer status using GetPrinter function.
>>
>>Does it work reliably? Can you post the code?

Thanks a lot.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform