Problems with DrawText under WinNt 4.0 SP1-SP5

Hi !

I am using the following code to manipulate the font, color and images on at
TStatusBar.
Under WinNT 4.0 SP1 - SP5 the text in StatusBar1.Panels.Items[1] recieves a
text from the main menu off the app.

I am not very comfortable with this way of doing things, so if anybody can
help, it would be very nice !

procedure TfrmMain.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel; const Rect: TRect);
var
 MyRect: TRect;
 Format: integer;
begin
  MyRect := Rect;
  StatusBar1.Color:=clBtnFace;
  if Panel = StatusBar1.Panels.Items[0] then
    ImageList2.Draw(StatusBar1.Canvas,Rect.Left+2,Rect.Top-1,0,true);
  if Panel = StatusBar1.Panels.Items[1] then
    begin
      StatusBar1.Canvas.Font.Color :=Info.XCOLOR;
      Format := DT_SINGLELINE or DT_LEFT or DT_VCENTER;
      StatusBar1.Canvas.Font.Style :=[fsBold];
    end
  else
    StatusBar1.Canvas.Font.Style :=[];
  if Panel = StatusBar1.Panels.Items[2] then
    ImageList2.Draw(StatusBar1.Canvas,Rect.Left+2,Rect.Top,3,true);

  DrawText(StatusBar1.Canvas.Handle,PChar(Panel.Text),-1,MyRect,Format);
end;

Petter
MediQS

Using D6