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 

Minimizing to the taskbar

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





PostPosted: Thu Jul 24, 2003 12:51 pm    Post subject: Minimizing to the taskbar Reply with quote



I've got a program that has multiple forms, and when the main form is hidden
a second form is visible. When you minimize the second form it shows up as a
box in the corner of the screen. It does not minimize all the way down to
the taskbar.

Is there any way I can get this form to minimize to the taskbar?

Please Help,
Jeff


Back to top
Rodolfo Frino
Guest





PostPosted: Thu Jul 24, 2003 10:07 pm    Post subject: Re: Minimizing to the taskbar Reply with quote



Wow, Great solution JD!

Rodolfo

"JD" <nospam (AT) nospam (DOT) com> wrote

Quote:

"Jeff" <jeffleaming (AT) yahoo (DOT) com> wrote:
[...] When you minimize the second form it shows up as a
box in the corner of the screen. [...] Is there any way I
can get this form to minimize to the taskbar?

Use the win32 API CreateWindowEx. Set the dwStyle to WS_EX_APPWINDOW
and the hWndParent to the DeskTop.

~ JD




Back to top
Todd Brylski
Guest





PostPosted: Fri Jul 25, 2003 8:53 am    Post subject: Re: Minimizing to the taskbar Reply with quote



"Jeff" <jeffleaming (AT) yahoo (DOT) com> wrote

Quote:
I've got a program that has multiple forms, and when the main form is hidden
a second form is visible. When you minimize the second form it shows up as a
box in the corner of the screen. It does not minimize all the way down to
the taskbar.
Is there any way I can get this form to minimize to the taskbar?

void __fastcall TForm2::CreateParams( TCreateParams& Params )
{
TForm::CreateParams( Params );
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = GetDesktopWindow();
}

Todd



Back to top
JD
Guest





PostPosted: Fri Jul 25, 2003 9:04 am    Post subject: Re: Minimizing to the taskbar Reply with quote


"Todd Brylski" <tbrylski (AT) yahoo (DOT) com> wrote:
Quote:

void __fastcall TForm2::CreateParams( TCreateParams& Params )
{
TForm::CreateParams( Params );
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = GetDesktopWindow();
}


Clean & neat. Nice.

~ JD


Back to top
Jeff
Guest





PostPosted: Fri Aug 22, 2003 3:47 pm    Post subject: Re: Minimizing to the taskbar Reply with quote

Is this to be used instead of Applicaiton->CreateForm?

"JD" <nospam (AT) nospam (DOT) com> wrote

Quote:

"Jeff" <jeffleaming (AT) yahoo (DOT) com> wrote:
[...] When you minimize the second form it shows up as a
box in the corner of the screen. [...] Is there any way I
can get this form to minimize to the taskbar?

Use the win32 API CreateWindowEx. Set the dwStyle to WS_EX_APPWINDOW
and the hWndParent to the DeskTop.

~ JD





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Aug 22, 2003 4:56 pm    Post subject: Re: Minimizing to the taskbar Reply with quote


"Jeff" <jeffleaming (AT) yahoo (DOT) com> wrote

Quote:
Is this to be used instead of Applicaiton->CreateForm?

If you want to use a VCL form, then ignore JD's suggestion about using
CreatWindowEx() directly. Override the form's inherited CreateParams()
method and assign your dwStyle and hWndParent values there instead, ie:

void __fastcall TMyForm::CreateParams(TCreateParams &Params)
{
TForm::CreateParams(Params);
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = GetDesktopWindow();
}


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.510 / Virus Database: 307 - Release Date: 8/14/03




Back to top
Jeff
Guest





PostPosted: Thu Aug 28, 2003 4:05 pm    Post subject: Re: Minimizing to the taskbar Reply with quote

Thank you, this does allow the non-MainForm windows to minimize to the
taskbar.

Although, now there is a minimized version of the MainForm in the taskbar
when the program starts. It doesn't allow you to show it either because of
the Visible=false property.

How do you suggest I hide this second minimized window?

"Remy Lebeau (TeamB)" <gambit47 (AT) yahoo (DOT) com> wrote

Quote:

"Jeff" <jeffleaming (AT) yahoo (DOT) com> wrote in message
news:3f463b25$1 (AT) newsgroups (DOT) borland.com...
Is this to be used instead of Applicaiton->CreateForm?

If you want to use a VCL form, then ignore JD's suggestion about using
CreatWindowEx() directly. Override the form's inherited CreateParams()
method and assign your dwStyle and hWndParent values there instead, ie:

void __fastcall TMyForm::CreateParams(TCreateParams &Params)
{
TForm::CreateParams(Params);
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = GetDesktopWindow();
}


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.510 / Virus Database: 307 - Release Date: 8/14/03





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Aug 28, 2003 5:34 pm    Post subject: Re: Minimizing to the taskbar Reply with quote


"Jeff" <Jeff (AT) nospam (DOT) com> wrote


Quote:
Although, now there is a minimized version of the MainForm
in the taskbar when the program starts. It doesn't allow you
to show it either because of the Visible=false property.

Making a secondary form minimizable to the TaskBar should not have effected
any other forms, as they are all independant of each other. If your
MainForm is not remaining invisible then you must have introduced something
else into your code that you haven't shown yet. Please show your actual
code.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03



Back to top
Jeff
Guest





PostPosted: Thu Aug 28, 2003 10:26 pm    Post subject: Re: Minimizing to the taskbar Reply with quote

All I do in the program is have the MainForm hidden, and a secondary form
shown. When certain options are configured, the secondary form is hidden and
the MainForm is shown.

I've added your CreateParams function to this secondary form, but there
seems to be two entries on the taskbar. I just set Application->ShowMainForm
= false; before the Application->Run(); Then when the secondary is hidden, I
just use FormName->Hide(); and FormName->Show(); to bring up the MainForm.

"Remy Lebeau (TeamB)" <gambit47 (AT) yahoo (DOT) com> wrote

Quote:

"Jeff" <Jeff (AT) nospam (DOT) com> wrote in message
news:3f4e2854$1 (AT) newsgroups (DOT) borland.com...

Although, now there is a minimized version of the MainForm
in the taskbar when the program starts. It doesn't allow you
to show it either because of the Visible=false property.

Making a secondary form minimizable to the TaskBar should not have
effected
any other forms, as they are all independant of each other. If your
MainForm is not remaining invisible then you must have introduced
something
else into your code that you haven't shown yet. Please show your actual
code.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03






Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Aug 29, 2003 12:15 am    Post subject: Re: Minimizing to the taskbar Reply with quote


"Jeff" <Jeff (AT) nospam (DOT) com> wrote

Quote:
All I do in the program is have the MainForm hidden, and a
secondary form shown. When certain options are configured,
the secondary form is hidden and the MainForm is shown.

Please show your ACTUAL code.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03




Back to top
Jeff
Guest





PostPosted: Fri Aug 29, 2003 1:22 pm    Post subject: Re: Minimizing to the taskbar Reply with quote

This is the Windows entry point:

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TfrmMultipleCom),
&frmMultipleCom);
Application->CreateForm(__classid(TfrmAEbusSetup), &frmAEbusSetup);
Application->CreateForm(__classid(TfrmAbout), &frmAbout);
Application->CreateForm(__classid(TfrmProto), &frmProto);
Application->CreateForm(__classid(TfrmSyntax), &frmSyntax);
Application->ShowMainForm = false;
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}

Otherwise the rest is just using Show() and Hide(). What portions of the
code would you like to see?


"Remy Lebeau (TeamB)" <gambit47 (AT) yahoo (DOT) com> wrote

Quote:

"Jeff" <Jeff (AT) nospam (DOT) com> wrote in message
news:3f4e8198$1 (AT) newsgroups (DOT) borland.com...
All I do in the program is have the MainForm hidden, and a
secondary form shown. When certain options are configured,
the secondary form is hidden and the MainForm is shown.

Please show your ACTUAL code.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03






Back to top
Jeff
Guest





PostPosted: Fri Aug 29, 2003 5:45 pm    Post subject: Re: Minimizing to the taskbar Reply with quote

if (flag) // no errors occurred
{
flag_started = 1;
frmAEbusSetup->Hide();
frmMultipleCom->Show();
}
else
{
flag_started = 1;
frmAEbusSetup->Hide();
frmProto->Show();
}


"Remy Lebeau (TeamB)" <gambit47 (AT) yahoo (DOT) com> wrote

Quote:

"Jeff" <Jeff (AT) nospam (DOT) com> wrote in message
news:3f4f53ac$1 (AT) newsgroups (DOT) borland.com...
This is the Windows entry point:
snip

I do not see you calling ShowWindow() at all.

Otherwise the rest is just using Show() and Hide(). What
portions of the code would you like to see?

The code where you are actually showing and hiding your forms.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03






Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Aug 29, 2003 6:06 pm    Post subject: Re: Minimizing to the taskbar Reply with quote


"Jeff" <Jeff (AT) nospam (DOT) com> wrote

Quote:
if (flag) // no errors occurred
snip


Again, I see no calling of the ShowWindow() function at all. You're
supposed to be using ShowWindow() to show/hide the main taskbar button when
appropriate. For example:

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
//...
ShowWindow(Application->Handle, SW_HIDE);
Application->ShowMainForm = false;
//...
return 0;
}

// when showing the main form
ShowWindow(Application->Handle, SW_SHOW);
MainForm->Show();

// when hiding the main form again
ShowWindow(Application->Handle, SW_HIDE);
MainForm->Hide();


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03



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.