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