{Bilgisayar'a login olmus kullanici adi ile karistirmayiniz}
function GetCompName: string;
var
buffer:array[0..MAX_COMPUTERNAME_LENGTH+1] of Char;
length:Cardinal;
begin
length:=MAX_COMPUTERNAME_LENGTH+1;
GetComputerName(@Buffer,length);
Result := Buffer;
end;
// Kullanimi:
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption := GetCompName;
end;