Autor Beitrag
ppl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53



BeitragVerfasst: So 25.05.08 18:40 
Guten Abend,

heute habe mich mit ein neues project vorgenommen undzwar will ich lauter buttons haben, mit meinen meistgenutzten anwendungen drauf habe die ich benötige, nun gut, ich habe einen code gedfunden womit ich exe dateien öffnen kann,

nur wie mache ich das mit ordnern die ich öffnen will?

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
 
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, shellAPI, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Application.Handle, Pchar('open'), Pchar('D:\Download´s\Steam Account Manager.exe'), nilnil, SW_SHOWNORMAL);
end;

end.



ich habe mir gedacht das das der gleiche code sein wird , also
"ShellExecute(Application.Handle, Pchar('open'), Pchar('D:\Download´s\'), nil, nil, SW_SHOWNORMAL);"

nur bei users muss ich anstatt, ", StdCtrls;" was anderes hinmachen?
kann das sein?


Moderiert von user profile iconNarses: Topic aus VCL (Visual Component Library) verschoben am So 25.05.2008 um 22:52
Silas
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 478

Windows XP Home
Delphi 2005, RAD Studio 2007, MASM32, FASM, SharpDevelop 3.0
BeitragVerfasst: So 25.05.08 18:47 
Moin,

Ordner kannst du einfach mit ShellExecute(Handle, 'explore''C:\Pfad'nilnil, SW_SHOWNORMAL); öffnen.

Edit: Den PChar-Cast kannst du bei Konstanten weglassen.

_________________
Religionskriege sind nur Streitigkeiten darüber, wer den cooleren imaginären Freund hat ;-)
ppl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53



BeitragVerfasst: So 25.05.08 18:53 
vielen dank!

mfg
ppl