deleteprinter (winspool)
Last changed: SeƱor CMasMas-38.104.125.90

.
Summary
DeletePrinterConnection - disconnect / remove client connection to a shared printer

C# Signature:

[DllImport("winspool.drv", CharSet = CharSet.Ansi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool DeletePrinterConnection(String pName);

VB Signature:

Declare Function DeletePrinterConnection Lib "winspool.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

bool result;

Int32 Win32Error;

result = DeletePrinterConnection("\\\\Server_Name\\Printer_Share");

if (result == false)

{

   Win32Error = Marshal.GetLastWin32Error();
   //Do something with Win32Error

}

Documentation