Private Declare Function GetUserNameApi Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer _ As String, nSize As Long) As Long Public Function GetUserName() Dim result As String Dim n As Long Dim retval As Long n = 255 result = Space$(n) retval = GetUserNameApi(result, n) GetUserName = Left$(result, n - 1) End Function
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.