Board index » delphi » hiding application in taksbar - DOESNT WORK!!!

hiding application in taksbar - DOESNT WORK!!!

hi folx!

benath in the discussion i found the following message:

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

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

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

the problem is: where should i place this command? i tried to place it in my
projct file (after application.initialze), after "anplication.run", after
the creation of the forms and i also tried it in tform1oncreate. but in all
cases it didn't work. the solution with moving the window out of the screen
doesn't work because it still shows on the taskbar (of course). and when i
do the showwindow-method won't it as well hide the window itself?

i hope you can help me - thanx

rupert

 

Re:hiding application in taksbar - DOESNT WORK!!!


just do showwindow(application.handle,sw_hide)

I don't know where that IBLAA BLAA stuff came froM!!

hope it helps!

--
Cheers

From Steve G
visit http://gunsoft.cjb.net - free software, mp3's, and more
icq #forty eight million three hundred and two thousand and ninety two

Quote
Rupert <archma...@gmx.net> wrote in message

news:ouJQhori$GA.132@news-02.uni.net...
Quote
> hi folx!

> benath in the discussion i found the following message:

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

> the problem is: where should i place this command? i tried to place it in
my
> projct file (after application.initialze), after "anplication.run", after
> the creation of the forms and i also tried it in tform1oncreate. but in
all
> cases it didn't work. the solution with moving the window out of the
screen
> doesn't work because it still shows on the taskbar (of course). and when i
> do the showwindow-method won't it as well hide the window itself?

> i hope you can help me - thanx

> rupert

Re:hiding application in taksbar - DOESNT WORK!!!


Quote
Rupert <archma...@gmx.net> wrote in message

news:ouJQhori$GA.132@news-02.uni.net...

Quote
> hi folx!

> benath in the discussion i found the following message:

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

> the problem is: where should i place this command? i tried to place it in
my
> projct file (after application.initialze), after "anplication.run", after
> the creation of the forms and i also tried it in tform1oncreate. but in
all
> cases it didn't work. the solution with moving the window out of the
screen
> doesn't work because it still shows on the taskbar (of course). and when i
> do the showwindow-method won't it as well hide the window itself?

- Rupert,
I am glad to hear/see that you tried my code out.

You can put it anywhere, but want to put it in your main forms FormCreate
method.

Here is a sample 'snippet'. I placed a TRadioGroup component on the form
with two items in the stringlist: 'Show in TaskBar'  and 'Hide From
TaskBar'. The ItemIndex property should be set to 0 using the object
inspector.

I then added this code the the OnClick Event

procedure TForm1.RadioGroup1Click(Sender: TObject);
var
   iCmdShow : integer ;
begin

     if (RadioGroup1.ItemIndex = 0 ) then // show
        iCmdShow := sw_show
     else
        iCmdShow := sw_hide ;

     ShowWindow( Application.Handle, iCmdShow ) ;

end;

When you start the app, the default is 'show in taskbar'. Click the 'Hide
From TaskBar' and you will see the form disappear from the taskBar.

Hope this helps you more.

Sincerely,
John Scalco

Other Threads