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 network drive
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 Network Drive
xyz = WNetConnectionDialog(Me.hwnd, 1)
End Sub
Private Sub Command2_Click()
'Disconnect Network Drive
xyz = WNetDisconnectDialog(Me.hwnd, 1)
End Sub