Jump to content

How to change Hint of uniServer tray icon.


irigsoft

Recommended Posts

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.

 

Link to comment
Share on other sites

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;

?

  • Like 1
Link to comment
Share on other sites

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.

  • Upvote 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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.

 

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 by Fred Montier
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.
 

LIV-1-cap-13.png

Edited by Fred Montier
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...