| View previous topic :: View next topic |
| Author |
Message |
Mike Guest
|
Posted: Wed Apr 28, 2004 6:28 pm Post subject: Hiding main window at start |
|
|
Hi, I am writing an application in CBuilder 6 that I want to start in a
hidden state. Everytime I execute the app it automatically shows even
though I set the visible property to false.
Any hints?
Thanks,
Mike
|
|
| Back to top |
|
 |
Simon D Guest
|
Posted: Wed Apr 28, 2004 6:33 pm Post subject: Re: Hiding main window at start |
|
|
http://bcbdev.com/faqs/faq6.htm
--
"Mike" <mbaker (AT) accentsol (DOT) com> wrote
| Quote: | Hi, I am writing an application in CBuilder 6 that I want to start in a
hidden state. Everytime I execute the app it automatically shows even
though I set the visible property to false.
Any hints?
Thanks,
Mike
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Apr 28, 2004 6:43 pm Post subject: Re: Hiding main window at start |
|
|
"Mike" <mbaker (AT) accentsol (DOT) com> wrote
| Quote: | Hi, I am writing an application in CBuilder 6 that I want
to start in a hidden state. Everytime I execute the app
it automatically shows even though I set the visible
property to false.
|
Set the Application->ShowMainForm property to false instead. Do it either
in the main form's constructor, or inside WinMain directly before calling
Application->Run().
Gambit
|
|
| Back to top |
|
 |
Mike Guest
|
Posted: Wed Apr 28, 2004 7:03 pm Post subject: Re: Hiding main window at start |
|
|
Thanks Simon and Remy. That did the trick.
Mike
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: |
snip
Set the Application->ShowMainForm property to false instead. Do it either
in the main form's constructor, or inside WinMain directly before calling
Application->Run().
Gambit
|
|
|
| Back to top |
|
 |
Mike Guest
|
Posted: Wed Apr 28, 2004 9:03 pm Post subject: Re: Hiding main window at start |
|
|
Ok, I spoke too soon.
The application hides ok, but when I do the following in a thread;
// make main app visible
ShowWindow(Application->Handle, SW_SHOW);
Application->MainForm->Visible = true;
The form becomes only partially visible and locks up.
I created a very simple project with an Ok button in the middle of the form.
I create the thread in the create event of the form. When the thread
executes the ShowWindow, the form does display, but only partially and
locks.
Thanks,
Mike
|
|
| Back to top |
|
 |
Mike Guest
|
Posted: Wed Apr 28, 2004 9:19 pm Post subject: Re: Hiding main window at start |
|
|
I answered my own question. In my trhead, if I do a PostMessage and have
the main form do the ShowWindow, it works just fine.
Thanks,
Mike
|
|
| Back to top |
|
 |
|