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
> {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!
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)
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
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)
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
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)