BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Giving a form its own taskbar button

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Simon Elliott
Guest





PostPosted: Fri May 27, 2005 10:01 am    Post subject: Giving a form its own taskbar button Reply with 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?

--
Simon Elliott http://www.ctsn.co.uk
Back to top
JD
Guest





PostPosted: Fri May 27, 2005 10:30 am    Post subject: Re: Giving a form its own taskbar button Reply with quote




"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





PostPosted: Fri May 27, 2005 10:53 am    Post subject: Re: Giving a form its own taskbar button Reply with quote



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





PostPosted: Fri May 27, 2005 11:32 am    Post subject: Re: Giving a form its own taskbar button Reply with quote


"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





PostPosted: Fri May 27, 2005 1:15 pm    Post subject: Re: Giving a form its own taskbar button Reply with quote

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





PostPosted: Fri May 27, 2005 1:25 pm    Post subject: Re: Giving a form its own taskbar button Reply with quote


"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





PostPosted: Fri May 27, 2005 1:41 pm    Post subject: Re: Giving a form its own taskbar button Reply with quote

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





PostPosted: Fri May 27, 2005 5:53 pm    Post subject: Re: Giving a form its own taskbar button Reply with quote


"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





PostPosted: Sat May 28, 2005 12:28 am    Post subject: Re: Giving a form its own taskbar button Reply with quote


"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





PostPosted: Sat May 28, 2005 3:13 am    Post subject: Re: Giving a form its own taskbar button Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.