Autor Beitrag
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Mo 12.12.05 18:26 
Hallo Leute,
Ich habe ein programm, das sich beim öffnen von alleine auf
den Desktop kopieren soll.
aber das klappt nicht.
Hier der Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
 function GetUser: String;
  var
    Buffer: Array[0..MAX_COMPUTERNAME_LENGTH +1] of Char;
    Size: DWord;
  begin
    Size := Pred(SizeOf(Buffer));
    Windows.GetUserName(Buffer, Size);
    Result := StrPas(Buffer);
  end;


procedure TForm1.FormCreate(Sender: TObject);
begin

If not fileexists('C:\Dokumente und Einstellungen\'+Getuser+'\Desktop\programm.exe') then begin
CopyFile(PChar('C:\mailmaster.exe'), PChar('C:\Dokumente und Einstellungen\'+GetUser+'\Desktop\programm.exe'), false);
end;

end;
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 12.12.05 19:21 
Moin!

user profile iconFighter#1 hat folgendes geschrieben:
aber das klappt nicht.

WAS klappt nicht, was passiert denn oder passiert eben nicht, Fehlermeldung... :gruebel: meine Glaskugel ist noch beschlagen, bin grad erst reingekommen... :wink:

cu
Narses