 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bruce Salzman Guest
|
Posted: Thu Jul 24, 2003 10:09 pm Post subject: Modal form on the taksbar |
|
|
When I use ShowModal to display a form, a separate icon for the form appears
on the taskbar next to the application's icon. Is there some way to prevent
this?
I'm doing this:
TMyForm *Form = new TMyForm(Forms::Application);
Form->ShowModal();
Thanks,
Bruce
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Thu Jul 24, 2003 10:28 pm Post subject: Re: Modal form on the taksbar |
|
|
" Bruce Salzman" <bruce (AT) nospam (DOT) org> wrote:
| Quote: | When I use ShowModal to display a form, a separate icon for
the form appears on the taskbar next to the application's
icon.
|
Very interesting. I thought that required an API call to
CreateWindowEX. I wonder if it creates other problems ... ?
| Quote: | Is there some way to prevent this?
TMyForm *Form = new TMyForm(Forms::Application);
|
If you want the form currently executing to be the owner of
the new form:
TMyForm *Form = new TMyForm( this );
~ JD
|
|
| Back to top |
|
 |
Bruce Salzman Guest
|
Posted: Thu Jul 24, 2003 10:38 pm Post subject: Re: Modal form on the taksbar |
|
|
Thanks for the reply JD,
Ok, I'll level...I don't really have a currently executing form. I do have a
hidden main window (I've tried using that as the owner, with the same
results). Here is the kicker, though--while I do create an application
object, call Application->Initialize(), and call CreateForm() for the form,
I don't actually call Application->Run()! This app is an OWLNext app which
is using VCL forms as well. Do you suppose this might have something to do
with it?
Regards,
Bruce
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Thu Jul 24, 2003 10:57 pm Post subject: Re: Modal form on the taksbar |
|
|
" Bruce Salzman" <bruce (AT) nospam (DOT) org> wrote:
| Quote: | [...] while I do create an application object, call
Application->Initialize(), and call CreateForm() for the
form,
|
If the form has been created, did you try Form2->ShowModal()
without trying to 'new' it?
| Quote: | I don't actually call Application->Run()! This app is an
OWLNext app which is using VCL forms as well. Do you suppose
this might have something to do with it?
|
It seems obviouse to me that this would be an issue. It
doesn't mean that you can't do what you want, it just means
that fewer people have worked with it (which I haven't) and
thus fewer people who can help.
~ JD
|
|
| Back to top |
|
 |
Bruce Salzman Guest
|
Posted: Fri Jul 25, 2003 2:28 am Post subject: Re: Modal form on the taksbar |
|
|
| Quote: | If the form has been created, did you try Form2->ShowModal()
without trying to 'new' it?
Yes, with the same result. |
As to not using Application->Run(), at a cursory glance at Forms.pas, I
didn't see anything obvious in Run() that would explain it. I'm wondering
what VCL assigns to the default main form (the first one that is created) as
its parent? The application object?
Bruce
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Fri Jul 25, 2003 3:30 am Post subject: Re: Modal form on the taksbar |
|
|
" Bruce Salzman" <bruce (AT) nospam (DOT) org> wrote:
| Quote: | [...] I'm wondering what VCL assigns to the default main
form (the first one that is created) as its parent?
|
I thinking that it must be the DeskTop because the Parent is
responsible for a number of things that can loosly be thought
of as where the object lives. Now the Owner, although similar
in nature is a different animal and the owner of the main form
is the application.
So ... I would suggest that you next try to remove the form
from the autocreate and 'new' it using '( this )' and then try
setting it's Parent to the DeskTop (NULL).
If that fails, have a look at win32 API CreateWindowEX. It
might, just might do the trick.
The last possible solution that I can offer is a bit of
a 'hack'. Change the main form to display as a something like
a desktop icon which would allow you to discard your current
technique of hiding the main form. You could even copy a
portion of the screen and paint that to the captionless form.
There is one thing that I don't understand though: if you need
a form, why not use the main form?
~ JD
|
|
| Back to top |
|
 |
|
|
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
|
|