Autor Beitrag
M.A
Hält's aus hier
Beiträge: 2

Win 98, Win XP
Delphi 3 Prof.
BeitragVerfasst: Mi 28.09.05 14:15 
Ich würde gerne in eine Delphi 3 Anwendung einen Button einbauen, der bei click den Windows Explorer bzw. den Arbeitsplatz öffnet.
Gibt es so etwas überhaut?
mfg m.a


Moderiert von user profile iconTino: Topic aus VCL (Visual Component Library) verschoben am Do 29.09.2005 um 10:01
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mi 28.09.05 14:22 
Hallo!

Du brauchst wahrscheinlich nur ShellExecute aufrufen und dadurch die Explorer.exe öffnen. Mehr nicht. ;-)

Lg Martin
Raffo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 300



BeitragVerfasst: Mi 28.09.05 17:42 
Direktes Code Beispiel:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
uses ShellApi;

procedure TForm1.Button1Click(Sender: TOjbect);
var filename,params:string;
begin

filename:='explorer.exe';
params:='/e,c:\'; //ruft C:\ -ROOT mit Ornderbaum auf

ShellExecute(Application.MainForm.Handle, nil, pchar(filename), pchar(Params), '',sw_shownormal);
end;


P.S. guck Dir evt. die genaue Hilfe zu ShellExecute an per F1 in Delphi
MKX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 95

Win XP, Ubuntu Linux 7.02
Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Mi 28.09.05 18:37 
Ich glaube,es geht auch so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if ShellExecute(Application.Handle,
                 'open',
                 PChar('x:\Test\TestXY'),
                 Nil, Nil, SW_NORMAL) <= 32 then
    ShowMessage('Es ist ein Fehler aufgetreten');
M.A Threadstarter
Hält's aus hier
Beiträge: 2

Win 98, Win XP
Delphi 3 Prof.
BeitragVerfasst: Do 29.09.05 18:15 
Hallo
Danke für eure Hilfe aber ich check noch nicht ganz wie ich das jetzt machen muss, wenn ich den Button in mein Formular eingefügt hab (oder kann ich für des überhaupt nen normalen Button nehmen?). Währe nett wenn mir des jemand mal ganz genau erklären könnt. Die Delphi Hilfe bringt mich nämlich in de, fall überhaupt nicht weiter.
Danke
mfg M.A
MKX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 95

Win XP, Ubuntu Linux 7.02
Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Do 29.09.05 18:39 
Einen Button ins Formular setzen und doppelklicken. Dann einen der Codes kopieren und in das Feld einfügen. Das rot unterschlängelte erstmal nicht beachten und ganz oben im Quelltext bei uses ShellAPI hinzufügen! :think: