For Newbie

Tuesday, 15 November 2011

Transparent Windows Taskbar by Delphi



Creating the Windows taskbar appears transparent with Delphi.

Declaration Procedure:
SetTaskbarTrans procedure (n: Byte);
var
   targetHwnd, xHwnd: hWnd;
begin
   targetHwnd: = FindWindow ('Shell_TrayWnd','');
   if targetHwnd <> 0 then
   begin
     xHwnd: = GetWindowLong (targetHwnd, GWL_EXSTYLE);
     SetWindowLong (targetHwnd, GWL_EXSTYLE, xHwnd or WS_EX_LAYERED);
     SetLayeredWindowAttributes (targetHwnd, 0, n, LWA_ALPHA);
   end;
end;

Example of implementation:
TForm1.TrackBar1Change procedure (Sender: TObject);
begin
   SetTaskbarTrans (TrackBar1.Position);
end;

Share on Facebook
Share on Twitter
Share on Google+

Related : Transparent Windows Taskbar by Delphi