function Computer_Name(CName: PChar): PChar;
var
Registro : TRegistry;
i : ShortInt;
S : String;
begin
result := CName;
Registro := TRegistry.Create;
try
Registro.RootKey := HKEY_LOCAL_MACHINE;
if Registro.OpenKey
('\System\CurrentControlSet\Services\VxD\VNETSUP', False) then
begin
S := Registro.ReadString('ComputerName');
if (Length(S) > 0) then
for i := 1 to Length(S) do
begin
CName^ := S[i];
Inc(CName);
end;
Registro.CloseKey;
end;
finally
Registro.Free;
end;
CName^ := #0;
end;
It works fine with Win 98.
What changes are necessary in order to work properly also with Win
2000 and Win XP?
How can I know what operational system is running on the computer?
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
SPONSORED LINKS
| C programming language | Computer programming languages | Java programming language |
| The c programming language | C programming language | Concept of programming language |
YAHOO! GROUPS LINKS
- Visit your group "delphi-en" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

