Mega Search
23.2 Million


Sign Up

Make a donation  
Bug in TFileOpenDialog [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using

Dear Embarcadero,

I am using Delphi XE6 VCL, and found a bug in the TFileOpenDialog component. When I use a filter for *only* in example executables files ( *.exe), the TFileOpenDialog component should only be able to open **.exe* files, however, also URL (*.url) & LINK (*.lnk) can be openend.
I believe this is a bug.

Hope for a reply.

Thank you.

Johan Burgen

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 2-Dec-2014, at 10:37 AM EST
From: Johan Burgen
 
Re: Bug in TFileOpenDialog [Edit] [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using
> {quote:title=Jeff Overcash (TeamB) wrote:}{quote}
> You mean MS?  As Remy pointed out, this is not a bug in the component.  The 
> behavior is defined at the OS API level.

Thanks for clarify.
So it seems the Windows developers should "fix" this. (Good point for improving the next OS, Windows 10.)

Thanks everybody who participated in this topic!

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 5-Dec-2014, at 1:41 AM EST
From: Johan Burgen
 
Re: Bug in TFileOpenDialog [Edit] [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using
Achim wrote:

> My hope was that there was some options or API functions to
> hide .lnk and .url file from file dialogs.

If there were, I would have told you what they are in my first reply.  IFileOpenDialog does not offer any kind of item filtering (that I can find), like the older GetOpenFileName() function does via its CDN_INCLUDEITEM notification (which only works for certain types of namespace items but not for ordinary files).  So you cannot exclude specific items with IFileOpenDialog.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 4-Dec-2014, at 2:00 PM EST
From: Remy Lebeau (TeamB)
 
Re: Bug in TFileOpenDialog [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using
Jeff Overcash (TeamB) schrieb:

> You mean MS?  As Remy pointed out, this is not a bug in the component.  The 
> behavior is defined at the OS API level.

My hope was that there was some options or API functions to hide .lnk
and .url file from file dialogs. In Windows 10 TP they are still visible
to all open/save dialogs (just run Windows' notepad.exe to verify).

Achim

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 4-Dec-2014, at 1:37 PM EST
From: Achim Kalwa
 
Re: Bug in TFileOpenDialog [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using
Johan Burgen wrote:
>> {quote:title=Achim Kalwa wrote:}{quote}
>> Did you find a way to suppress these items?
> 
> Indeed, I hope they will "fix" this in the next update.

You mean MS?  As Remy pointed out, this is not a bug in the component.  The 
behavior is defined at the OS API level.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 4-Dec-2014, at 1:03 PM EST
From: Jeff Overcash (TeamB)
 
Re: Bug in TFileOpenDialog [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using
> {quote:title=Achim Kalwa wrote:}{quote}
> Did you find a way to suppress these items?

Indeed, I hope they will "fix" this in the next update.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 4-Dec-2014, at 12:03 PM EST
From: Johan Burgen
 
Re: Bug in TFileOpenDialog [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using
Remy Lebeau (TeamB) wrote:

> It is not a bug in TFileOpenDialog, that is simply how the underlying
> IFileOpenDialog interface works.  You can verify that for yourself by
> using IFileOpenDialog directly instead of using TFileOpenDialog.
> [...]

I also find it very annoying to see *.lnk and *.url in the open/save
dialogs. Did you find a way to suppress these items?

TIA
Achim

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 4-Dec-2014, at 5:28 AM EST
From: Achim Kalwa
 
Re: Bug in TFileOpenDialog [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using
Ah, I see.

So it is not possible to 'fix' this in the TFileOpenDialog-component itself, without any additional code?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 2-Dec-2014, at 3:24 PM EST
From: Johan Burgen
 
Re: Bug in TFileOpenDialog [Edit]  
News Group: embarcadero.public.delphi.vcl.components.using
Johan wrote:

> I believe this is a bug.

It is not a bug in TFileOpenDialog, that is simply how the underlying IFileOpenDialog 
interface works.  You can verify that for yourself by using IFileOpenDialog 
directly instead of using TFileOpenDialog.  It exhibits the same behavior:

{code}
uses
  ..., ActiveX, Shlobj, ComObj;

procedure TForm1.Button1Click(Sender: TObject);
var
  Dlg: IFileOpenDialog;
  Filter: TComdlgFilterSpecArray;
begin
  SetLength(Filter, 1);
  Filter[0].pszName := 'EXE Files';
  Filter[0].pszSpec := '*.exe*';
  OleCheck(CoCreateInstance(CLSID_FileOpenDialog, nil, CLSCTX_INPROC_SERVER, 
IFileOpenDialog, Dlg));
  OleCheck(Dlg.SetFileTypes(1, Filter));
  Dlg.Show(Handle);
end;
{code}

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 2-Dec-2014, at 12:03 PM EST
From: Remy Lebeau (TeamB)