Lazarus

Programming => General => Topic started by: young_nandy on December 03, 2018, 06:59:46 am

Title: Application Title ??
Post by: young_nandy on December 03, 2018, 06:59:46 am
How do I make the application title always installed on the taskbar even though the main form is hide?
Title: Re: Application Title ??
Post by: sash on December 03, 2018, 10:15:51 am
Since "taskbar" aka "window buttons panel" (for most Desktop Environments) represents visible windows on desktop - you can't.
Title: Re: Application Title ??
Post by: balazsszekely on December 03, 2018, 11:45:46 am
MainForm.Visible <> MainForm visible to the user. Set MainForm.Left to 10000 and you're good to go.
Title: Re: Application Title ??
Post by: young_nandy on December 03, 2018, 02:39:32 pm
MainForm.Visible <> MainForm visible to the user. Set MainForm.Left to 10000 and you're good to go.

I do not understand what it means. but I try
Application.Mainform.left: = 10000;

1.on event "onshow" at form2 (not my mainform) ==> result (application.title) does not come out on the taskbar

2. in the project source ==> the result is an error.

Can you explain in more detail?
Title: Re: Application Title ??
Post by: young_nandy on December 03, 2018, 02:45:52 pm
Since "taskbar" aka "window buttons panel" (for most Desktop Environments) represents visible windows on desktop - you can't.

since I used Delphi 7, the application title problem never happened like this on Windows XP or Windows 7.

Then when I tried this Lazarus, I found a problem like this. I tried on Embarcadero 10.2 Tokyo also has a problem like this.

Is there a way to overcome this problem? Please also note that I tried Lazarus on Windows 10.
Title: Re: Application Title ??
Post by: bobix on December 03, 2018, 03:42:11 pm
Quote
I do not understand what it means. but I try
Application.Mainform.left: = 10000;
Its Mainform.left: = 10000; without Application.
Title: Re: Application Title ??
Post by: creaothceann on December 03, 2018, 06:32:22 pm
How do I make the application title always installed on the taskbar even though the main form is hide?
What OS?

MainForm.Visible <> MainForm visible to the user. Set MainForm.Left to 10000 and you're good to go.
How does that work with multimonitor configurations?

https://youtu.be/Bteq-6D1srs
https://youtu.be/0jSxvjT6Ec0
https://youtu.be/NMvC4zikMuo
https://youtu.be/uGSfliYZO-Q
https://youtu.be/Toft6fMvByA
Title: Re: Application Title ??
Post by: ASerge on December 03, 2018, 07:05:55 pm
since I used Delphi 7, the application title problem never happened like this on Windows XP or Windows 7.
In Delphi 7, the application window (on the taskbar) is also hidden when the main form is hidden.
It's not very clear to me why this behavior is necessary, and how to manage a hidden application afterwards, but you can use an empty one instead of the main window with BorderStyle = bsNone; and Height = 0; and show/hide another window.
Title: Re: Application Title ??
Post by: sash on December 03, 2018, 09:46:42 pm
In Delphi 7, the application window (on the taskbar) is also hidden when the main form is hidden.

As I said above, window button on a taskbar is always hidden when corresponding app's window is hidden. It is a functionality of Desktop Environment, not application.

And yes, it is quite unclear, why someone needs to hide a window, but keep taskbar button visible. Looks more like a minimize behavior.
More often they need an opposite action: hide button from taskbar (optionally move icon to the tray) but keep window visible.
Title: Re: Application Title ??
Post by: lucamar on December 03, 2018, 09:56:54 pm
Looks more like a minimize behavior.

Indeed! And that's one possible way to implement it: Minimize the application and intercept/ignore any request to restore it. Doesn't sound so difficult, does it?
Title: Re: Application Title ??
Post by: dbannon on December 03, 2018, 11:46:25 pm

As I said above, window button on a taskbar is always hidden when corresponding app's window is hidden. It is a functionality of Desktop Environment, not application.

And yes, it is quite unclear, why someone needs to hide a window, but keep taskbar button visible. Looks more like a minimize behavior.

Indeed, I wonder if what you (young_nandy) really want is the TrayIcon ?  Sounds like you are using Windows, it works fine on Windows. Maybe you should have a look at how it works....

Davo
Title: Re: Application Title ??
Post by: young_nandy on December 04, 2018, 06:47:30 am
Quote
I do not understand what it means. but I try
Application.Mainform.left: = 10000;
Its Mainform.left: = 10000; without Application.

Sorry, the correct one is application.mainform.left

I will explain later below. I already understood the meaning of this trick.
Title: Re: Application Title ??
Post by: young_nandy on December 04, 2018, 06:52:16 am
since I used Delphi 7, the application title problem never happened like this on Windows XP or Windows 7.
In Delphi 7, the application window (on the taskbar) is also hidden when the main form is hidden.
It's not very clear to me why this behavior is necessary, and how to manage a hidden application afterwards, but you can use an empty one instead of the main window with BorderStyle = bsNone; and Height = 0; and show/hide another window.

please see the trick from "GetMem".

I will explain below. what I need is when form1 moves to form2, application title still exits on the taskbar. I use the following script

form2.show;
form1.hide;
Title: Re: Application Title ??
Post by: young_nandy on December 04, 2018, 06:55:09 am
Looks more like a minimize behavior.

Indeed! And that's one possible way to implement it: Minimize the application and intercept/ignore any request to restore it. Doesn't sound so difficult, does it?

Thank you for the idea, but I prefer the trick from "GetMem". mainform is not visible
Title: Re: Application Title ??
Post by: young_nandy on December 04, 2018, 06:57:34 am

As I said above, window button on a taskbar is always hidden when corresponding app's window is hidden. It is a functionality of Desktop Environment, not application.

And yes, it is quite unclear, why someone needs to hide a window, but keep taskbar button visible. Looks more like a minimize behavior.

Indeed, I wonder if what you (young_nandy) really want is the TrayIcon ?  Sounds like you are using Windows, it works fine on Windows. Maybe you should have a look at how it works....

Davo

I know about this trick. but using icontray. the application doesn't look like it's running.
Title: Re: Application Title ??
Post by: young_nandy on December 04, 2018, 07:02:56 am
MainForm.Visible <> MainForm visible to the user. Set MainForm.Left to 10000 and you're good to go.

Thank you for this trick. I like.

this morning I tried your point.

form1.hide; (mainform) is replaced with application.mainform.left: = 10000; or form1.left: = 10000;

so form1 still looks active on a program basis, but it is not visible to us because the location is hidden.

actually i like normal like using delphi 7 in windows xp or windows 7. if there is no other way maybe i will use this trick. thx Tricky Master GetMem :)
TinyPortal © 2005-2018