Hi,
vergleiche mal, wenn du magst:
Delphi-Quellcode:
unit WinUtils;
interface
function GetProfilesDir:
String;
implementation
const
userenv = '
userenv.dll';
function GetProfilesDirectory(lpProfilesDir: PChar;
var Size: DWORD): BOOL;
stdcall;
external userenv
name '
GetProfilesDirectoryA';
function GetProfilesDir:
String;
var
pathName:
array [0 .. MAX_PATH]
of Char;
dwSize: DWORD;
begin
dwSize := SizeOf(pathName);
if GetProfilesDirectory(pathName, dwSize)
then SetString(Result, pathName, dwSize)
else RaiseLastWin32Error;
end;
end.
Grüße vom marabu