*** JvMenus.pas.orig	Mon Mar 29 15:47:22 2004
--- JvMenus.pas	Tue Apr 20 16:27:58 2004
***************
*** 660,665 ****
--- 660,666 ----
      // other usage fields
      FSelRect: TRect;
      FCheckedPoint: TPoint;
+     FFlatMenubar: boolean;
  
      procedure DrawBitmapShadow(X, Y: integer; B: TBitmap);
      procedure DrawImageBackground(ARect: TRect); override;
***************
*** 2766,2771 ****
--- 2767,2773 ----
  end;
  
  procedure TJvXPMenuItemPainter.DrawItemBackground(ARect: TRect);
+ const COLOR_MENUBAR = 30;
  begin
    with Canvas do
    begin
***************
*** 2783,2797 ****
        begin
          Brush.Assign(SelectionFrameBrush);
          Pen.Assign(SelectionFramePen);
        end
        else
!       begin
!         Brush.Color := clBtnFace;
!         Brush.Style := bsSolid;
!         Pen.Style := psClear;
!       end;
!       Rectangle(ARect);
! 
      end;
    end;
  end;
--- 2785,2806 ----
        begin
          Brush.Assign(SelectionFrameBrush);
          Pen.Assign(SelectionFramePen);
+         Rectangle(ARect);
        end
        else
!         if FFlatMenubar then
!         begin
!           Brush.Color := GetSysColor(COLOR_MENUBAR);
!           Brush.Style := bsSolid;
!           FillRect(ARect);
!         end
!         else
!         begin
!           Brush.Color := clBtnFace;
!           Brush.Style := bsSolid;
!           Pen.Style := psClear;
!           Rectangle(ARect);
!         end;
      end;
    end;
  end;
***************
*** 3056,3061 ****
--- 3065,3077 ----
      );
  end;
  
+ function CheckFlatMenubar: boolean;
+ const SPI_GETFLATMENU = $1022;
+ var b: BOOL;
+ begin
+   Result:= SystemParametersInfo(SPI_GETFLATMENU, 0, @b, 0) and b;
+ end;
+ 
  constructor TJvXPMenuItemPainter.Create(AOwner: TComponent);
  begin
    inherited;
***************
*** 3075,3080 ****
--- 3091,3097 ----
    FSeparatorColor := DefaultXPSeparatorColor;
    FCheckedImageBackColor := DefaultXPCheckedImageBackColor;
    FCheckedImageBackColorSelected := DefaultXPCheckedImageBackColorSelected;
+   FFlatMenubar:= CheckFlatMenubar;
  end;
  
  procedure TJvXPMenuItemPainter.UpdateFieldsFromMenu;
