ClosePrinter Reference in C#, VB.NET and VB6
Visual Basic 6 definition
Visual Basic 6 example source code
Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Visual Basic .NET definition
Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Integer) As Integer
public static extern int ClosePrinter(int hPrinter)
ClosePrinter closes a printer which had been previously opened by OpenPrinter. After this function closes the printer, the handle to the printer obviously can no longer be used, even if the function fails.
If successful, the function returns a non-zero value. If an error occured, the function returns zero (use GetLastError to get the error code).
For further information on Windows API functions such as these, and how to use these API's in your
C# and VB.NET applications, please refer to the book 'Network programming in .NET' (Buy at Amazon UK)
(Buy at Amazon US)
Visual Basic .NET example source code
C# example source code
Provide a code example
Copyright 2017 Infinite Loop Ltd.