function SetFormTransparent(AFormHandle: HWnd; ATransparentColor: TColor): Boolean;
const
WS_EX_LAYERED = $00080000;
LWA_COLORKEY = $00000001;
var LStyle: Integer;
LDLLHandle: Cardinal;
LSetLayerdProc: function (Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; stdcall;
begin
LDLLHandle := LoadLibrary('user32.dll');
if LDLLHandle <> 0 then
begin
@LSetLayerdProc := GetProcAddress(LDLLHandle, 'SetLayeredWindowAttributes');
if Assigned(LSetLayerdProc) then
begin
LStyle := GetWindowLong(AFormHandle, GWL_EXSTYLE);
SetWindowLong(AFormHandle, GWL_EXSTYLE, LStyle or WS_EX_LAYERED);
result := LSetLayerdProc(AFormHandle, ColorToRGB(ATransparentColor), 0, LWA_COLORKEY);
end else result := False;
FreeLibrary(LDLLHandle);
end else result := False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
color := clFuchsia;
SetFormTransparent(handle, Color);
end;