Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-06

how to change an application title on the taskbar

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Roberto Padovani

Hi List,

does anyone know how to change the application title on the windows xp taskbar? Specifically, while my application is crunching data, I would like to minimize it and then display the percentage of the calculations on the taskbar.
At the end, the application should restore itself and be brought to front.

Thanks a lot,

Roberto

Reply by email

Graeme Geldenhuys
to Paul Ishenin
Paul Ishenin wrote
Application.Title := 'New title'?

If you want the MainForm title and the Taskbar button title the same, that should work. In windows you can actually have different titles for each of those. I've done it before, but I can't remember off the top of my head what Win32 API that was.

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Roberto Padovani
to Paul Ishenin: Application.Title := 'New title'? Paul Ishenin.

2009/6/26 Paul Ishenin :

Show quoted text 8 lines
Roberto Padovani wrote: > > Hi List, > > does anyone know how to change the application title on the windows xp > taskbar? Application.Title := 'New title'?

Obviously, I am writing to the list just because that does not work. Any change to Application.Title in the form unit or in the .lpr main program after Application.Run is not propagated to the taskbar.

Any hint?

R#

Reply by email

Vincent Snijders
to Roberto Padovani
Roberto Padovani wrote 12 lines
2009/6/26 Paul Ishenin : > Roberto Padovani wrote: >> Hi List, >> >> does anyone know how to change the application title on the windows xp >> taskbar? > Application.Title := 'New title'? Obviously, I am writing to the list just because that does not work. Any change to Application.Title in the form unit or in the .lpr main program after Application.Run is not propagated to the taskbar.
This works on windows (form with on button):
procedure TForm1.Button1Click(Sender: TObject);
begin
   Application.Title:='New Name';
end;

Maybe you don't give windows time to make that change, because you are processing. (one long event handler without processing message)

Vincent

Reply by email

Roberto Padovani
to Graeme Geldenhuys: If you want the MainForm title and the Taskbar button title the same, that should work.…

2009/6/26 Graeme Geldenhuys :

Show quoted text 14 lines
Paul Ishenin wrote: > > Application.Title := 'New title'? If you want the MainForm title and the Taskbar button title the same, that should work. In windows you can actually have different titles for each of those. I've done it before, but I can't remember off the top of my head what Win32 API that was. Regards, ?- Graeme -

Graeme, if you could find the piece of code, you'd do me a favour! Or maybe someone can point me to some piece of information online... As far as I can see, any change to Application.Title after the Application.Run in the main program is not propagated to the task bar name nor to the form caption, which has to be changed through its property

Thanks!

R#

Reply by email

Roberto Padovani
to Vincent Snijders: This works on windows (form with on button): procedure TForm1.Button1Click(Sender:…

2009/6/26 Vincent Snijders :

Show quoted text 13 lines
This works on windows (form with on button): procedure TForm1.Button1Click(Sender: TObject); begin ?Application.Title:='New Name'; end; Maybe you don't give windows time to make that change, because you are processing. (one long event handler without processing message) Vincent

Right, I tried it in one of the buttons I have and it works: it changes the taskbar title, but not the form caption (which I can change through the property).
But I cannot see it work during the calculations, even if I call the Application.ProcessMessages that was already there to update a progress bar.
However, it must be an update problem, because the ShowMessage dialogs that appear between the steps of the calculations are use the correct Application.Title.

R#

Reply by email

Roberto Padovani
to Roberto Padovani

2009/6/26 Roberto Padovani :

Show quoted text 27 lines
2009/6/26 Vincent Snijders : > > This works on windows (form with on button): > procedure TForm1.Button1Click(Sender: TObject); > begin > ?Application.Title:='New Name'; > end; > > Maybe you don't give windows time to make that change, because you are > processing. (one long event handler without processing message) > > Vincent > > Right, I tried it in one of the buttons I have and it works: it changes the taskbar title, but not the form caption (which I can change through the property). But I cannot see it work during the calculations, even if I call the Application.ProcessMessages that was already there to update a progress bar. However, it must be an update problem, because the ShowMessage dialogs that appear between the steps of the calculations are use the correct Application.Title. R#

The taskbar is update much less frequently than the other graphics; does anyone know if I can send a message to windows to have it refreshed every once in a while ?

Thanks,

Roberto

Reply by email