Hola,que tal.
En una statusbar puedes poner lo siguiente para recuperar nombre de usuario y nombre del pc.
Código:
Private Sub Timer1_Timer()
Dim sthour As String
barra.Panels(1).Text = "Usuario: " & Get_User_Name
barra.Panels(2).Text = Get_ComputerName
'El panel 3 lo pongo por defecto en propiedades q sea una fecha
barra.Panels(4).Text = Format(Now(), "HH:MM:SS AMPM")
End Sub
Código:
Public Function Get_User_Name()
Dim s$, cnt&, dl&
cnt& = 199
s$ = String$(200, 0)
dl& = WNetGetUserName(s$, cnt)
Get_User_Name = Left$(s$, cnt)
LocalName = Get_ComputerName
End Function En un módulo:
Código:
Declare Function WNetGetUserName& Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long)
Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Código:
Public Function Get_ComputerName()
Dim lpBuff As String * 25
Dim Ret As Long, ComputerName As String
Ret = GetComputerName(lpBuff, 25)
ComputerName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
Get_ComputerName = ComputerName
End Function Espero no dejarme nada. Ya nos contarás.