{折腾很久了,想不出怎么算出在机器装双系统时,求得到当前系统中Fonts文件位置-难题?}{还有下面得语句错了,自己搞不定?}function GetFontsDir: String;
var
ac: array [1..20] of Char;
pc: PChar;
begin
pc := @ac;
GetFontsDirectory(pc, 20); {问题在这句话怎么错了}
Result := pc;
end;
var
ac: array [1..20] of Char;
pc: PChar;
begin
pc := @ac;
GetFontsDirectory(pc, 20); {问题在这句话怎么错了}
Result := pc;
end;
这是以为GetWindowsDirectory可以改为GetFontsDirectory的
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]下的Fonts的键值~~
var
WinDir,FontDir: string;
aWinDir: array[0..Max_Path] of char;
begin
GetWindowsDirectory(aWinDir,Max_Path);
WinDir := string(aWinDir);
FontDir := WinDir + '\Fonts';
Result := FontDir;
end;