TsSkinProvider.AC_WMGetMinMaxInfo bug

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33191

    Hi Serge,

    Please run P04.exe inside Post3_Reproduce.zip.

    Now please click on “Maximise” button.

    Did you see that it leaves gap on top? We think this gap is about 4 pixels.

    It is supposed to cover the entire monitor work area.

    The bug is in method TsSkinProvider.AC_WMGetMinMaxInfo(…)

    Original — procedure TsSkinProvider.AC_WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo);

    CODE
    procedure TsSkinProvider.AC_WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo);
    var
      R : TRect;
      sbwf, yOffs : integer;
    begin
    if FDrawNonClientArea {and SkinData.SkinManager.ExtendedBorders {and (BorderForm <> nil)} { Extended borders are used } and (Form.FormStyle <> fsMDIChild) and (Form.Parent = nil) then begin
          R := acWorkRect(Form);
        sbwf := SysBorderWidth(Form.Handle, BorderForm, False);
        if CaptionHeight(True) > CaptionHeight(False) + sbwf
          then yOffs := CaptionHeight(True) – CaptionHeight(False) – sbwf
          else yOffs := sbwf;
        Message.MinMaxInfo^.ptMaxPosition.Y := yOffs – sbwf;
        sbwf := sbwf * 2;
        Message.MinMaxInfo^.ptMaxSize.Y := HeightOf(R) – yOffs + sbwf;
        Message.MinMaxInfo^.ptMaxSize.X := WidthOf(R) + sbwf;
        Message.Result := 0;
      end;
      OldWndProc(TMessage(Message));
    end;

    It seems that the calculation of yOffs is wrong? Would you be able to have a look
    into this?

    It seems that you need to check that the form has caption before assigning value to yOffs.
    Otherwise just leaves it at 0. And hence our modifications below. Now, if you compile
    the demo project with our mods, “Maximise” would cover the entire monitor work area.

    We are not sure if this is correct? What were the adjustments originally for?

    Would you please kindly have a look into this?

    Please note that we do not want to set our form border style to bsNone!

    Our modification — procedure TsSkinProvider.AC_WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo);

    CODE
    procedure TsSkinProvider.AC_WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo);
    var
      R : TRect;
      sbwf, yOffs : integer;
    begin
      if FDrawNonClientArea and (Form.FormStyle <> fsMDIChild) and (Form.Parent = nil) then
        begin
          R := acWorkRect(Form);
          sbwf := SysBorderWidth(Form.Handle, BorderForm, False);

          if ( (GetWindowLong(Form.Handle, GWL_STYLE) and WS_CAPTION = WS_CAPTION) ) then
            begin
              if CaptionHeight(True) > CaptionHeight(False) + sbwf then
                yOffs := CaptionHeight(True) – CaptionHeight(False) – sbwf
              else
                yOffs := sbwf;
            end
          else
            yOffs := 0;

          Message.MinMaxInfo^.ptMaxPosition.Y := yOffs – sbwf;

          sbwf := sbwf * 2;
          Message.MinMaxInfo^.ptMaxSize.Y := HeightOf(R) – yOffs + sbwf;

          Message.MinMaxInfo^.ptMaxSize.X := WidthOf(R) + sbwf;
          Message.Result := 0;
        end;
        
      OldWndProc(TMessage(Message));
    end;

    Best regards,

    Be Hai Nguyen.

    #40223
    Support
    Keymaster

    Thank you for example, I'll check it today or tomorrow.

    #40520

    This appears to be fixed in version 6.44.

    Thank you and best regards.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.