Display the map and disconnect network drive dialogs in VB

By the way, here's the code:

Option Explicit
Private Declare Function WNetConnectionDialog Lib "mpr.dll" (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
Private Const RESOURCETYPE_DISK = &H1
Public Sub MapDriveShow()
Call WNetConnectionDialog(0&, RESOURCETYPE_DISK)
End Sub
Public Sub DisconnectDriveShow()
Call WNetDisconnectDialog(0&, RESOURCETYPE_DISK)
End Sub

Komentar