Einzelnen Beitrag anzeigen

Benutzerbild von faux
faux

Registriert seit: 18. Apr 2004
Ort: Linz
2.044 Beiträge
 
Turbo Delphi für Win32
 
#8

Re: Dateien von Delphi aus öffnen

  Alt 3. Jan 2006, 19:27
Zitat von 3_of_8:
ShellExecute(Handle,'open','Dateiname',nil,nil,0);
Wenn du ihm schon die Parameter gibst, dann erkläre sie doch wenigstens.
Woher soll er wissen, dass das erste nil die Parameter und das zweite nil das Arbeitsverzeichnis repräsentieren?

Tipp: MSDN-Library durchsuchenShellExecute bzw ShellExecute.

Zitat von ManuMF:
Ein Tipp: Verwende statt 'open' nil. Manchmal funktioniert es bei EXEn sonst nicht.
MSDN:
open
Opens the file specified by the lpFile parameter. The file can be an executable file, a document file, or a folder.

NULL
For systems prior to Microsoft Windows 2000, the default verb is used if it is valid and available in the registry. If not, the "open" verb is used.

For Windows 2000 and later systems, the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry.


@icqgoofy:
Der Pfad von Paint ist nicht C:\Programme\Zubehör\Paint.exe, sondern C:\WINDOWS\system32\mspaint.exe. Wenn du das Programm veröffentlichen willst, also nicht nur für dich alleine Programmierst, solltest du es mit der Umgebungsvariable SystemRoot machen, da man Windows auch in ein anderes Verzeichnis oder auf einen anderen Laufwerksbuchstaben installieren kann.

Zitat von 3_of_8:
Er will Paint öffnen, oder? Also reicht meine Variante.
reichen ist relativ.
Was ist, wenn er gleich ein BIld laden will?

Grüße
Faux
Faux Manuel
Wer weiß, dass er nichts weiß, weiß mehr, als der der nicht weiß, dass er nichts weiß.
GoTrillian
  Mit Zitat antworten Zitat