Small background of the program:
The program uses a tabbed interface for simultaneous work with several files.
I'm trying to change the OpenDialog directory, so every time I call an open file, the directory of the file I'm currently working on will be displayed, but even when I set InitialDirthe file path, it always displays the last open file directory, not the one which I install for him.
I tried the following:
if Length(CurrentFileName) > 0 then
begin
OpenFileDialog.InitialDir :='';
SetCurrentDirectory(PChar(CurrentFileName));
OpenFileDialog.InitialDir := ExtractFileDir(CurrentFileName);
end;
if OpenFileDialog.Execute then
...
Where CurrentFileNameis the full path with the file name of the currently opened tab file. But no luck.
Is there any way to achieve this?
So for example:
tab1open c:\mydir\file.txt
tab2opend:\someotherdir\somefile.txt
tab1 I, OpenDialog c:\mydir\
Delphi 7. .