var
Points: array [0..11] of TPoint;
h, w, Max_Left, aktuell_Left, X_Pos_Icon, Diff_Left: Integer;
begin
with FBalloonTip do
begin
//
Max_Left := Screen.DesktopWidth - Width - 20;
// X-Position des Icons
X_Pos_Icon := FindTrayIcon(tnid).X + 8;
// berechnete X-Position des Pfeils
aktuell_Left := X_Pos_Icon - (3 * C);
//
Diff_Left := Max_Left - aktuell_Left;
h := Height;
w := Width;
Points[0].X := C; Points[0].Y := 0;
Points[1].X := 0; Points[1].Y := C;
Points[2].X := 0; Points[2].Y := h - (2 * C);
Points[3].X := C; Points[3].Y := h - C;
//
If Diff_Left > 0 then
begin
Left := aktuell_Left;
Points[4].X := (2 * C); Points[4].Y := h - C;
Points[5].X := (3 * C); Points[5].Y := h; //Pfeil rechts
Points[6].X := (3 * C); Points[6].Y := h - C;
end
else
begin
Left := Max_Left;
Points[4].X := X_Pos_Icon - Left - C; Points[4].Y := h - C;
Points[5].X := X_Pos_Icon - Left; Points[5].Y := h;
Points[6].X := X_Pos_Icon - Left; Points[6].Y := h - C;
end;
Points[7].X := w - C; Points[7].Y := h - C;
Points[8].X := w; Points[8].Y := h - (2 * C);
Points[9].X := w; Points[9].Y := C;
Points[10].X := w - C; Points[10].Y := 0;
Points[11].X := C; Points[11].Y := 0;
// Points[5].X := (2 * C) + (C div 2); Points[5].Y := h; //Pfeil mittig
// Points[5].X := (2 * C); Points[5].Y := h; //Pfeil links
// Form aufbauen
SetWindowRgn(
Handle, CreatePolygonRgn(Points, 11, WINDING), True);
// Rahmen um die Form aufbauen
Canvas.Pen.Width := 2;
Canvas.Pen.Style := psInsideFrame;
Canvas.Polyline(Points);
end;
end;