Autor Beitrag
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Di 23.07.02 21:08 
hi,
ist zwar ne anfänger frage, aber mir fällt der code nicht ein ! :(
Also, ich möchte, das wenn der benutzer auf einen button klickt sich eine andere Datei öffnet. So weit ich mich noch an den vergessenden quellcode erinnere, war das nur eine zeile. kann mir jamand weiterhelfen?
DANKE!
mfg hibbert

:arrow:

Link entfernt. Tino
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Mi 24.07.02 06:47 
assignfile in der Hilfe

_________________
Gruß

Wolfgang

----------
zu hause ist es doch am schönsten
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mi 24.07.02 10:48 
vielen dank,
aber das war nicht der code den ich suche,der code den ich meine, da braucht man kein open dialog undso.Er soll die Datei ja nicht in Delphi öffnen, er soll sie ausführen,d.h. z.b. ein spiel öffnen,sodass man dann 2 geöffnete anwendungen hat.
mfg hibbert


:arrow:

Link entfernt. Tino
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Mi 24.07.02 10:57 
Das ist eine ganz andere Frage! Hier ist die Lösung: www.swissdelphicente.../showcode.php?id=455

_________________
Gruß

Wolfgang

----------
zu hause ist es doch am schönsten
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mi 24.07.02 14:41 
Danke!
aber das funzt leider nicht :( !!
er er makiuert mir die 2. Zeile rot und zwar die

ShellExecute(Application.Handle, 'open', c, nil, nil, SW_NORMAL); :?:
(überings, so ahnlich sah meine zeile auch aus die ich suche !)

Außerdem möchte ich ja nur eine ganz bestimmte datei damit öffnen !

ich hoffe, dass mir jemand weiter helfen kann !

bis jetzt schon mal vielen dank !
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 24.07.02 14:46 
Es würde uns weiterhelfen wenn Du uns sagst was Delphi für einen Fehler meldet.

Mal eine Vermutung: Hast Du die Unti ShellAPI eingebunden?

Gruß
TINO
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Mi 24.07.02 14:47 
ShellExecute(Application.Handle, 'open', c, nil, nil, SW_NORMAL);

wo das c steht muß dein Programmname hin!

_________________
Gruß

Wolfgang

----------
zu hause ist es doch am schönsten
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mi 24.07.02 14:52 
DAAAANKE! :D :D :D
ich hab mich dort nochmal umgeschaut und hab es herausgefunden!!!

NOCHMAL DANKE !!! :P :P

mfg hibbert
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Mi 24.07.02 19:44 
Hallo,
Habe diesen Code gefunden.
Ist da auch das WinEXEC Problem? Oder soll ich einen anderen Code nehmen?
Soll ja mal nicht mehr gehen.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure ExecuteShellCommand(cmdline: string; hidden: Boolean);
const
  flags: array [Boolean] of Integer = (SW_SHOWNORMAL, SW_HIDE);
var
  cmdbuffer: array [0..MAX_PATH] of Char;
begin
  GetEnvironmentVariable('COMSPEC', cmdBUffer, SizeOf(cmdBuffer));
  StrCat(cmdbuffer, ' /C ');
  StrPCopy(StrEnd(cmdbuffer), cmdline);
  WinExec(cmdbuffer, flags[hidden]);
end;

ExecuteShellCommand('c:\test.exe', True);