Group: System Information - Library: advapi32
Retrieves the user name of the current thread. This is the name of the user currently logged onto the system.
Retrieving local computer and user names
Obtaining names of local and global groups for current user (WinNT/XP/2K)
Finding out if the current user is the Guest account
BOOL GetUserName(
LPTSTR lpBuffer, // address of name buffer
LPDWORD nSize // address of size of name buffer
); DECLARE INTEGER GetUserName IN advapi32;
STRING @lpBuffer,;
INTEGER @nSize lpBuffer Points to the buffer to receive the null-terminated string containing the user"s logon name.
nSize Pointer to a DWORD that, on input, specifies the maximum size, in characters, of the buffer specified by the lpBuffer parameter.
If the function succeeds, the return value is a nonzero value.
SYS(0) -- the network machine information -- returns computer name and user name in one string.
See also: GetUserNameEx, GetComputerName, GetComputerNameEx.
Home