[DUG] How to get user name in the windows task manager processes list tab

John Bird johnkbird at paradise.net.nz
Wed Jan 28 14:26:09 NZDT 2009


You can also do

temp:string;


        setlength(temp,100);  //has to be big enough first
        setlength(temp,getEnvironmentVariable(PChar('USERNAME'),PChar(temp),length(temp)));

since the user name is also an environment variable at least since Windows 
2000.

John



More information about the Delphi mailing list