*Problem 1*

According to the WinAPI documentation:

"If the lprcScroll parameter is NULL, the positions of any child
windows in the window are offset by the amount specified by the dx and
dy parameters; invalid (unpainted) areas in the window are also
offset. ScrollWindow is faster when lprcScroll is NULL."

This means that since we call internally ScrollWindowEx when calling
ScrollWindow, we have, in that case, to pass the SW_SCROLLCHILDREN
flag.

What about that? Here is an example (winapi.inc at line 1268):

function ScrollWindow(hWnd: HWND; XAmount, YAmount: Integer;
 Rect, ClipRect: PRect): Boolean; inline;
begin
 if Rect = nil then
   Result := ScrollWindowEx(hWnd, XAmount, YAmount, Rect, ClipRect,
0, nil, SW_SCROLLCHILDREN)
 else
   Result := ScrollWindowEx(hWnd, XAmount, YAmount, Rect, ClipRect, 0, nil, 0);
end;

*Problem 2*

When using this function, we must repaint the area; in some example in
Delphi using ScrollWindow, it looked like that area was automatically
invalidated (unless someone can prove me wrong here). So my guess
number 2 is that we should also send the SW_INVALIDATE flag...

What about that? Here is a more complete example:

function ScrollWindow(hWnd: HWND; XAmount, YAmount: Integer;
 Rect, ClipRect: PRect): Boolean; inline;
begin
 if Rect = nil then
   Result := ScrollWindowEx(hWnd, XAmount, YAmount, Rect, ClipRect,
0, nil, SW_INVALIDATE or SW_SCROLLCHILDREN)
 else
   Result := ScrollWindowEx(hWnd, XAmount, YAmount, Rect, ClipRect,
0, nil, SW_INVALIDATE);
end;

Any feedback on this is... not appreciated... required :) And also to
look at the consequences of such a patch.

Best regards.

PS: I tested all that stuff in the lazarus VTV implementation to fixe
serious display bugs and this is working great: all the problems are
solved. I must say that for faster testing purposes, I used directly
ScrollWindowEx.

--
Alexandre Leclerc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to