After upgrading my Windows-10 PC to Windows-11 my frequently used application to edit video files changed behaviour when using the function to select the file to work on. It was created some 6-7 years ago and has been modified several times during the time since then, last time in the beginning of this year using Lazarus 3.4.
It uses this TOpenDialog, which has been dropped on the main form when I designed the application:
dlgOpen: TOpenDialog;And its customized propertis (in the lfm file) are:
object dlgOpen: TOpenDialog
DefaultExt = '.mp4'
Filter = 'MP4 Video|*.mp4|MP3 Audio|*.mp3|Other media|*.*'
Left = 24
Top = 280
endEverything else are defaults.
The dialog is called like this:
procedure TfrmMain.btnOpenClick(Sender: TObject);
var
VideoURL: Widestring;
lastfile: string;
lastvolume, lastpos: integer;
begin
lastfile := ReadIniString('videofile', 'lastfile', '');
lastvolume := ReadIniInt('videofile', 'lastvol', trkVolume.Position);
lastpos := ReadIniInt('videofile', 'lastpos', 0);
if lastfile '' then
begin
dlgOpen.InitialDir := ExtractFileDir(lastfile);
dlgOpen.FileName := ExtractFileName(lastfile);
end;
if dlgOpen.Execute thenAt this point the dialog is shown to the user with the lastfile selected in the right hand pane.
The left hand pane is supposed to show the *parent directory* of the selected file so it is easy to navigate to another directory in the same video library main dir.
And this has always happened without me having to code anything...
Not so after the switch to Windows 11!
(I have not touched the exe file of the application during or after the Windows upgrade.)
Now the right hand pane shows the defined file selected in its directory with the other files listed too.
But the left hand pane shows the ** User's Desktop content **, which is totally irrelevant for the operation to select the next file to edit... It *should* show the folder content of the directory where the selected dir lives.
QUESTION:
---------
Is there some property or command I can use in order to define the directory to be shown inside the left hand window in code before I activate it?
As you see above I have used just the bare minimum of configuration of the dialog in the application.
Grateful for advice because I use this application maybe 10 times per day and it is really annoyiong to use it now.
