Using Lazarus I created a video editing tool back in 2018 or so and I have updated it with new functionality ever since. I use it several times daily. When I created it I was running on Windows 10 Pro.
About 2 weeks ago I had to bite the bullet and upgrade my PC to Windows 11, which was a hurdle by itself. And now I have discovered an issue in my program that slows me down using it and which I have to solve somehow:
Every time I open a video file for editing I use the TOpenDialog like this in code:
dlgOpen: TOpenDialog; //Dropped on the form when creating the application
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
end
Everything 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 then
//Stuff that is done after the user selects the mp4 file still works normally..
At this point the dialog is shown to the user with the lastfile selected in the
right hand pane as expected.
The left hand pane is supposed to show the *parent directory* of the selected
file in a list of same level directories so it is easy to navigate to another directory in the same video library's main dir.
And this has always happened without me having to code anything else...
Not so after the switch to Windows 11!(I have not modified the exe file of the application after the Windows upgrade.)
PROBLEMNow on Windows 11 the right hand pane shows the defined file selected in its directory with
the other files listed too. So that is still OK.
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
parent directory of the selected file's dir.
QUESTIONS:
1) Is there some additional property of TOpenDialog I can set to return it to work like before?
2) Is this behavior due to the fact the application was compiled in Windows10 and it can be solved by recompiling it from Windows 11?
3) Is there some other dialog I can use to open the target file, which operates like I want?
Grateful for any help on this since it bugs me every time I use the application now.