*** JvMenus.pas.orig	Mon Mar 29 15:47:22 2004
--- JvMenus.pas	Tue Apr 20 16:51:52 2004
***************
*** 736,741 ****
--- 736,750 ----
      not (Item.Parent.Owner is TMainMenu);
  end;
  
+ var GFlatMenubar: boolean = false;
+ 
+ procedure CheckFlatMenubar;
+ const SPI_GETFLATMENU = $1022;
+ var b: BOOL;
+ begin
+   GFlatMenubar:= SystemParametersInfo(SPI_GETFLATMENU, 0, @b, 0) and b;
+ end;
+ 
  procedure MenuWndMessage(Menu: TMenu; var AMsg: TMessage; var Handled: Boolean);
  var
    Message: TMessage;
***************
*** 775,780 ****
--- 784,791 ----
          begin
            Menu.ProcessMenuChar(TWMMenuChar(AMsg));
          end;
+       WM_SETTINGCHANGE:
+         CheckFlatMenubar;
      end;
  end;
  
***************
*** 846,851 ****
--- 857,863 ----
  
    // set default values that are not 0
    FTextVAlignment := vaMiddle;
+   CheckFlatMenubar;
  end;
  
  destructor TJvMainMenu.Destroy;
***************
*** 2766,2771 ****
--- 2778,2784 ----
  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;
--- 2796,2817 ----
        begin
          Brush.Assign(SelectionFrameBrush);
          Pen.Assign(SelectionFramePen);
+         Rectangle(ARect);
        end
        else
!         if GFlatMenubar 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;
