1、设置。
注意:全部。
taskkill /f /im $(OUTPUTFILENAME) 2>1 || exit /B 0
自动运行chrome打开unigui网页
unit ServerModule;
interface
uses
Winapi.ShellAPI, vcl.Dialogs;
type
TUniServerModule = class(TUniGUIServerModule)
procedure UniGUIServerModuleCreate(Sender: TObject);
private
{ Private declarations }
protected
procedure FirstInit; override;
public
{ Public declarations }
end;
function UniServerModule: TUniServerModule;
implementation
{$R *.dfm}
uses
UniGUIVars;
procedure ExploreWeb(page: PChar);
var
Returnvalue: Integer;
begin
Returnvalue := ShellExecute(0, 'open', 'chrome.exe', page, nil, 1);
if Returnvalue <= 32 then
begin
case Returnvalue of
0:
ShowMessage('错误,内存不足!');
2:
ShowMessage('错误,文件名错误!');
3:
ShowMessage('错误,路径名错误!');
11:
ShowMessage('错误,EXE 文件无效!');
else
ShowMessage(PChar('错误代码:' + IntToStr(Returnvalue) + ',请检查错误。'));
end;
end;
end;
procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
ExploreWeb('http://127.0.0.1:8077');
end;
end.