Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Current User on 98
Message
General information
Forum:
Visual Basic
Category:
Windows API functions
Miscellaneous
Thread ID:
00344744
Message ID:
00344783
Views:
20
>How can I get the current user name for the person logged on a 98 Box?
>
Sure you can if you use this little API call:

Private Declare Function GetUserName _
Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
nSize As Long _
) As Long

Public Function GetUserID() As String
Dim lngSize As Long
Dim strBuffer As String

strBuffer = Space$(255)
lngSize = Len(strBuffer)
Call GetUserName(strBuffer, lngSize)
strBuffer = Left$(strBuffer, lngSize)
GetUserID = Trim$(UCase$(Replace(strBuffer, Chr$(0), "")))
End Function
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform