From within a Delphi program, how can I determine the value of a system's localappdatafolder? Is there a particular method I can call like when I use the GetWindowsDirectory function to find the value of a systems Windows folder?
DelphiPascal
Last Comment
efz
8/22/2022 - Mon
rfwoolf
Can you try this:
function TFrmMainMenu.GetApplicationDataFolder: string;
const
SHGFP_TYPE_CURRENT = 0;
var
Res: HResult;
Path: array[0..Max_Path] of Char;
begin
Res := ShGetFolderPath(0,CSIDL_COMMON_APPDATA,0,SHGFP_TYPE_CURRENT,path);
if S_OK <> Res then raise Exception.Create('Could not determine application data path');
Result := Path;
end;
function TFrmMainMenu.GetApplicatio
const
SHGFP_TYPE_CURRENT = 0;
var
Res: HResult;
Path: array[0..Max_Path] of Char;
begin
Res := ShGetFolderPath(0,CSIDL_CO
if S_OK <> Res then raise Exception.Create('Could not determine application data path');
Result := Path;
end;