Recent

Author Topic: hiding application in taskbar onminimize  (Read 13110 times)

Lacak2

  • Guest
hiding application in taskbar onminimize
« on: February 25, 2009, 01:58:56 pm »
is there a possibility how to hide application in taskbar, when is minimized.
I am playnig with tray icon, so I can display trayicon and show/restore application when clicking on tray icon, but, when i click on minimize button application only minimizes and does not hide.

I am playing with application.onminimize and with showwindow(, SW_HIDE) and SetWindowLong(...), but without effect.

Can anybody help ?
TIA
-Laco.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: hiding application in taskbar onminimize
« Reply #1 on: February 25, 2009, 09:07:08 pm »
Let the form in question not be the main form. When showing, set ShowInTaskBar to true and when minimizing, hide it (and maybe set ShowInTaskBar to false.

Lacak2

  • Guest
Re: hiding application in taskbar onminimize
« Reply #2 on: February 26, 2009, 09:22:14 am »
Let the form in question not be the main form.
But my application contains only one form. (It is "service application", which displays only status info)

My experiments shows diferent results with Lazarus 0.9.26.3 and 0.9.27.
This simple code:

   //Form1 has set property ShowInTaskBar:=stNever
   Application.OnMinimize:=@Minimize;
   ...
   procedure TForm1.Minimize(Sender: TObject);
   begin
      Hide;
   end;

Compiled with Lazarus 0.9.26.3 onMinimize remains in taskbar, but
compiled with Lazarus 0.9.27 onMinimize hides from taskbar (so ok for me).

Thanks
-Laco.

C#R#

  • New Member
  • *
  • Posts: 45

 

TinyPortal © 2005-2018