Jump to content

Responsive (Part I), on a demo example "Clientside Alignment - Layout Border"


Sherzod

Recommended Posts

  • 1 year later...
On 3/29/2023 at 8:39 AM, Phxtecno said:

I have seen that when you compile and run the application in delphi, the browser start automatically with your app...

while I usually go in the browser and have to refresh the page with localhost address.

Use ShellExecute on program principal.

I will send you more details tomorrow...

  • Like 1
Link to comment
Share on other sites

On 3/29/2023 at 8:39 AM, Phxtecno said:

I have seen that when you compile and run the application in delphi, the browser start automatically with your app...

while I usually go in the browser and have to refresh the page with localhost address.

 

I found this on forum :

program Project1;

uses
  windows,
  ShellAPI,
  SysUtils,
  Forms,

  ServerModule in 'ServerModule.pas' {UniServerModule: TUniGUIServerModule},
  MainModule in 'MainModule.pas' {UniMainModule: TUniGUIMainModule},
  Mainm in 'Mainm.pas' {MainmForm: TUnimForm};

{$R *.res}




BEGIN
//*************************************
  ReportMemoryLeaksOnShutdown := True;
//*************************************

  Application.Initialize;
  TUniServerModule.Create(Application);

 // Fast run
  if (IsDebuggerPresent)  // in Desktop mode only  (Not IIS, not as Service, not HyperServer)
  and (extractFileExt(GetModuleName(Hinstance))='.exe')
  then
  begin
   shellExecute(Application.Handle,
   // Desktop             
     PChar('Open'),
      PChar('Http://127.0.0.1:' + intToStr(ServerModule.UniServerModule.Port)),Nil,Nil,SW_Show);

   // Mobile
   //  PChar('Http://127.0.0.1:' + intToStr(ServerModule.UniServerModule.Port)+'/m'),Nil,Nil,SW_Show);
  end;
  Application.Run;
End.

 

  • Like 2
Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...