Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 19.01.09 09:55 
Hi, Delpher,

ist es möglich, die vom OpenDialog angezeigten Dateien (nicht nach Alfabet, sondern)
nach Bearbeitungsdatum anzeigen zu lassen?

Danke für Hilfe, Detlef A.

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19339
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 19.01.09 15:11 
Hier findest du da etwas, der verlinkte Quelltext in C zeigt noch mehr:
www.delphipraxis.net/post976425.html

Das Problem könnte sein, dass das vielleicht nicht überall funktioniert, du müsstest es unter allen Betriebssystemen, für die es sein soll, testen.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 21.01.09 10:53 
Hi, Sebastian,

was lange währt .. Damit hatte ich nicht mehr gerechnet, und es klappt bestens!

Danke, danke!
Detlef

_________________
ut vires desint, tamen est laudanda voluntas
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 21.01.09 14:30 
Kurze Nachfrage:

Wo muss ich denn suchen, oder was muss ich verändern, damit der OpenDialog nicht mit:
- nach Name, rückwärts
sondern
- nach Datum, vorwärts
als Defaultwert startet??

Danke für Hilfe, Detlef

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19339
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 21.01.09 16:37 
Wird am Anfang OnFolderChange nicht ausgelöst? Dann müsstest du das auch in OnShow machen, ich glaube das oder ein ähnliches Ereignis gab es auch.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 21.01.09 21:35 
Hi, Sebastian,

du hast recht, aber auch der Aufruf bei OnShow verändert nichts.
Ich muss die Sortierung manuell erzeugen, nach Aufruf einer Textdatei (und abspeichern) und erneutem Aufrufen des Opendialogs muss ich die Sortierung wieder neu "erklicken".

Das ist "unerquicklich",
Detlef

_________________
ut vires desint, tamen est laudanda voluntas
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19339
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 21.01.09 22:26 
Wie sieht dein Quelltext denn jetzt aus? Hast du den Delphi-Quelltext nur oder auch von dem C-Quelltext etwas eingebaut?

Ich habe den C-Quelltext z.B. nicht ausprobiert, der scheint aber so etwas zu machen.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 22.01.09 08:32 
Hi, Sebastian,

der Code:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
uses {...} CommCtrls;

function SortFunc(Item1, Item2, Column: LPARAM):integer stdCall;
begin  Result := 1;  end;  // -1 für absteigende Sortierung

procedure TForm2.OpenDialog1FolderChange(Sender: TObject);
const
  FCIDM_SHVIEW_LARGEICON = $7029;                   // Kacheln
  FCIDM_SHVIEW_SMALLICON = $702A;                   // Miniaturansicht
  FCIDM_SHVIEW_LIST = $702B;                        // Liste
  FCIDM_SHVIEW_REPORT = $702C;                      // Details
  FCIDM_SHVIEW_THUMBNAIL = $702D;     // nur XP
  FCIDM_SHVIEW_TILE = $702E;          // XP
var
  NewStyle: DWORD;
  hCommonDialog, hParentWindow, hFileListView : HWND;
begin
  newStyle := FCIDM_SHVIEW_REPORT;    // !
  //newStyle := FCIDM_SHVIEW_THUMBNAIL;  // habe ich auch versucht

  hCommonDialog := (Sender as TCommonDialog).Handle;          // mit PChar() ?
  hParentWindow := FindWindowEx(GetParent(hCommonDialog),0'SHELLDLL_DefView'nil);
  if hParentWindow <> 0 then
  begin
    hFileListView := FindWindowEx(hParentWindow, 0'SysListView32'nil);
    if hFileListView <> 0 then
    begin                                 
      SendMessage(hParentWindow, WM_COMMAND, NewStyle, 0);
      ListView_SortItems(hFileListView, SortFunc, 0);
    end;
  end;
end;


OnFolderChange ist eingetragen als Event bei OnFolderChange und bei OnShow (wie du sagtest, aber ohne Wirkung. SHELLDLL_DefView mit PChar brachte auch nichts.)

Vielleicht liegt es ja an dem C-Coe, wie du vermutest.

Gruß, Detlef

_________________
ut vires desint, tamen est laudanda voluntas
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 22.01.09 09:41 
Bei den Schweizern habe ich noch den folgenden Code gefunden:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
private
    { Private declarations }
    procedure WMUser(var msg: TMessage); message WM_USER+1;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


const
  FCIDM_SHVIEW_LARGEICON  = 28713;
  FCIDM_SHVIEW_SMALLICON  = 28714;
  FCIDM_SHVIEW_LIST       = 28715;
  FCIDM_SHVIEW_REPORT     = 28716;
  FCIDM_SHVIEW_THUMBNAIL  = 28717//    XP only
  FCIDM_SHVIEW_TILE       = 28718//    XP

procedure TForm1.WMUser(var msg: TMessage);
var
 Dlg: HWND;
 Ctrl: HWND;
begin
  Dlg := msg.WParam;
  Ctrl := FindWindowEx(Dlg, 0, PChar('SHELLDLL_DefView'), nil);
  if Ctrl <> 0 then
  begin
    SendMessage(Ctrl, WM_COMMAND, FCIDM_SHVIEW_THUMBNAIL, 0 )
  end;
end;

procedure TForm1.OpenDialog1Show(Sender: TObject);
var
  Dlg: HWND;
begin
  Dlg := GetParent((Sender as TOpenDialog).Handle);
  PostMessage(Handle, WM_USER+1, Dlg, 0);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
  begin
  end;
end;


bis auf Weiteres, Detlef

_________________
ut vires desint, tamen est laudanda voluntas