Recent

Author Topic: Unwanted files in TOpenDialog  (Read 3704 times)

peardox

  • Jr. Member
  • **
  • Posts: 70
Unwanted files in TOpenDialog
« on: June 23, 2021, 05:03:11 am »
I've got a TOpenDialog with the filter set to ...

Code: Pascal  [Select][+][-]
  1. OpenDialog1.Filter := '3D Models|*.gltf;*.glb;*.obj;*.x3d;*.x3dv';

When I navigate to a directory with some files with the url extension they get included even though they're not in the filter. The target of the url also ain't in the filter spec...

This is a Windows only "Feature"

« Last Edit: June 23, 2021, 05:04:54 am by peardox »

Bart

  • Hero Member
  • *****
  • Posts: 5265
    • Bart en Mariska's Webstek
Re: Unwanted files in TOpenDialog
« Reply #1 on: June 23, 2021, 09:18:15 am »
Well, thank M$ then  >:D

Bart

peardox

  • Jr. Member
  • **
  • Posts: 70
Re: Unwanted files in TOpenDialog
« Reply #2 on: June 23, 2021, 10:20:04 am »
Well, thank M$ then  >:D

Bart

Really helpful I must say...

Aidex

  • Jr. Member
  • **
  • Posts: 82
Re: Unwanted files in TOpenDialog
« Reply #3 on: June 23, 2021, 11:46:57 am »
I think what Bart meant to say is that it's a behavior of Windows that you can't influence.
See https://stackoverflow.com/questions/56060231/openfiledialog-keep-showing-lnk-files-wpf

I found the function TOpenDialog.CheckFile(), but I don't know if it affects the display in the dialog window.
If so, you could create a derived class and override the function to sort out the .lnk files.
But I don't think that will work.

peardox

  • Jr. Member
  • **
  • Posts: 70
Re: Unwanted files in TOpenDialog
« Reply #4 on: June 23, 2021, 03:18:32 pm »
Sorta makes sense

It's a cosmetic problem, really, as I can just ignore anything that doesn't fit my filespec

 

TinyPortal © 2005-2018