GetUserName
The GetUserName function retrieves the user name of the current thread. This is the name of the user currently logged onto the system.
BOOL GetUserName(
LPTSTR lpBuffer, // address of name buffer
LPDWORD nSize // address of size of name buffer
);
Header: Declared in winbase.h.
GetComputerName
The GetComputerName function retrieves the computer name of the current system. This name is established at system startup, when it is initialized from the registry.
BOOL GetComputerName(
LPTSTR lpBuffer, // address of name buffer
LPDWORD nSize // address of size of name buffer
);