Board index » delphi » Hiding the application in the taskbar

Hiding the application in the taskbar

Hi
I'm programming with DELPHI 4 Professional

how can i hide the application in the taskbar leaving only an icon in the
systray ( i already have the systray component, i only need to know how to
hide the application)

 

Re:Hiding the application in the taskbar


Hi,

Try:

    Main.Visible := False;

--Glenn

Quote
Steve Abboud wrote:
> Hi
> I'm programming with DELPHI 4 Professional

> how can i hide the application in the taskbar leaving only an icon in
> the
> systray ( i already have the systray component, i only need to know
> how to
> hide the application)

Re:Hiding the application in the taskbar


Thanks for the quick answer
Unfortunatly, it's not working
MAIN is not a defined variable, soo i tried to hookit with the Application,
but no instance was found.

is Main refer to the main form (ie frmMain from a TForm) or is it a system
defined object?

Glenn Anderson <gander...@no.spam.ondoher.com> a crit dans le message :
383365FF.A8E5F...@no.spam.ondoher.com...

Quote
> Hi,

> Try:

>     Main.Visible := False;

> --Glenn

> Steve Abboud wrote:

> > Hi
> > I'm programming with DELPHI 4 Professional

> > how can i hide the application in the taskbar leaving only an icon in
> > the
> > systray ( i already have the systray component, i only need to know
> > how to
> > hide the application)

Re:Hiding the application in the taskbar


Sorry, that was a bit ambiguous.  What I meant was set the visible
property of the form you want to hide to False. This is frequently named
Main, but not necessarily, it could be Form1 for all I know.  You'll
know best. If your in a method of the form when you need to do this,
just use Visible := False, Self is implied.

--Glenn

Quote
Mike wrote:
> Thanks for the quick answer
> Unfortunatly, it's not working
> MAIN is not a defined variable, soo i tried to hookit with the
> Application,
> but no instance was found.

> is Main refer to the main form (ie frmMain from a TForm) or is it a
> system
> defined object?

> Glenn Anderson <gander...@no.spam.ondoher.com> a crit dans le message
> :
> 383365FF.A8E5F...@no.spam.ondoher.com...
> > Hi,

> > Try:

> >     Main.Visible := False;

> > --Glenn

> > Steve Abboud wrote:

> > > Hi
> > > I'm programming with DELPHI 4 Professional

> > > how can i hide the application in the taskbar leaving only an icon
> in
> > > the
> > > systray ( i already have the systray component, i only need to
> know
> > > how to
> > > hide the application)

Re:Hiding the application in the taskbar


Quote
Glenn Anderson wrote:

> Hi,

> Try:

>     Main.Visible := False;

> --Glenn

> Steve Abboud wrote:

> > Hi
> > I'm programming with DELPHI 4 Professional

> > how can i hide the application in the taskbar leaving only an icon in
> > the
> > systray ( i already have the systray component, i only need to know
> > how to
> > hide the application)

What about ShowWindow(Application.Handle,SW_HIDE); ?
___________________________________________________________________
Heimo Veps?      North Ostrobothnia Regional Environment Centre
                 P.O.Box 124, 90101 OULU, Finland

Re:Hiding the application in the taskbar


Quote
> how can i hide the application in the taskbar leaving only an icon in the
> systray ( i already have the systray component, i only need to know how to
> hide the application)

Here's the simplest way:

 ShowWindow(Application.Handle, SW_HIDE );SetWindowLong( Application.Handle,
GWL_EXSTYLE,
   GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW and
not WS_EX_APPWINDOW);  ShowWindow(Application.Handle, SW_SHOW );

-----------------

Quote
>What about ShowWindow(Application.Handle,SW_HIDE); ?

That works, but it reappears everytime the main form is shown.

--
Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
--------------------------------------------------------
"I may disagree with what you say, but I will
defend to the death your right to say it."
--------------------------------------------------------

Re:Hiding the application in the taskbar


Hi,

The simplest way to do this is moving your application to a off-screen
location as follows :

with MainForm do
  MoveWindow(Handle, -100, -100, Width, Height, False);

of course you must replace MainForm with your application's main form
name and
also depending on
your main form's size change -100 to a value so that all of your main
form
stays in a off-screen
location.

Regards,

Amir

Quote
Steve Abboud wrote:
> Hi
> I'm programming with DELPHI 4 Professional

> how can i hide the application in the taskbar leaving only an icon in the
> systray ( i already have the systray component, i only need to know how to
> hide the application)

Re:Hiding the application in the taskbar


- Actually, you can do it another way.
If you want to hide the application from the task bar use the following
code:

ShowWindow( Application.Handle, iCmdShow ) ;

Where iCmdShow has the value of  SW_HIDE

Hope that helps,

sincerely,

John Scalco
Software Developer/Consultant

////////////////////////////////////////////////////////////////////////////
//////////////

Amir Ali Eshghi <amirali_...@yahoo.com> wrote in message
news:38C1412C.3FD5AF44@yahoo.com...

Quote
> Hi,

> The simplest way to do this is moving your application to a off-screen
> location as follows :

> with MainForm do
>   MoveWindow(Handle, -100, -100, Width, Height, False);

> of course you must replace MainForm with your application's main form
> name and
> also depending on
> your main form's size change -100 to a value so that all of your main
> form
> stays in a off-screen
> location.

> Regards,

> Amir

> Steve Abboud wrote:

> > Hi
> > I'm programming with DELPHI 4 Professional

> > how can i hide the application in the taskbar leaving only an icon in
the
> > systray ( i already have the systray component, i only need to know how
to
> > hide the application)

Other Threads