Get the Window's user name  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 14/07/99

Tip accessed 667 times

 


With This function:


 function GetUserName : String;
 var
    pcUser   : PChar;
    dwUSize : DWORD;
 begin
    dwUSize := 21;
    GetMem( pcUser, dwUSize );
    try
       if Windows.GetUserName( pcUser, dwUSize ) then
          Result := pcUser
    finally
       FreeMem( pcUser );
    end;
 end;



Call example:


  	Label1.Caption:=GetUserName;