You are on page 1of 1

unit main; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons,shellapi; type

TForm1 = class(TForm) Edit1: TEdit; BitBtn1: TBitBtn; Label1: TLabel; procedure BitBtn1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.BitBtn1Click(Sender: TObject); begin ShellExecute(Handle,'open',PChar(Edit1.Text),'','',SW_SHOWNORMAL) end; end. procedure TForm1.Button3Click(Sender: TObject); begin Open1.Filter := 'All Files *.*|*.*'; if Open1.Execute then label2.Caption := open1.FileName else messagedlg('No file selected', mtError, [mbOK], 0); end;

You might also like