I need to read and write a configuration file to windows disk in WinXP through Win8. Where is they best place to do this? Doesn't seem like the ProgramData folder is allowing
procedure TfrmMain.FormCreate(Sender: TObject);
var
path: array[0..MAX_PATH] of char;
begin
SHGetFolderPath(0, CSIDL_COMMON_APPDATA, 0, SHGFP_TYPE_CURRENT, @path);
AppPath:= Path;
AppPath:= AppPath + '\Customer\';
if not DirectoryExists(AppPath) then
CreateDir(AppPath);
if FileExists(AppPath + 'Customers.cst') then
LoadFromFile(AppPath + 'Customers.cst');
end;
procedure TfrmMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if ListModified then
begin
if MessageDlg('Save Changes?', mtWarning, [mbYes, mbNo], 0) = mrYes then
SaveToFile(AppPath + 'Customers.cst');
canClose:= True;
end
else
canClose:= False;
end;