if StyleObject <>
nil then
begin
StyleObject.Active := kwdsActive
in AWindow.State;
StyleObject.BoundsRect := AWindow.Rect;
if (ADPI > DPI_DEFAULT)
and (AObject = '
Title')
then
begin
StyleObject := StyleObject.FindObjectByName('
Image');
if StyleObject <>
nil then
begin
StyleObject := StyleObject.FindObjectByName('
Title');
if StyleObject <>
nil then
begin
R := StyleObject.BoundsRect;
R.Bottom := MulDiv(AWindow.ClipRect.Bottom, ADPI, DPI_DEFAULT);
SaveBoundsRect := StyleObject.BoundsRect;
StyleObject.BoundsRect := R;
StyleObject.FStopDrawChilds := True;
if (StyleObject.MarginLeft + StyleObject.MarginRight = 0)
or
(StyleObject.MarginTop + StyleObject.MarginBottom = 0)
then
begin
Buffer := TBitmap.Create;
try
Buffer.SetSize(R.Width, AWindow.ClipRect.Height);
R := Rect(0, 0, Buffer.Width, Buffer.Height);
StyleObject.BoundsRect := R;
StyleObject.Draw(Buffer.Canvas, R);
R := AWindow.ClipRect;
R.Bottom := MulDiv(R.Bottom, ADPI, DPI_DEFAULT);
DrawStretchBitmap(Buffer, Canvas, R);
finally
Buffer.Free;
end;
end
else
StyleObject.Draw(Canvas, R, ADPI);
StyleObject.FStopDrawChilds := False;
StyleObject.BoundsRect := SaveBoundsRect;
end
else
StyleObject.Draw(Canvas, AWindow.ClipRect, ADPI);
// Hier der Absturz. Bzw. steht hier der Cursor bei der Exception, wenn ich "Anhalten" drücke. StyleObject = nil
end
else
StyleObject.Draw(Canvas, AWindow.ClipRect, ADPI);
end
else
StyleObject.Draw(Canvas, AWindow.ClipRect, ADPI);
end;