EXECUTAR PROGRAMA QUE NÃO SEJA COM EXTENSÃO ´.EXE´!!!!!!!!!!
21/02/2003
0
bom dia a todos... gostaria de saber um jeito para que eu possa executar um programa chamado inica.cmd!
Raonepn
Curtir tópico
+ 0
Responder
Posts
21/02/2003
Rafael Roni
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.
Responder
Clique aqui para fazer login e interagir na Comunidade :)