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 

Hiding main window at start

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





PostPosted: Wed Apr 28, 2004 6:28 pm    Post subject: Hiding main window at start Reply with 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
Simon D
Guest





PostPosted: Wed Apr 28, 2004 6:33 pm    Post subject: Re: Hiding main window at start Reply with quote



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





PostPosted: Wed Apr 28, 2004 6:43 pm    Post subject: Re: Hiding main window at start Reply with quote




"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





PostPosted: Wed Apr 28, 2004 7:03 pm    Post subject: Re: Hiding main window at start Reply with quote

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





PostPosted: Wed Apr 28, 2004 9:03 pm    Post subject: Re: Hiding main window at start Reply with quote

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





PostPosted: Wed Apr 28, 2004 9:19 pm    Post subject: Re: Hiding main window at start Reply with quote

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
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.