Board index » cppbuilder » How to set icon and caption of windows taskbar button?

How to set icon and caption of windows taskbar button?


2005-05-27 09:45:08 PM
cppbuilder32
Earlier today I asked in the VCL newsgroup how to get a subform to
display a windows taskbar button. I was very quickly given the info I
needed.
Now I'd like to gove the taskbar button its own icon and caption -
possibly different from the ones shown by the form. How do I do this?
--
Simon Elliott www.ctsn.co.uk
 
 

Re:How to set icon and caption of windows taskbar button?

"Simon Elliott" <Simon at ctsn.co.uk>wrote in message
Quote
Now I'd like to gove the taskbar button its own icon and
caption - possibly different from the ones shown by the
form. How do I do this?
The Caption of the Taskbar Button is always the same as the Form's Caption,
and the Icon is the same as the Form's Icon. You cannot specify a different
Caption and Icon that are just for the button alone. They have to be
applied to the Form as well.
Gambit
 

Re:How to set icon and caption of windows taskbar button?

Hi,
IMHO there may be a difference between Form.Caption and Application.Title,
which shows when the main form is minimized. The icon is unique.
Regards,
Heiner
 

{smallsort}

Re:How to set icon and caption of windows taskbar button?

Hi,
just run the template, which is presented on start up of e.g. Delphi 5.
Your form has the caption Form1. The button on the taskbar is labeled
Project1.
Regards,
Heiner
 

Re:How to set icon and caption of windows taskbar button?

Hi,
in the IDE menu Project-Options-Application you can set a title and a symbol
(icon).
This icon is shown in the explorer.
Put some tImage-s in your form with visible=false and load your icons into
their picture-s
At run time you can change application.title and
application.icon.assign(image1.picture.icon).
These will be shown on the taskbar button. This icon will also be shown on
the form.
But after that at run time you can form.icon.assign(image2.picture.icon) for
the form
different from the taskbar button.
Regards
Heiner
 

Re:How to set icon and caption of windows taskbar button?

On 27/05/2005, Remy Lebeau (TeamB) wrote:
Quote
>Now I'd like to gove the taskbar button its own icon and
>caption - possibly different from the ones shown by the
>form. How do I do this?
The Caption of the Taskbar Button is always the same as the Form's
Caption, and the Icon is the same as the Form's Icon. You cannot
specify a different Caption and Icon that are just for the button
alone. They have to be applied to the Form as well.
OK. I vaguely recalled from the olden days of Petzold that there was a
way of drawing on the taskbar button's canvas, but it was so long ago
that my memory could be a bit flaky...
--
Simon Elliott www.ctsn.co.uk
 

Re:How to set icon and caption of windows taskbar button?

Simon Elliott wrote:
Quote
On 27/05/2005, Remy Lebeau (TeamB) wrote:

>>Now I'd like to gove the taskbar button its own icon and
>>caption - possibly different from the ones shown by the
>>form. How do I do this?

>The Caption of the Taskbar Button is always the same as the Form's
>Caption, and the Icon is the same as the Form's Icon. You cannot
>specify a different Caption and Icon that are just for the button
>alone. They have to be applied to the Form as well.

OK. I vaguely recalled from the olden days of Petzold that there was a
way of drawing on the taskbar button's canvas, but it was so long ago
that my memory could be a bit flaky...

Well, Get the taskbar handle, then get the child handle to the window
containing the taskbar buttons, then search for the child window that is
your applications taskbar button.
Get a DC for the window and draw.