Autor Beitrag
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Sa 16.06.07 11:41 
Wie kann ich eine Datei, die in einer Liste steht, mit dem externen, dazugehörigen Programm öffnen?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.ListView1DblClick(Sender: TObject);
var sel_path: String;
    sel_file: String;
    sel_stream: TFileStream;
begin
  sel_path := ListView1.Selected.SubItems[0];
  sel_file := ListView1.Selected.Caption;
  sel_stream := TFileStream.Create(sel_path + sel_file, fmOpenRead);
  { hier soll die Datei dann mit dem Programm geöffnet werden }
end;
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 16.06.07 12:04 
bflegel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 193
Erhaltene Danke: 1

Win XP, Win 7, BS2000
D5
BeitragVerfasst: Sa 16.06.07 12:07 
Schau mal da:

www.delphi-forum.de/...ghlight=shellexecute

Das müsste es sein

//Edit: Grmpf... wieder zu langsam :)

_________________
I know all the jokes about my name
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Sa 16.06.07 12:49 
Kann mir jemand den allgemeinen Syntax geben?
Ich hab ja Vista, da kann ich die Hilfe nicht aufrufen...
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 16.06.07 12:54 
Auf der MS-Webseite kannn man sich IMHO irgendwo das alte Hilfe-Anzeige-Programm downloaden.

In dem Link von bflegel steht aber doch schon alles...
Musst nur ein bisschen scrollen.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Sa 16.06.07 12:55 
danke, lade es gerade schon runter
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Sa 16.06.07 13:07 
wenn ich jetzt
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.ListView1DblClick(Sender: TObject);
var sel_path: String;
    sel_file: String;
    sel_full: String;
begin
  sel_path := ListView1.Selected.SubItems[0];
  sel_file := ListView1.Selected.Caption;
  sel_full := sel_path + sel_file;
  ShellExecute(Handle, 'open', nil, PChar(sel_full), nil, SW_SHOW);
end;

schreibe, dann wird nur der Ordner geöffnet, in dem die gesamte Suche stattgefunden hat...
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 16.06.07 13:58 
Der 3. Parameter ist die Datei, nicht der 4. Im 4. stehen die Parameter des Programms.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Sa 16.06.07 14:05 
dank dir
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Sa 16.06.07 14:06 
dank dir