EXECUTAR PROGRAMA QUE NÃO SEJA COM EXTENSÃO ´.EXE´!!!!!!!!!!
bom dia a todos... gostaria de saber um jeito para que eu possa executar um programa chamado inica.cmd!
Raonepn
Curtidas 0
Respostas
Rafael Roni
21/02/2003
Executar qualquer programa desde que o programa que execute o esteja instalado. exemplo (*.AVI , *.mpg , jpg , lnk , cpl .....)
Coloque um botão simples e coloque esse codigo e verá
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,ShellApi;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
procedure execute(const aAdress: String);{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure Tform1.execute(const aAdress: String);
var
buffer: String;
begin
buffer := aAdress;
ShellExecute(Application.Handle, nil, PChar(buffer), nil, nil, SW_SHOWNORMAL);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
execute(´d:\1.mpg´);
end;
end.
Coloque um botão simples e coloque esse codigo e verá
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,ShellApi;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
procedure execute(const aAdress: String);{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure Tform1.execute(const aAdress: String);
var
buffer: String;
begin
buffer := aAdress;
ShellExecute(Application.Handle, nil, PChar(buffer), nil, nil, SW_SHOWNORMAL);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
execute(´d:\1.mpg´);
end;
end.
GOSTEI 0