Autor Beitrag
Rool
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: So 02.02.03 13:20 
Wie kann ich mit ShellExecute einer Anwendung mehrere Dateinamen als Parameter übergeben??

_________________
MFG Rool
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 02.02.03 13:26 
Hoffe ich habe dich richtig verstanden:

Als Paremter gibts du einfach die Dateinamen an(durch Leerzeichen getrennt und in " ")
Beispiel-Parameter: "File1" "File2" "File3" usw.

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: So 02.02.03 13:47 
Zur Sicherheit auch den Pfad der Datei in Anführungszeichen:
Beispiel:
"C:\dastestprogramm.exe" "nopopup" "username" "passwort"
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 02.02.03 18:11 
die anführungszeichen um den pfad der dtei brauchst du nur wenn der pfad ein leerzeichen enthält !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: So 02.02.03 18:12 
zur Sicherheit sollte man die aber immer setzen, zum Beispiel bei Individuellen Pfäden
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: So 02.02.03 18:17 
Titel: Funktioniert irgendwie nicht...
Der erste Parameter kommt an, der Rest nicht! Hab das ganze auf die Methode von MathiasSimmack gemacht siehe:
www.delphi-forum.de/...;highlight=parameter

weis auch nicht warum das so ist!!!

_________________
MFG Rool
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: So 02.02.03 18:19 
geht eigentlich ganz einfach:
Öffnen-Befehl:
"PROGRAMM" "PARA1" "PARA2"

abfragen:
paramstr(0) = PROGRAMM
paramstr(1) = PARA1

usw.
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: So 02.02.03 18:41 
Titel: Neee...
Das hab ich ja längst ausprobiert. wenn mans so macht startet das Delphi Programm so oft wie die Anzahl der Parameter ist. Um das zu vermeiden hab ichs so gemacht wie es MS vorgeschlagen hat (siehe Link oben). Aber wenn ich jetzt in Command das eingebe, was du gesagt hast, kommt zwar der erste Parameter an, aber der Rest geht einfach verloren!!!
Ich bin schon am verzweifeln!!!
Was soll man da machen :?:

_________________
MFG Rool
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 03.02.03 12:48 
Mathias hat gestern Abend eine Antwort gegeben. Ließ es Dir doch mal durch!

Gruß
TINO
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: Mo 03.02.03 13:57 
Titel: ...
Wenn du das mit den Anführungszeichen meinst, das hab cih natürlich beachtet!

_________________
MFG Rool
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 03.02.03 15:18 
Titel: Re: ...
Rool hat folgendes geschrieben:
Wenn du das mit den Anführungszeichen meinst, das hab cih natürlich beachtet!

Nein, ich meine dieses Postings:
MathiasSimmack hat folgendes geschrieben:
Rool hat folgendes geschrieben:
aber wie übergebe ich diese Parameter per Code (ShellExecute) oder mit Start->Ausführen ???
Habs so versucht: "C:\Prog.exe" "Datei1" "Datei2" usw. aber das geht nicht!!!
Was muss ich aufrufen???

Da ich via WM_COPYDATA nur den ersten Parameter an die laufende Instanz weiterreiche, sollte der Aufruf von
ausblenden Quelltext
1:
prog.exe Datei1					

erfolgreich sein. Die zweite Variante wäre eine for-Schleife, die sich durch die übergebenen Parameter "loopt" und jeden nacheinander an die laufende Instanz weiterreicht. Dann, und wirklich erst dann!, kannst du auch
ausblenden Quelltext
1:
prog.exe Datei1 Datei2 ...					

aufrufen.


Gruß
TINO
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: Mo 03.02.03 15:35 
Titel: OK...
Ja hast recht, ich war wohl etwas zu voreilig. Ich bin irgendwie durcheinandergekommen mit den Parametern die übergeben werden wenn man sich in dei Registry einträgt und denen die man per: "NKNLN" "njknklnkl" "bhjbjkbh" übergibt! Aber ketzt ist alles klar! Danke für eure Mühe!!!

_________________
MFG Rool