Autor Beitrag
Aadelbert
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 90

XP, WIN 2000, NT 4.0
D6 Enterprise
BeitragVerfasst: Mo 20.09.04 19:51 
Hallo Leute,

ich möchte in meiner Anwendung eine Datei von LW a:\IWO.xls nach z.B. c:\Test\xy kopieren.

Ich verwende folgenden Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
 procedure ShellFileOperation(fromFile: string; toFile: string; Flags: Integer);
var
  shellinfo: TSHFileOpStructA;
begin
  with shellinfo do
  begin
    wnd   := Application.Handle;
    wFunc := Flags;
    pFrom := PChar(fromFile);
    pTo   := PChar(toFile);
  end;
  SHFileOperation(shellinfo);
 end;

procedure TfrmSetup.Button3Click(Sender: TObject);
begin
 ShellFileOperation('a:\IWO.xls''c:\Test\xy \'#0, FO_COPY);

end;


Wie kann ich diesen Vorgang im Hintergrund ausführen, also ohne Info-Fenster?

Danke für jede Hilfe

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 20.09.04 20:26 
Aadelbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 90

XP, WIN 2000, NT 4.0
D6 Enterprise
BeitragVerfasst: Mo 20.09.04 21:11 
Danke für die Antwort,

aber so blöd das klingen mag, ich komm damit nicht zurecht. Ist doch VBScript.

Wie wird das angepaßt?

Gruß

Aadelbert
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 21.09.04 15:16 
Die Seite besteht nicht nur aus dem ersten Link. :roll:
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Di 21.09.04 15:20 
ShellFileOperation('a:\IWO.xls', 'c:\Test\xy \'#0, FO_COPY + FOF_SILENT + FOF_NOERRORUI + FOF_NOCONFIRMATION);
Gast
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 21.09.04 15:24 
Mensch Micha, gib doch den direkten Link ;)

msdn.microsoft.com/l...io/base/copyfile.asp

Moderiert von user profile iconChristian S.: URL-Tags hinzugefügt