GetUserName

win32api/getusern.txt 19-Apr-00
http://members.xoom.com/n_s_wong
http://www.angelfire.com/ns/nswong

_DLL FUNC GetUserName(lpBuffer AS PSZ, nSize AS DWORD PTR) ;
  AS LOGIC PASCAL:ADVAPI32.GetUserNameA#68

PROCEDURE Start()
  LOCAL DIM abBuffer[MAX_COMPUTERNAME_LENGTH + 1] AS BYTE
  LOCAL dwSize AS DWORD
  dwSize:=MAX_COMPUTERNAME_LENGTH + 1
  GetUserName(@abBuffer, @dwSize)
  MessageBox(NULL,@abBuffer,String2Psz("GetUserName"),0)
RETURN

If user do not login to network, this function return a
NULL_PSZ, this can use for checking either application are
running under network or not, not perfect, but simple.
