Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2025-09

Difference in TOpenDFialog behavior Win10 => Win11

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

This is an issue that I believe is caused by Windows 11...

5-6 years ago I have created a FreePascal/Lazarus utility to process video files and I have and used it daily since then. It was last built on Windows 10 using Lazarus 3.4 in beginning of this year.

It operates on video files which the user select through an OpenFile form button which opens a TOpenDialog selection window.
I always preset this to the last open video file (path saved in the ini file).

On Windows 10 this shows the *file content* of the directory in the right hand pane and the directory tree view to the left selects the directory of that file and shows the other video sub-directories in there.

This makes it very easy to navigate from one video dir to another.

But now after upgrading my PC to Windows 11 the dialog no longer focuses the tree view to the left on the dir where the video file last used is located.

Instead the dir pane has the focus set to "Desktop" of all things, when at the same time the files pane shows the content of my video dir on a different device (my NAS) as it should!!!!
So the navigation becomes rather awkward and non-intuitive..

How can I change this back (in code) such that given the full path of the target file (from the ini file) I can set the properties of the TOpenDialog object such that it shows the actual file (in the right pane like it is now) but *also* sets the directory pane to the left to select the directory the file is located in?

Code snippet from the open video file function:

  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
  begin
    VideoURL := dlgOpen.FileName;
    FVideoFile := ExtractFileName(VideoURL);

Is there something else I need to set on the TOpenDialog object dlgOpen to force it to set the dir pane to select the parent dir of the file?

(I wish I did not do the Windows 11 upgrade....)

Bo Berglund Developer in Sweden

Reply by email

Olivier Sannier
to Bo Berglund

Le 09/09/2025 à 11꞉23, Bo Berglund via fpc-pascal a écrit :

Show quoted text 13 lines
On Windows 10 this shows the *file content* of the directory in the right hand pane and the directory tree view to the left selects the directory of that file and shows the other video sub-directories in there. This makes it very easy to navigate from one video dir to another. But now after upgrading my PC to Windows 11 the dialog no longer focuses the tree view to the left on the dir where the video file last used is located. Instead the dir pane has the focus set to "Desktop" of all things, when at the same time the files pane shows the content of my video dir on a different device (my NAS) as it should!!!! So the navigation becomes rather awkward and non-intuitive..

I believe this comes from a setting in File Explorer:

Display Tab, Options
In the dialog, inside yet another Display tab, there is a list where you see a "navigation pane" category
Inside that category there is something along the lines of "Develop to opened folder" (translated from my OS language)

It's not checked by default, and I believe Windows 11 resets anything set in here that you would have changed in Windows 10.

As to doing this by code, I'm not sure this is possible.

Hope this helps

Reply by email

Bo Berglund
to Bart
Bart wrote 6 lines
On Tue, Sep 9, 2025 at 11:23?AM Bo Berglund via fpc-pascal wrote: > This is an issue that I believe is caused by Windows 11... AFAIK nothing relevant has changed in the WS code that could cause this.

Still it does this annoying thing...

But I found thta if I click the Up arrow (4th button on the top bar) then it moves ficus to the directories so I can change directory properly without much searcing.

Another really bad Win11 thing is that the QuickLaunch Toolbar support has been removed in Windows11.
I had about 10 of my mostly used applications on tghat bar so I could very easily start any of them. Now gone.

Action:
So I have started a Lazarus project to create a replacement that will work in much the same way by having a "toolbar" ribbon window containgng the shortcut icons of the applications I use. When clicked the selected application starts in a new instance (Unlike what pinning app aicons to the Windows bottom bar does).

It cannot be integrated in the Windows bottom bar, but otherwise it will look about the same. Configuration via an ini file is not optimal but what I can do. ChatGPT is a great help here...

Bo Berglund Developer in Sweden

Reply by email