by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 15th December 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Connect or disconnect a LPT port
API Declarations
(ByVal hwnd As Long, ByVal dwType As Long) As Long
Private Declare Function WNetDisconnectDialog Lib "mpr.dll" (ByVal hwnd As Long, ByVal dwType As Long) As Long
'Connect LPTx
xyz = WNetConnectionDialog(Me.hwnd, 2)
End Sub
Private Sub Command2_Click()
'Disconnect LPTx
xyz = WNetDisconnectDialog(Me.hwnd, 2)
End Sub