Executar aplicativo em um StringGrid?
Olá, sou novo aqui no forun e em delphi, estou tentando fazer um aplicativo para executar outro externo.
Tipo tenho uma StrinGrid e quero executar um aplicativo q adicionei em uma cell com um opdialog...
não tenho idei de como fazer isso se alguem ai pode me ajudar agradeço.!
Tipo tenho uma StrinGrid e quero executar um aplicativo q adicionei em uma cell com um opdialog...
procedure TForm1.FormCreate(Sender: TObject);
begin
with StringGrid1 do begin
ColWidths[0]:= 25;
ColWidths[1]:= 280;
Cells[1, 0]:= 'Aplicativo';
end;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
StringGrid1.Cells[1, 1]:= OpenDialog1.FileName;
begin
WinExec(StringGrid1.Rows[1] ,SW_SHOWNORMAL)
end;
end;
não tenho idei de como fazer isso se alguem ai pode me ajudar agradeço.!
Mysql_2013
Curtidas 0
Respostas
Marcos Rocha
15/10/2012
Seu código não está errado, porém WinExec espera um PChar no seu primeiro parâmetro, então você pode fazer:
WinExec(PChar(StringGrid1.Cells[1,1], SW_SHOWNORMAL))
GOSTEI 0
Marcos Rocha
15/10/2012
Melhor:
WinExec(PChar(StringGrid1.Cells[1,1]), SW_SHOWNORMAL);
GOSTEI 0