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:
00420469
Views:
14
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

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform