Autor Beitrag
Karabulut
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 27.07.03 21:08 
ich bin ein totaler neuling was das ganze programmieren angeht, deswegen hab ich wahrscheinlich eine der blödsten fragen der welt :D

also ich hab ein programm
und mach da nen button
und wenn ich auf den button klick soll jetzt die datei test.txt in test.exe umbenannt werden und ausgeführt werden
die dateien sind im selben verzeichnis wie das programm

wie heist der code dazu??
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: So 27.07.03 21:10 
Hallo und :welcome:,

suche mal hier im Forum nach Suche in: Delphi-Forum, Delphi-Library SHELLEXECUTE.

Gruß
Klabautermann
Karabulut Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 27.07.03 21:44 
hmm ich habs mal so gemacht aber irgendwie geht das ned nur shellexecute geht aber er kanns ned umbenennen
ausblenden Delphi-Quelltext
1:
2:
3:
4:
begin
  RenameFile(const test.txt, test.exe: string): Boolean;
  ShellExecute(Application.Handle, 'open''test.exe'nilnil, SW_SHOW);
end;


Moderiert von user profile icontommie-lie: Delphi-Tags hinzugefügt
Karabulut Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 27.07.03 23:05 
so das problem konnte ich selber lösen, trotzdem danke :D da hab ich jetzt aber gleich noch ne frage. also mein programm startet per button ein anders programm dort kann ich mit der taste * ein männlien steuern

jetzt hab ich in meinem programm einen button, wenn ich den klicke kommt eien aufforderung, "bitte gewünschte taste drücken" dann drücke ich z.b. "enter". wenn ich jetzt das spiel starte, soll mein programm beim tastendruck auf "enter" dem spiel simulieren das ich die * taste gedrückt habe.
wie geht das????
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 27.07.03 23:07 
Karabulut hat folgendes geschrieben:
aber er kanns ned umbenennen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
begin
  RenameFile(const test.txt, test.exe: string): Boolean;
  ShellExecute(Application.Handle, 'open''test.exe'nilnil, SW_SHOW);
end;

Die Zeile mit dem RenameFile ist auch falsch.
ausblenden Delphi-Quelltext
1:
RenameFile('test.txt''test.exe');					

dürfte da erfolgversprechender sein ;-)

Kleiner Tipp: Du solltest dich besser erstmal mit Delphi-Grundlagen vertraut machen. Die Sache mit dem RenameFile sieht nach einem typischen Anfängerfehler aus, der zu faul war, das Handbuch zu lesen. Auch deutschsprachige Delphi-Bücher sollen derweil im Umlauf sein ;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Herbert
Hält's aus hier
Beiträge: 13



BeitragVerfasst: So 27.07.03 23:16 
Hi!

So wie es aussieht, willst du nur die Dateierweiterung einer Datei ändern.

Das geht dann noch viel einfacher.

ChangeFileExt in OH nachschlagen.

Gruß
Karabulut Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 27.07.03 23:21 
wie oben schon erwähnt, konnte ich das problem bereits selber lösen :D

ich hab derzeit aber ein anderes
und das steht auch oben :D
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 27.07.03 23:46 
Bei einer neuen Frage bitte immer ein neues Topic aufmachen. Fragen zum gleichen Thema sind erlaubt, aber eine Taste umwandeln ist nun wirklich was anderes als ein Programm starten.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert