NelsonFS Posted October 6, 2013 Share Posted October 6, 2013 Hi, Everytime we recompile application, you must close in traybar and refresh browser page. The tip will automatically close application and start a new page in default browser. In Project, Options, Build Events,Pre-Build, write command: taskkill /F /IM program.exe /T procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);begin if self.StandAloneServer then //if you need this, if not, remove it. ExploreWeb('http://localhost:8077'); //auto start browserend;procedure ExploreWeb(page:PChar);var Returnvalue: integer;begin ReturnValue := ShellExecute(0, 'open', page, nil, nil,SW_SHOWNORMAL); if ReturnValue <= 32 then begin case Returnvalue of 0 : MessageBox(0,'Error: Out of memory','Error',0); ERROR_FILE_NOT_FOUND: MessageBox(0,'Error: File not found','Error',0); ERROR_PATH_NOT_FOUND: MessageBox(0,'Error: Directory not found','Error',0); ERROR_BAD_FORMAT : MessageBox(0,'Error: Wrong format in EXE','Error',0); else MessageBox(0,PChar('Error Nr: '+IntToStr(Returnvalue)+' inShellExecute'),'Error',0) end; end;end; procedure TFMainForm.UniFormShow(Sender: TObject);begin //show frame/form to login only if we are not debuging... if (DebugHook = 0) then begin FLogin.ShowModal; ... end; end; 1 4 Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted January 25, 2017 Share Posted January 25, 2017 Saves me a lot of time from now on.... thanks a lot ! Quote Link to comment Share on other sites More sharing options...
mehmet07 Posted January 26, 2017 Share Posted January 26, 2017 thanks NelsonFS Quote Link to comment Share on other sites More sharing options...
quanliking Posted February 4, 2017 Share Posted February 4, 2017 It is time-saving, thanks NelsonFS. Quote Link to comment Share on other sites More sharing options...
rasaliad Posted February 4, 2017 Share Posted February 4, 2017 Hi NelsonFS Yes it is fantastic!!!!! Quote Link to comment Share on other sites More sharing options...
chinacodegear@hotmail.com Posted October 2, 2017 Share Posted October 2, 2017 very good.thanks a lot. Quote Link to comment Share on other sites More sharing options...
chinacodegear@hotmail.com Posted December 11, 2017 Share Posted December 11, 2017 my project name is one8077 ,the exe is one8077.exe. Why show "[Exec Error] The command "taskkill /F /IM one8077.exe /T" exited with code 128."? Quote Link to comment Share on other sites More sharing options...
rasaliad Posted December 12, 2017 Share Posted December 12, 2017 my project name is one8077 ,the exe is one8077.exe. Why show "[Exec Error] The command "taskkill /F /IM one8077.exe /T" exited with code 128."? Hi En Project Options -> Build Events -> Pre-Build Events -> Cancel on Error = False. 1 Quote Link to comment Share on other sites More sharing options...
Beginner Posted January 8, 2018 Share Posted January 8, 2018 Don't work taskkill What I'm doing wrong? Rad 10.2.2 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 9, 2018 Share Posted January 9, 2018 Hi, Which edition and build are you using? Best regards, Quote Link to comment Share on other sites More sharing options...
Beginner Posted January 9, 2018 Share Posted January 9, 2018 Trial Edition But another exe not unigui app i can't kill before compile Sorry on Delphi Xe 3 Windows 7 work fine But Delphi Rad Tokiyo 10.2.2 OS Windows 10 can't kill task by RAD 10.2.2 pre build command if this command run cmd .exe "taskkill /F /IM test.exe /T" Tasks killed all Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted January 10, 2018 Share Posted January 10, 2018 Project options -> Build evebts -> Pre-Builds events -> Commands = call C:\xxxxx\uniGUI.cmd $(OUTPUTFILENAME) "uniGUI.cmd" text file in: start taskkill /F /IM firefox.exe /T start taskkill /F /IM %1 /T Quote Link to comment Share on other sites More sharing options...
Beginner Posted January 12, 2018 Share Posted January 12, 2018 I found what problem before run I need change something like move button or change caption like this after that compilled and run task will kill.. In RAD XE3 work everytime when pushing RUN without changing something but RAD Tokiyo need change something before run second time Quote Link to comment Share on other sites More sharing options...
Servant5166 Posted February 11, 2018 Share Posted February 11, 2018 Hi En Project Options -> Build Events -> Pre-Build Events -> Cancel on Error = False. Worked for me! Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.