SergioFeitoza Posted August 11, 2019 Share Posted August 11, 2019 When I have my code opened in Delphi + Unigui and I do F9 to run it I need just after entering the browser and typing http://localhost: 8077 to see the screen in the browser. What is the way to do this automatically with a Delphi line of code? If this possible to do where is the point to include the code ? Quote Link to comment Share on other sites More sharing options...
d.bernaert Posted August 11, 2019 Share Posted August 11, 2019 Hi, see code below for ServerModule to start browser automatically while debugging: private protected procedure FirstInit; override; implementation procedure ExploreWeb(page:PChar); begin ShellExecute(0, 'open', page, nil, nil, 1); end; procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); begin if ExtractFileExt(ExtractFileName(ParamStr(0)))='.exe' then ExploreWeb(pchar('http://localhost:'+ IntToStr(port))); end; Quote Link to comment Share on other sites More sharing options...
SergioFeitoza Posted August 11, 2019 Author Share Posted August 11, 2019 Thank you very much. It is working well now using the concept you show !! 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.