Q&A

  • ActiveX구현시 Scroll로 화면이 깨지는 현상발생...
제가 ActiveForm으로 ActiveX구현시 Scroll로 화면이 깨지는 현상발생

AxCtrls.Pas를 아래와 같이 수정해서 해결했습니다.

도움이 되시기를...



function TActiveXControl.SetObjectRects(const rcPosRect: TRect;

const rcClipRect: TRect): HResult;

var

IxRect: TRect;

NewWindowRgn: HRGN;

DoIntersect: Boolean;

label the_end;

begin

try

if (@rcPosRect = nil) or (@rcClipRect = nil) then

Begin

Result := E_POINTER;

goto the_end;

end;



if FWinControl.HandleAllocated then

Begin

DoIntersect := IntersectRect(IxRect, rcPosRect, rcClipRect);

NewWindowRgn := 0;



if DoIntersect and (not EqualRect(IxRect, rcPosRect)) then

Begin

OffsetRect(IxRect, -rcPosRect.Left, -rcPosRect.Top);

NewWindowRgn := CreateRectRgnIndirect(IxRect);

end;



SetWindowRgn(FWinControl.Handle, NewWindowRgn, True);

IxRect := Bounds(rcPosRect.left, rcPosRect.Top,

IxRect.Right - IxRect.Left + rcClipRect.Left - rcPosRect.Left,

IxRect.Bottom - IxRect.Top + rcClipRect.Top - rcPosRect.Top);

FWinControl.BoundsRect := IxRect;

{SetWindowPos(FWinControl.Handle, 0, rcPosRect.left, rcPosRect.top,

IxRect.Right - IxRect.Left + rcClipRect.Left - rcPosRect.Left,

IxRect.Bottom - IxRect.Top + rcClipRect.Top - rcPosRect.Top,

SWP_NOZORDER or SWP_NOACTIVATE);}

end;

Result := S_OK;

the_end:

except

Result := HandleException;

end;

end;

1  COMMENTS
  • Profile
    kylix 2001.03.24 02:04
    검색해보세요. ActiveForm의 스크롤문제는 여러번 답변이 되었던 걸로 생각되는데...



    elyaho wrote:

    > 제가 ActiveForm으로 ActiveX구현시 Scroll로 화면이 깨지는 현상발생

    > AxCtrls.Pas를 아래와 같이 수정해서 해결했습니다.

    > 도움이 되시기를...

    >

    > function TActiveXControl.SetObjectRects(const rcPosRect: TRect;

    > const rcClipRect: TRect): HResult;

    > var

    > IxRect: TRect;

    > NewWindowRgn: HRGN;

    > DoIntersect: Boolean;

    > label the_end;

    > begin

    > try

    > if (@rcPosRect = nil) or (@rcClipRect = nil) then

    > Begin

    > Result := E_POINTER;

    > goto the_end;

    > end;

    >

    > if FWinControl.HandleAllocated then

    > Begin

    > DoIntersect := IntersectRect(IxRect, rcPosRect, rcClipRect);

    > NewWindowRgn := 0;

    >

    > if DoIntersect and (not EqualRect(IxRect, rcPosRect)) then

    > Begin

    > OffsetRect(IxRect, -rcPosRect.Left, -rcPosRect.Top);

    > NewWindowRgn := CreateRectRgnIndirect(IxRect);

    > end;

    >

    > SetWindowRgn(FWinControl.Handle, NewWindowRgn, True);

    > IxRect := Bounds(rcPosRect.left, rcPosRect.Top,

    > IxRect.Right - IxRect.Left + rcClipRect.Left - rcPosRect.Left,

    > IxRect.Bottom - IxRect.Top + rcClipRect.Top - rcPosRect.Top);

    > FWinControl.BoundsRect := IxRect;

    > {SetWindowPos(FWinControl.Handle, 0, rcPosRect.left, rcPosRect.top,

    > IxRect.Right - IxRect.Left + rcClipRect.Left - rcPosRect.Left,

    > IxRect.Bottom - IxRect.Top + rcClipRect.Top - rcPosRect.Top,

    > SWP_NOZORDER or SWP_NOACTIVATE);}

    > end;

    > Result := S_OK;

    > the_end:

    > except

    > Result := HandleException;

    > end;

    > end;