irigsoft Posted August 10, 2021 Share Posted August 10, 2021 Hello, It is possible to change Hint on uniServer tray icon. I use couple StandAlone applications and want to know what port is usen on Every, for quick look i try to save port number in uniServerModule.Title, but this dont change Hint of tray icon of application. I want to see what port is used, when I go and Show Hint on tray icon of unigui Application. How to make what I want. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 10, 2021 Share Posted August 10, 2021 30 minutes ago, irigsoft said: It is possible to change Hint on uniServer tray icon. I use couple StandAlone applications and want to know what port is usen on Every, for quick look i try to save port number in uniServerModule.Title, but this dont change Hint of tray icon of application. I want to see what port is used, when I go and Show Hint on tray icon of unigui Application. Hello, procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); begin Title := Title + ' Used port: ' + Port.ToString end; ? 1 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 6 minutes ago, Sherzod said: Hello, procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); begin Title := Title + ' Used port: ' + Port.ToString end; ? Yes, Thank You! I use OnCreate and not work, using UniGUIServerModuleBeforeInit is OK. 1 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 4 minutes ago, Sherzod said: Are you assigning a value to the Title somewhere else? My wrong I use OnCreate, thank You. 1 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 31 minutes ago, irigsoft said: My wrong I use OnCreate, thank You. @Sherzod, Change Title on StandAlone Application, change and Browser's tab Caption. It is another way to change Hint or to set Browser tab Caption ? I try to add TrayIcon, but then I have 2 icons. It is possible when is used TrayIcon1 on uniServerModule, then tray of unigui to hide. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 10, 2021 Share Posted August 10, 2021 @irigsoft You can use this trick: unit ServerModule; interface uses Classes, SysUtils, uniGUIServer, uniGUIMainModule, uniGUIApplication, uIdCustomHTTPServer, uniGUITypes; type TUniServerModule = class(TUniGUIServerModule) procedure UniGUIServerModuleBeforeInit(Sender: TObject); procedure UniGUIServerModuleCreate(Sender: TObject); private { Private declarations } FBrowserCaption: string; protected procedure FirstInit; override; public { Public declarations } end; function UniServerModule: TUniServerModule; implementation {$R *.dfm} uses UniGUIVars; function UniServerModule: TUniServerModule; begin Result:=TUniServerModule(UniGUIServerInstance); end; procedure TUniServerModule.FirstInit; begin InitServerModule(Self); end; procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); begin FBrowserCaption := Title; Title := Title + ' Used port: ' + Port.ToString end; procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin Title := FBrowserCaption end; initialization RegisterServerModuleClass(TUniServerModule); end. 1 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 4 minutes ago, Sherzod said: @irigsoft You can use this trick: unit ServerModule; interface uses Classes, SysUtils, uniGUIServer, uniGUIMainModule, uniGUIApplication, uIdCustomHTTPServer, uniGUITypes; type TUniServerModule = class(TUniGUIServerModule) procedure UniGUIServerModuleBeforeInit(Sender: TObject); procedure UniGUIServerModuleCreate(Sender: TObject); private { Private declarations } FBrowserCaption: string; protected procedure FirstInit; override; public { Public declarations } end; function UniServerModule: TUniServerModule; implementation {$R *.dfm} uses UniGUIVars; function UniServerModule: TUniServerModule; begin Result:=TUniServerModule(UniGUIServerInstance); end; procedure TUniServerModule.FirstInit; begin InitServerModule(Self); end; procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); begin FBrowserCaption := Title; Title := Title + ' Used port: ' + Port.ToString end; procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin Title := FBrowserCaption end; initialization RegisterServerModuleClass(TUniServerModule); end. Super, all is OK. 1 Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted August 10, 2021 Share Posted August 10, 2021 (edited) At almost the same subject, what is right way to terminate a StandAlone instance similar to Shutdown option at pop-up menu ? That is the third time I asked this question. UniServerModule.TerminateStandAlone; Exit2Click... all tried ! Edited August 10, 2021 by Fred Montier Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted August 10, 2021 Share Posted August 10, 2021 Is it really just UniServerModule.Terminated := true; ? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 26 minutes ago, Fred Montier said: At almost the same subject, what is right way to terminate a StandAlone instance similar to Shutdown option at pop-up menu ? That is the third time I asked this question. UniServerModule.TerminateStandAlone; Exit2Click... all tried ! Hello, As temporally solution I have bat file to restart application on Some Errors or in exact Time of the day. I Use this when I want to restart StandAlone. I Use unitimer and in 21:00 every day I call from Server with shellexecute this File: Restart_application.bat Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 15 minutes ago, Fred Montier said: Is it really just UniServerModule.Terminated := true; ? I try this on MainForm onBtnClick and realy close Application. Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted August 10, 2021 Share Posted August 10, 2021 I see.. and you gave me a nice idea: scheduled restarts. Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted August 10, 2021 Share Posted August 10, 2021 (edited) Yes... I know that. I just want the RIGHT way similar to pop-up shutdown at standalone. Need to be sure about that because the procedure and events at ServerModule DFM are not in source code. At least , I haven't found. Appears to take a little more time than that proper option that is associated to Exit2Click at the DFM. Edited August 10, 2021 by Fred Montier Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 3 minutes ago, Fred Montier said: scheduled restarts But You must to know. Some times is not work. may server didn't restart, may be problem is in consumed memmory or somthing else but didn't restart. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 @Fred Montier, can I ask You , why You want to restart Your Application ? Is there a need for that ? Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted August 10, 2021 Share Posted August 10, 2021 Imagine deploy a standalone with a lot of more option and commands to another app (e.g. Whatsapp via Chormium). The only thing missing was the proper way to terminate the standalone. Now I can open in different browser, open log, explorer folder in a more easy way. Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted August 10, 2021 Share Posted August 10, 2021 14 minutes ago, irigsoft said: @Fred Montier, can I ask You , why You want to restart Your Application ? Is there a need for that ? Since uniGUI standalone and Whatsapp server are two separated apps, start one, authenticate and use it integrated to the main standalone. And replicate to more users and automate a lot of thing using the same server with more Whatsapp instances in the same machine. And a lot of other stuff... Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 10, 2021 Author Share Posted August 10, 2021 18 minutes ago, Fred Montier said: Since uniGUI standalone and Whatsapp server are two separated apps, start one, authenticate and use it integrated to the main standalone. And replicate to more users and automate a lot of thing using the same server with more Whatsapp instances in the same machine. And a lot of other stuff... Thank You, I understand. 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.