Autor Beitrag
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 04.03.03 20:14 
Wurde bestimmt schonmal behandelt, aber ich finde es hier nicht.

Wie kann ich eine Datei mit dem Windows-Standardprogramm dafür öffnen?
z.b. mp3 Datei in Winamp, doc mit Word, nri mit Nero usw. Eben das, was passiert, wenn man im Explorer nen Doppelklick auf das File macht.

Ich suche also einen Befehl in der Art
ausblenden Quelltext
1:
open_with_standardapplication(filename)					


Gibts da sowas?

Alles Gute, Daniel


Zuletzt bearbeitet von Gausi am Di 04.03.03 20:47, insgesamt 1-mal bearbeitet
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Di 04.03.03 20:28 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
uses 
  ShellAPI;

  { Öffnen }
  ShellExecute (Application.MainForm.Handle, 'open', , , '', SW_SHOWNORMAL);

  { Drucken }
  ShellExecute (Application.MainForm.Handle, 'print', , '''', SW_SHOWNORMAL);

  { E-Mail senden }
  ShellExecute (Application.MainForm.Handle, NIL, PChar ('mailto:info@delphi-forum.de'),'','', SW_SHOWNORMAL)

  { Webseite öffnen }
  ShellExecute (Application.MainForm.Handle, NIL, PChar('http://www.delphi-forum.de'), '''', SW_SHOWNORMAL);
Gausi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 04.03.03 20:46 
Wow, das war mal wieder ne schnelle Antwort. Danke schön :-D
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Di 04.03.03 20:49 
bidde, bidde :wink:
danielsun
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Mo 28.04.03 14:24 
Hola Torsten,

du sag mal ich hab einen aufruf aus einem delphi programm über shellexecute (.....) dabei nutze ich folgenden pfad:
%system%/system32\sndvol32.exe

Aber wenn ich denn absoluten pfad eingeben, von meinem rechner also c:\windows\system32\sndvol32.exe dann unktioniert es, aber mit der umgebungsvariabel nicht.

keine ahnung woran es liegt.

grüsse daniel