Board index » cppbuilder » Hide Main Window at the start of the application

Hide Main Window at the start of the application

Hi all,

I have a Try Icon in the main window of my project.
I want to Hide the main window in the start of application (and Show it by
clicking the tray icon).
But I cant Hide the window, although his Visible property is set to false.
When Application->Run() is executed, the Visible property is changed to true.
Is it possible to Hide (Not minimize) the main window at the start of the
application?

thanks in advance.

 

Re:Hide Main Window at the start of the application


I guess you indended to post this to the VCL.components.using group, but
luckily I can supply the answer anyway!

Check out TApplication::ShowMainForm property in the online help.
Set this to false sometime before calling Application->Run().

--
AlisdairM
Team Thai Kingdom

Quote
Pablo Negri wrote:

> Hi all,

> I have a Try Icon in the main window of my project.
> I want to Hide the main window in the start of application (and Show it by
> clicking the tray icon).
> But I cant Hide the window, although his Visible property is set to false.
> When Application->Run() is executed, the Visible property is changed to true.
> Is it possible to Hide (Not minimize) the main window at the start of the
> application?

> thanks in advance.

Re:Hide Main Window at the start of the application


Open up the main project source file, and modify WinMain() to add in a call
to set Application->ShowMainForm = false just before calling
Applicarion->Run().

Also have a look at this article, it shows an example of exactly what you're
trying to do:

    Create forms that miminize or close to the system tray
    http://www.bcbdev.com/faqs/faq73.htm

Gambit

Quote
"Pablo Negri" <pne...@solucom.com.ar> wrote in message

news:1103_1024581023@newsgroups.borland.com...
Quote
> I have a Try Icon in the main window of my project.
> I want to Hide the main window in the start of application
> (and Show it by clicking the tray icon).
> But I cant Hide the window, although his Visible property is
> set to false. When Application->Run() is executed, the Visible
> property is changed to true. Is it possible to Hide (Not minimize)
> the main window at the start of the application?

Other Threads