type
TForm5 =
class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form5: TForm5;
implementation
{$R *.dfm}
var
Bitmap: TBitmap;
procedure TForm5.FormCreate(Sender: TObject);
var
BlendFunction: TBlendFunction;
BitmapPos: TPoint;
BitmapSize: TSize;
exStyle: DWORD;
begin
BorderStyle := bsNone;
Left := 0;
Top := 0;
Width := Screen.Width;
Height := Screen.Height;
// Enable window layering
exStyle := GetWindowLongA(
Handle, GWL_EXSTYLE);
if (exStyle
and WS_EX_LAYERED = 0)
then
SetWindowLong(
Handle, GWL_EXSTYLE, exStyle
or WS_EX_LAYERED);
Bitmap := TBitmap.Create;
Bitmap.Canvas.Brush.Color := clBlack;
Bitmap.Width := Width;
Bitmap.Height := height;
Bitmap.Canvas.Font.Color := clWhite;
Bitmap.Canvas.Font.Size := 10;
Bitmap.Canvas.TextOut(10,10,'
Hallo die ist ein Test');
BitmapPos := Point(0, 0);
BitmapSize.cx := Bitmap.Width;
BitmapSize.cy := Bitmap.Height;
BlendFunction.BlendOp := AC_SRC_OVER;
BlendFunction.BlendFlags := 0;
BlendFunction.SourceConstantAlpha := 255;
BlendFunction.AlphaFormat := AC_SRC_ALPHA;
// ... and action!
UpdateLayeredWindow(
Handle, 0,
nil, @BitmapSize, Bitmap.Canvas.Handle,
@BitmapPos, 0, @BlendFunction, ULW_ALPHA);
end;
procedure TForm5.FormDestroy(Sender: TObject);
begin
Bitmap.Free;
end;