*** C:/Program Files (x86)/Borland/BDS/4.0/source/Win32/vcl/ComCtrls.pas.original	Fri Mar 03 10:02:00 2006
--- C:/Program Files (x86)/Borland/BDS/4.0/source/Win32/vcl/ComCtrls.pas	Fri Nov 10 17:38:48 2006
***************
*** 3092,3097 ****
--- 3092,3098 ----
      FOurFont: Integer;
      FStockFont: Integer;
      FHideClippedButtons: Boolean;
+     FIsNewerThanWin95: Boolean; // 2006-11-08  P. Kolla for Win95 compatibility
      function IsGradientEndColorStored: Boolean;
      function ButtonIndex(OldIndex, ALeft, ATop: Integer): Integer;
      procedure CanvasChanged(Sender: TObject);
***************
*** 17354,17359 ****
--- 17355,17361 ----
  { TToolBar }
  
  constructor TToolBar.Create(AOwner: TComponent);
+ var Info: TOSVersionInfoA; // 2006-11-08  P. Kolla for Win95 compatibility
  begin
    inherited Create(AOwner);
    ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents,
***************
*** 17368,17373 ****
--- 17370,17381 ----
    FCustomizing := False;
    FNewStyle := True;
    FWrapable := True;
+   // 2006-11-08  P. Kolla for Win95 compatibility
+   Info.dwOSVersionInfoSize := sizeof(Info);
+   GetVersionEx(Info);
+   FIsNewerThanWin95 := ((Info.dwMajorVersion=4) and (Info.dwMinorVersion>0))
+                     or (Info.dwMajorVersion>4);
+   // 2006-11-08  end of changes
    FButtons := TList.Create;
    FCanvas := TControlCanvas.Create;
    TControlCanvas(FCanvas).Control := Self;
***************
*** 19038,19044 ****
                CDDS_PREPAINT:
                begin
                  CustomDrawn := IsCustomDrawn(dtControl, cdPrePaint);
!                 if CustomDrawn or (DrawingStyle = dsGradient) then
                  begin
                    try
                      FCanvas.Handle := nmcd.hdc;
--- 19046,19053 ----
                CDDS_PREPAINT:
                begin
                  CustomDrawn := IsCustomDrawn(dtControl, cdPrePaint);
!                 if CustomDrawn
!                 or ((DrawingStyle = dsGradient) and (FIsNewerThanWin95)) then // 2006-11-08  P. Kolla for Win95 compatibility
                  begin
                    try
                      FCanvas.Handle := nmcd.hdc;
***************
*** 19061,19067 ****
                  end;
                  if IsCustomDrawn(dtItem, cdPrePaint) or IsCustomDrawn(dtItem, cdPreErase) or
                     IsCustomDrawn(dtItem, cdPreErase) or
!                 (DrawingStyle = dsGradient) then
                    Result := Result or CDRF_NOTIFYITEMDRAW;
                  if IsCustomDrawn(dtItem, cdPostPaint) then
                    Result := Result or CDRF_NOTIFYPOSTPAINT;
--- 19070,19076 ----
                  end;
                  if IsCustomDrawn(dtItem, cdPrePaint) or IsCustomDrawn(dtItem, cdPreErase) or
                     IsCustomDrawn(dtItem, cdPreErase) or
!                    ((DrawingStyle = dsGradient) and (FIsNewerThanWin95)) then // 2006-11-08  P. Kolla for Win95 compatibility
                    Result := Result or CDRF_NOTIFYITEMDRAW;
                  if IsCustomDrawn(dtItem, cdPostPaint) then
                    Result := Result or CDRF_NOTIFYPOSTPAINT;
***************
*** 19097,19103 ****
                      Flags := [];
                      DefaultDraw := CustomDrawButton(Button,
                        TCustomDrawState(Word(nmcd.uItemState)), cdPrePaint, Flags);
!                     if DefaultDraw and (DrawingStyle = dsGradient) then
                      begin
                        Flags := [];
                        DefaultDraw := GradientDrawButton(Button,
--- 19106,19112 ----
                      Flags := [];
                      DefaultDraw := CustomDrawButton(Button,
                        TCustomDrawState(Word(nmcd.uItemState)), cdPrePaint, Flags);
!                     if DefaultDraw and ((DrawingStyle = dsGradient) and (FIsNewerThanWin95)) then // 2006-11-08  P. Kolla for Win95 compatibility
                      begin
                        Flags := [];
                        DefaultDraw := GradientDrawButton(Button,
