0
實際上,我有一個自定義應用程序,並希望將某些值傳遞給該.exe,之後它應該在某些事件前執行。它應該自動生成文件。使用delphi應用程序傳遞參數打開外部應用程序
unit fExecuteExe;
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
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
filename: String;
begin
filename := 'C:\Testsrc\MojaveD5\Tools\AliasToDataview\Alias2DV.exe';
ShellExecute(handle,'open',PChar(filename), '','',SW_SHOWNORMAL);
end;
end.
Delphi窗體
object Form1: TForm1
Left = 179
Top = 116
Width = 495
Height = 294
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 176
Top = 96
Width = 113
Height = 25
Caption = 'Run Alias2Dataview'
TabOrder = 0
OnClick = Button1Click
end
end
有什麼辦法,我可以打開這個應用程序(下文提供的圖像),並通過一些值到它的文本框,然後點擊它的按鈕?
此應用程序不支持命令行。不幸的是,我只有它的.exe,而不是代碼。
使用UI自動化將其自動化。 –