| View previous topic :: View next topic |
| Author |
Message |
Simon Elliott Guest
|
Posted: Fri May 27, 2005 10:01 am Post subject: Giving a form its own taskbar button |
|
|
I have a BCB3 app which spawns a non-modal subform. I'd like the
subform to have its own taskbar button, in addition to the taskbar
button for the main app. How do I do this?
--
Simon Elliott http://www.ctsn.co.uk
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Fri May 27, 2005 10:30 am Post subject: Re: Giving a form its own taskbar button |
|
|
"Simon Elliott" <Simon at ctsn.co.uk> wrote:
| Quote: | I have a BCB3 app which spawns a non-modal subform. I'd like the
subform to have its own taskbar button, in addition to the taskbar
button for the main app. How do I do this?
|
Override the form's CreateParams method so that you can apply
the WS_EX_APPWINDOW flag to the form's ExStyle.
void __fastcall TForm2::CreateParams( TCreateParams &Params )
{
TForm::CreateParams( Params );
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = ::GetDesktopWindow();
}
~ JD
|
|
| Back to top |
|
 |
Simon Elliott Guest
|
Posted: Fri May 27, 2005 10:53 am Post subject: Re: Giving a form its own taskbar button |
|
|
On 27/05/2005, JD wrote:
| Quote: | "Simon Elliott" <Simon at ctsn.co.uk> wrote:
I have a BCB3 app which spawns a non-modal subform. I'd like the
subform to have its own taskbar button, in addition to the taskbar
button for the main app. How do I do this?
Override the form's CreateParams method so that you can apply
the WS_EX_APPWINDOW flag to the form's ExStyle.
void __fastcall TForm2::CreateParams( TCreateParams &Params )
{
TForm::CreateParams( Params );
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = ::GetDesktopWindow();
}
|
Exellent, that all works fine.
How would I go about displaying an icon and/or caption in the taskbar
button?
--
Simon Elliott http://www.ctsn.co.uk
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Fri May 27, 2005 11:32 am Post subject: Re: Giving a form its own taskbar button |
|
|
"Simon Elliott" <Simon at ctsn.co.uk> wrote:
| Quote: |
[...] How would I go about displaying an icon and/or caption
in the taskbar button?
|
Set the form's Icon and Caption properties and when you
allocate the form, use NULL as the Owner. Since the form will
have no Owner, you *must* explicitly delete the form or you'll
have a leak.
~ JD
|
|
| Back to top |
|
 |
Simon Elliott Guest
|
Posted: Fri May 27, 2005 1:15 pm Post subject: Re: Giving a form its own taskbar button |
|
|
On 27/05/2005, JD wrote:
| Quote: | [...] How would I go about displaying an icon and/or caption
in the taskbar button?
Set the form's Icon and Caption properties and when you
allocate the form, use NULL as the Owner. Since the form will
have no Owner, you must explicitly delete the form or you'll
have a leak.
|
Is there any way to have a different icon and caption in the taskbar
and on the form?
--
Simon Elliott http://www.ctsn.co.uk
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Fri May 27, 2005 1:25 pm Post subject: Re: Giving a form its own taskbar button |
|
|
"Simon Elliott" <Simon at ctsn.co.uk> wrote:
| Quote: |
Is there any way to have a different icon and caption in the taskbar
and on the form?
|
I doubt it. The definative answer would be found in how Windows
determines what to use.
~ JD
|
|
| Back to top |
|
 |
Simon Elliott Guest
|
Posted: Fri May 27, 2005 1:41 pm Post subject: Re: Giving a form its own taskbar button |
|
|
On 27/05/2005, JD wrote:
| Quote: | Is there any way to have a different icon and caption in the taskbar
and on the form?
I doubt it. The definative answer would be found in how Windows
determines what to use.
|
OK. Thanks for your help on this. I'll see if anyone in the API
newsgroup can advise on the icon & caption issue.
--
Simon Elliott http://www.ctsn.co.uk
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri May 27, 2005 5:53 pm Post subject: Re: Giving a form its own taskbar button |
|
|
"JD" <nospam (AT) nospam (DOT) com> wrote
| Quote: | when you allocate the form, use NULL as the Owner.
|
That is not necessary.
Gambit
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Sat May 28, 2005 12:28 am Post subject: Re: Giving a form its own taskbar button |
|
|
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote:
| Quote: |
"JD" <nospam (AT) nospam (DOT) com> wrote in message
news:4297055c$1 (AT) newsgroups (DOT) borland.com...
when you allocate the form, use NULL as the Owner.
That is not necessary.
|
I didn't think so but I found it as a suggestion by Peter Below
and thought it worth while to mention.
~ JD
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sat May 28, 2005 3:13 am Post subject: Re: Giving a form its own taskbar button |
|
|
"JD" <nospam (AT) nospam (DOT) com> wrote
| Quote: | I didn't think so but I found it as a suggestion by Peter Below
and thought it worth while to mention.
|
Ownership only refers to memory management, nothing else. It has nothing to
do with a form's ability to have a taskbar button.
Gambit
|
|
| Back to top |
|
 |
|