
Podemos usar el API para comprobar la password del usuario que entró en sesión. Para ello declararemos en un módulo :
Private Declare Function WNetVerifyPassword Lib "mpr.dll" Alias _
"WNetVerifyPasswordA" (ByVal lpszPassword As String, _
ByRef pfMatch As Long) As Long
Public Function VerifyWindowsLoginUserPassword(ByVal Password As String) As Boolean
Dim rtn As Long, Match As Long
rtn = WNetVerifyPassword(Password, Match)
If rtn Then
VerifyWindowsLoginUserPassword = False
Else
VerifyWindowsLoginUserPassword = (Match <> 0)
End If
End Function
Y para saber si una password es la del usuario simplemente :
If VerifyWindowsLoginUserPassword(txtPassword.text) then
msgbox "Correcta"
else
msgbox "Errónea"
End If

