Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi .txt files öffnen (https://www.delphipraxis.net/24740-txt-files-oeffnen.html)

the_seed 25. Jun 2004 12:27


.txt files öffnen
 
howdy,
habe folgendes problem... wie starte ich .bat,txt usw files?
normal ja ->
Code:
ShellExecute(0,Nil,PChar('C:\hip.txt'),Pchar(''),             Pchar(''),SW_NORMAL);
nur rührt sich da nix !? wiederrum exen etc werden ohne probleme geöffnet ?

Die Muhkuh 25. Jun 2004 12:32

Re: .txt files öffnen
 
Hi,


probiers mal so:

Delphi-Quellcode:
ShellExecute(0,Nil,PChar('C:\hip.txt'),nil,nil,SW_SHOWNORMAL);

[edit] Niö in nil geändert [/edit]

the_seed 25. Jun 2004 12:35

Re: .txt files öffnen
 
Zitat:

Zitat von Spider
Hi,


probiers mal so:

Delphi-Quellcode:
ShellExecute(0,Nil,PChar('C:\hip.txt'),nil,niö,SW_SHOWNORMAL);

is ja (fast) der gleiche code.... funktioniert nicht :gruebel:

Die Muhkuh 25. Jun 2004 12:36

Re: .txt files öffnen
 
Was für Delphi verwendest du?


PS: Statt niö lieber nil schreiben ;) Ich verbesser meins gleich

the_seed 25. Jun 2004 12:45

Re: .txt files öffnen
 
delphi7 EE - mmhh der pfad stimmt aber nix passiert ...

Steve 25. Jun 2004 12:45

Re: .txt files öffnen
 
Delphi-Quellcode:
ShellExecute(0,'open',PChar('C:\hip.txt'),nil,nil,SW_SHOWNORMAL);
2. Parameter = 'open' :zwinker:

Stephan

Die Muhkuh 25. Jun 2004 12:47

Re: .txt files öffnen
 
@Steve


muss nicht unbedingt sein. es geht auch ohne.

Hier mal ein paar Varianten
Delphi-Quellcode:
ShellExecute(Handle,'open',PChar('C:\hip.txt'),nil,nil,SW_SHOWNORMAL);
Delphi-Quellcode:
ShellExecute(Handle,nil,PChar('C:\hip.txt'),nil,nil,SW_SHOWNORMAL);
Delphi-Quellcode:
ShellExecute(0,'open',PChar('C:\hip.txt'),nil,nil,SW_SHOWNORMAL);
Delphi-Quellcode:
ShellExecute(0,nil,PChar('C:\hip.txt'),nil,nil,SW_SHOWNORMAL);
Eins davon wird funtzen

Die Muhkuh 25. Jun 2004 12:55

Re: .txt files öffnen
 
Also bei mir gingen alle Varianten.


Diese zwei auch:

Delphi-Quellcode:
ShellExecute(Handle,nil,'C:\test.txt',nil,nil,SW_SHOWNORMAL);
Delphi-Quellcode:
ShellExecute(0,nil,'C:\test.txt',nil,nil,SW_SHOWNORMAL);


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:45 Uhr.

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