Recent

Author Topic: Hide application from taskbar  (Read 8118 times)

Alex Cones

  • Jr. Member
  • **
  • Posts: 73
    • FLSoft
Hide application from taskbar
« on: August 24, 2010, 07:38:30 pm »
Hi!

I have tried many different methods, but...

My methods:
Code: [Select]
// SetWindowLong(wnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
//  ShowWindow(TWin32WidgetSet(WidgetSet).AppHandle, SW_HIDE);
//  ShowWindow(FRMMain.Handle, SW_HIDE);
//  FRMMain.ShowInTaskBar := stNever;
  h:=findwindow('Window','Squary');
  showwindow(h, sw_hide);

And ported from C++ code:
Code: [Select]
Procedure TFRMMain.CreateWnd;
 Var
  Taskbar: ITaskbarList;
 begin
  inherited;

  Taskbar := CreateComObject(CLSID_TaskbarList) as ITaskbarList;
  Taskbar.HrInit;
  Taskbar.DeleteTab(Handle);
 end;

Also I checked FRMMain.ShowInTaskbar in Never...

What to do, for hide it?

P.S. Also my form have
1) bsNone formstyle
2) Form have
Code: [Select]
With FRMMain Do
    SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_SHOWWINDOW);
In Almost every OnPaint.
3) Form have next parameters:

Code: [Select]
SetWindowLong(FRMMain.Handle, GWL_EXSTYLE,
   GetWindowLong(FRMMain.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
  SetLayeredWindowAttributes(FRMMain.Handle, $FF00FF, 0, LWA_COLORKEY);
- For $FF00FF transparent
« Last Edit: August 24, 2010, 07:42:18 pm by Alex Cones »
To beer or not to beer?
_____________________
I`m terribly sorry for my Anglish. :)

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: Hide application from taskbar
« Reply #1 on: August 24, 2010, 10:08:23 pm »
in TFrmMain.Create, add the following code:

FRMMain.ShowInTaskbar := false;

or simply define it in the design of the form
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

Alex Cones

  • Jr. Member
  • **
  • Posts: 73
    • FLSoft
Re: Hide application from taskbar
« Reply #2 on: August 25, 2010, 10:33:12 am »
Thanx, I just reinstall Lazarus, and it all works.

Thank you anyway.
To beer or not to beer?
_____________________
I`m terribly sorry for my Anglish. :)

 

TinyPortal © 2005-2018