Zitat von
RWarnecke:
Und wie wende ich ich jetzt den Befehl SetComputerNameEx im Delphi an ?
diese
API ist in der Windows.pas nicht enthalten - demnach selber importieren:
Delphi-Quellcode:
Const
kernel32 = 'kernel32.dll';
Type
COMPUTER_NAME_FORMAT = (
ComputerNameNetBIOS,
ComputerNameDnsHostname,
ComputerNameDnsDomain,
ComputerNameDnsFullyQualified,
ComputerNamePhysicalNetBIOS,
ComputerNamePhysicalDnsHostname,
ComputerNamePhysicalDnsDomain,
ComputerNamePhysicalDnsFullyQualified,
ComputerNameMax
);
Function GetComputerNameEx
(
NameType : COMPUTER_NAME_FORMAT;
lpBuffer : PChar;
Var lpnSize : DWORD
) : BOOL; StdCall; External kernel32 Name 'GetComputerNameExA';
Function SetComputerNameEx
(
NameType : COMPUTER_NAME_FORMAT;
lpBuffer : PChar
) : BOOL; StdCall; External kernel32 Name 'SetComputerNameExA';
Procedure ???
Begin
SetComputerNameEx(ComputerNamePhysicalDnsHostname,'Globi');
end;