Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi OpenDialog Filter (https://www.delphipraxis.net/111380-opendialog-filter.html)

Tim Henford 2. Apr 2008 15:25


OpenDialog Filter
 
Hallo,

kann man ein OpenDialog so einstellen, dass er nur Dateien eines Ordners anzeigt, die z.Bsp. heute erstellt wurden?

Danke Tim

DeddyH 2. Apr 2008 15:27

Re: OpenDialog Filter
 
AFAIK nein, Du kannst nur über die Extension filtern.

Tim Henford 2. Apr 2008 15:42

Re: OpenDialog Filter
 
Aber über
Delphi-Quellcode:
procedure TForm1.OpenDialog1IncludeItem(const OFN: TOFNotifyEx;
  var Include: Boolean);
müsste das doch gehen...

DeddyH 2. Apr 2008 16:48

Re: OpenDialog Filter
 
Im Moment sehe ich nicht, wie :gruebel:

Klaus01 2. Apr 2008 18:55

Re: OpenDialog Filter
 
.. nun wenn es jemanden gibt der einen expert-exchange account hat
der könnte für eine Lösung mit onIncludItem einmal nachschauen.

So haut das noch nicht hin:
Delphi-Quellcode:
procedure TForm1.OpenDialog1IncludeItem(const OFN: TOFNotifyEx;
  var Include: Boolean);
begin
  include:=false;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  opendialog1.Options:=[ofEnableIncludeNotify];
  if opendialog1.Execute then
    begin
    end;
end;
Grüße
Klaus

wido 2. Apr 2008 19:02

Re: OpenDialog Filter
 
OnIncludeItem wird nicht funktionieren. Siehe dazu auch:
http://msdn.microsoft.com/msdnmag/is...A/default.aspx

Zitat:

At first glance, Windows® seems to offer exactly what you want. If you create your dialog with OFN_ENABLEINCLUDENOTIFY, Windows sends your hook procedure a CDN_INCLUDEITEM notification for every item it adds to the open list. If you return FALSE, Windows excludes the item. The problem is, Windows doesn't notify you for ordinary files, only pseudo-objects like namespace extensions. When you read the documentation through a magnifying glass, the print is perfectly clear: "The dialog box always includes items that have both the SFGAO_FILESYSTEM and SFGAO_FILESYSANCESTOR attributes, regardless of the value returned by CDN_INCLUDEITEM." Apparently the Redmondtonians added CDN_INCLUDEITEM for their own purposes, which didn't include filtering ordinary file names. Sigh
Ist übrigens die selbe Antwort wie bei Experts Exchange :P.


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:32 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz