procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Top := 300;
Form1.Width := 169;
Form1.Height := 100;
Form1.Left := 1111;
Form1.Timer1Timer(self); // Direkt nach dem Start das Timer-Event aufrufen um nicht für kurze Zeit die komplette Form zu zeigen
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
t: String;
h, m, s: Integer;
s1, s2, s4, s8, s16, s32, m1, m2, m4, m8, m16, m32, h1, h2, h4, h8, h16, NewRgn: HRGN;
begin
DateTimeToString(t, 'h', Now);
h := StrToInt(t);
DateTimeToString(t, 'n', Now);
m := StrToInt(t);
DateTimeToString(t, 's', Now);
s := StrToInt(t);
NewRgn := CreateRectRgn(0,0,0,0);
if (s div 32 >= 1) then begin
s32 := CreateEllipticRgn(5, 60, 25, 80);
s := s-32;
end else
s32 := CreateEllipticRgn(0, 0, 0, 0);
if (s div 16 >= 1) then begin
s16 := CreateEllipticRgn(30, 60, 50, 80);
s := s-16;
end else
s16 := CreateEllipticRgn(0, 0, 0, 0);
if (s div 8 >= 1) then begin
s8 := CreateEllipticRgn(55, 60, 75, 80);
s := s-8;
end else
s8 := CreateEllipticRgn(0, 0, 0, 0);
if (s div 4 >= 1) then begin
s4 := CreateEllipticRgn(80, 60, 100, 80);
s := s-4;
end else
s4 := CreateEllipticRgn(0, 0, 0, 0);
if (s div 2 >= 1) then begin
s2 := CreateEllipticRgn(105, 60, 125, 80);
s := s-2;
end else
s2 := CreateEllipticRgn(0, 0, 0, 0);
if (s div 1 >= 1) then begin
s1 := CreateEllipticRgn(130, 60, 150, 80);
end else
s1 := CreateEllipticRgn(0, 0, 0, 0);
CombineRgn(NewRgn, s32, s16, RGN_OR);
CombineRgn(NewRgn, s8, NewRgn, RGN_OR);
CombineRgn(NewRgn, s4, NewRgn, RGN_OR);
CombineRgn(NewRgn, s2, NewRgn, RGN_OR);
CombineRgn(NewRgn, s1, NewRgn, RGN_OR);
if (m div 32 >= 1) then begin
m32 := CreateEllipticRgn(5, 35, 25, 55);
m := m-32;
end else
m32 := CreateEllipticRgn(0, 0, 0, 0);
if (m div 16 >= 1) then begin
m16 := CreateEllipticRgn(30, 35, 50, 55);
m := m-16;
end else
m16 := CreateEllipticRgn(0, 0, 0, 0);
if (m div 8 >= 1) then begin
m8 := CreateEllipticRgn(55, 35, 75, 55);
m := m-8;
end else
m8 := CreateEllipticRgn(0, 0, 0, 0);
if (m div 4 >= 1) then begin
m4 := CreateEllipticRgn(80, 35, 100, 55);
m := m-4;
end else
m4 := CreateEllipticRgn(0, 0, 0, 0);
if (m div 2 >= 1) then begin
m2 := CreateEllipticRgn(105, 35, 125, 55);
m := m-2;
end else
m2 := CreateEllipticRgn(0, 0, 0, 0);
if (m div 1 >= 1) then begin
m1 := CreateEllipticRgn(130, 35, 150, 55);
end else
m1 := CreateEllipticRgn(0, 0, 0, 0);
CombineRgn(NewRgn, m32, NewRgn, RGN_OR);
CombineRgn(NewRgn, m16, NewRgn, RGN_OR);
CombineRgn(NewRgn, m8, NewRgn, RGN_OR);
CombineRgn(NewRgn, m4, NewRgn, RGN_OR);
CombineRgn(NewRgn, m2, NewRgn, RGN_OR);
CombineRgn(NewRgn, m1, NewRgn, RGN_OR);
if (h div 16 >= 1) then begin
h16 := CreateEllipticRgn(30, 10, 50, 30);
h := h-16;
end else
h16 := CreateEllipticRgn(0, 0, 0, 0);
if (h div 8 >= 1) then begin
h8 := CreateEllipticRgn(55, 10, 75, 30);
h := h-8;
end else
h8 := CreateEllipticRgn(0, 0, 0, 0);
if (h div 4 >= 1) then begin
h4 := CreateEllipticRgn(80, 10, 100, 30);
h := h-4;
end else
h4 := CreateEllipticRgn(0, 0, 0, 0);
if (h div 2 >= 1) then begin
h2 := CreateEllipticRgn(105, 10, 125, 30);
h := h-2;
end else
h2 := CreateEllipticRgn(0, 0, 0, 0);
if (h div 1 >= 1) then begin
h1 := CreateEllipticRgn(130, 10, 150, 30);
end else
h1 := CreateEllipticRgn(0, 0, 0, 0);
CombineRgn(NewRgn, h16, NewRgn, RGN_OR);
CombineRgn(NewRgn, h8, NewRgn, RGN_OR);
CombineRgn(NewRgn, h4, NewRgn, RGN_OR);
CombineRgn(NewRgn, h2, NewRgn, RGN_OR);
CombineRgn(NewRgn, h1, NewRgn, RGN_OR);
SetWindowRgn(
Handle, NewRgn, true);
SetWindowPos(
Handle, HWND_TOPMOST, Left,Top, Width, Height, SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
end;
procedure TForm1.FormPaint(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_Hide);
end;