Forum > General

Hide application icon in taskbar solution with ShowWindow and SetBounds

(1/1)

Fantablup:
I read everything about hiding the application in the taskbar.

ShowInTaskbar := false; is not working.

In the lpr file...
Application.MainFormOnTaskBar := false; not working.
Application.ShowMainForm := false not working.

If you only have a main form, it works without doing anything special.
But if you showing another form, it appears in the taskbar again.

Tried all the solutions i found, but none of them worked.

I had to use a timer, and in the onTtimer:

procedure TMainForm.timerAppHideTimer(Sender: TObject);
begin
   {$IFDEF WINDOWS}
   ShowWindow(Application.handle, SW_HIDE);
   MainForm.SetBounds(0, 0, 0, 0);
   {$ELSE}
   {$ENDIF}
   timerAppHide.Enabled := false;
end;     

I'm using this on all forms i am showing, also about form and others. It's the only thing that work for keeping the application icon hidden in the taskbar.

In Linux i don't have to do this. It is only in Windows this problem occurs.

I have to use a timer for this, because it have to wait for all forms to be visible. onShow is executing before it becomes visible(it becomes visible, but not finished showing all components in it). This is important for the solution to work.

I have an application that shows many forms at once, and after they are visible, i using the timer, so every form can be visible.

This is the only solution i made work.

Is the ShowInTaskbar a bug or????

Navigation

[0] Message Index

Go to full version