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:
00344970
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

Once again Eric you are the man. Thanks so much! Mercy Bocoup? <- Is that right? :)
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform