procedure TMyProg.ProgressWndProc(var Msg: TMessage);
var
dc: HDC;
[color=red]oldfont: THandle;[/color]
rect: TRect;
Text: string;
begin
OldProgressWndProc(Msg);
if ((Msg.Msg = 1026) or (Msg.Msg = WM_PAINT)) and (Timer3.Enabled = False)
then
// Wenn die Progressbar neugezeichnet wurde,
// und somit die Zahl weg ist: Prozentzahl neu draufpinseln
begin
if (ProgressBar1.Max = 0) or (ProgressBar1.Position = 0) then
Text := '0%'
else if ProgressBar1.Max = ProgressBar1.Position then
Text := '100%'
else
Text := IntToStr(Trunc(100 / ProgressBar1.Max * ProgressBar1.Position))
+ '%';
dc := GetWindowDC(Progressbar1.Handle);
try
rect := ProgressBar1.ClientRect;
//InvalidateRect(Progressbar1.Handle, @rect, True);
if suiSkinEngine1.Active = True then
SetBkMode(
dc, TRANSPARENT);
SetTextColor(
dc, clBlack);
[color=red]oldfont := [/color]SelectObject(
dc, MyProg_Main.Font.Handle);
DrawText(
dc, PChar(Text), length(Text), rect, DT_SINGLELINE or DT_VCENTER
or DT_CENTER);
[color=red]SelectObject(
dc, oldfont);[/color]
finally
ReleaseDC(Progressbar1.Handle,
dc);
end;
end;
end;