Public Declare Function DeletePrinter Lib "winspool.drv" Alias "DeletePrinter" (ByVal hPrinter As Long) As Long
Command1_Click()
DeletePrinter Printer.hDC
End Sub
is this api call correct????
b'coz the printer isn't deleted........
Printable View
Public Declare Function DeletePrinter Lib "winspool.drv" Alias "DeletePrinter" (ByVal hPrinter As Long) As Long
Command1_Click()
DeletePrinter Printer.hDC
End Sub
is this api call correct????
b'coz the printer isn't deleted........
The call is correct, however, the usage isn't. The hPrinter parameter expects a handle to a printer object, not the device context. You can retrieve the printer handle by using the OpenPrinter API function. Also, remember that the printer will not be deleted until all pending jobs are finished.
Later.