Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove Windows Printer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00420415
Message ID:
00421540
Vues:
13
George
That is great!! code works ! Thanks! I place full code.. maybe for anybody that will interesting to How to Remove Windows Printer

#DEFINE ADMIN_ACCESS REPLICATE(CHR(0), 8) + CHR(12) + CHR(0) + CHR(15) + CHR(0)

DECLARE INTEGER GetLastError IN Win32Api

DECLARE INTEGER OpenPrinter IN winspool.drv;
STRING @lpname, INTEGER @hPrinter, STRING @pDevMode

DECLARE INTEGER DeletePrinter IN winspool.drv;
INTEGER hPrinter

DECLARE INTEGER ClosePrinter IN winspool.drv;
INTEGER hPrinter

lcname = "Windows Printer Name"
lnhandle = 0

IF OpenPrinter(@lcname, @lnhandle, ADMIN_ACCESS) # 0
IF DeletePrinter(lnhandle)=0
?GetLastError()
Endif
=ClosePrinter(lnhandle)
ENDIF

Thank you again!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform