Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove Windows Printer
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00420415
Message ID:
00421373
Views:
12
>Denis,
>
>I just tested WNetCancelConnection2() and it doesn't work on a local printer. The following will
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 = "LPT1:"
>lnhandle = 0
>IF OpenPrinter(@lcname, @lnhandle, 0) # 0
>  = DeletePrinter(lnhandle)
>  = ClosePrinter(lnhandle)
>ELSE
>  ? "Can't open printer!"
>ENDIF
George
DeletePrinter(lnhandle) return 0. GetLastError() function return 5 (Access is denied). Any ideas? (Environment NT4 - Admin account)
Denis
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform