Um exemplo para validar login do windows pelo VB6…

Em um modulo…
Public Const LOGON32_LOGON_INTERACTIVE = 2
Public Const LOGON32_LOGON_BATCH = 4
Public Const LOGON32_LOGON_SERVICE = 5
Public Const LOGON32_PROVIDER_DEFAULT = 0

Declare Function LogonUser Lib “advapi32” Alias “LogonUserA” _
(ByVal lpszUsername As String, ByVal lpszDomain As String, _
ByVal lpszPassword As String, ByVal dwLogonType As Long, _
ByVal dwLogonProvider As Long, phToken As Long) As Long

Declare Function CloseHandle Lib “kernel32” _
(ByVal hObject As Long) As Long

No evento click de um botao
Dim lStatus As Long
Dim TokenHandle As Long

lStatus = LogonUser(txtusuario.Text, txtdominio.Text, txtsenha.Text, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, TokenHandle)

If lStatus Then
lStatus = CloseHandle(TokenHandle)
MsgBox “Login ok”
Else
MsgBox “Erro”
End If

Funciona que eh uma beleza…😀