hey,

i cant figure out how to get scrollwindow to work the way i want it to. i know
that if the arguments for the address of the scrolling rectangle and the
clipping rectangle are both NULL, then the entire client area gets scrolled,
and this works fine, but what if either one of them (or both, as in my case)
are not NULL?

i created a small rectangle in the upper left corner of the client area, and
specified the area of this rectangle as my scrolling rectangle. for the
'clipping rectangle', i specified an area of equal size and adjacent to the
rectangle i had drawn. i was hoping that with each click of the mouse, what i
would see on the window was the rectangle moving by one pixel to the right, but
nothing happens!! the rectangle just sits there...here is the relevant code:

.IF ms==WM_PAINT
invoke BeginPaint,hnd,addr ps ;hnd==window handle,
ps==PAINTSTRUCT
mov hdc,eax
.IF strt==1
invoke Rectangle,hdc,0,0,60,60 ;so the rectangle is drawn only
once, when the program first starts
mov strt,0
.ENDIF
invoke EndPaint,hnd,addr ps


.ELSEIF ms==WM_LBUTTONUP
mov rt.left,0 ;rt is a RECT structure
mov rt.top,0
mov rt.right,60
mov rt.bottom,60

mov rt1.left,60 ;rt1 is also a RECT structure
mov rt1.top,0
mov rt1.right,120
mov rt1.bottom,60

invoke ScrollWindow,hnd,1,0,addr rt,addr rt1


xxxxxxxxxxxxxxxxxxxxxxx

isn't scrollwindow supposed to move the rectangle to the right???

thanks in advance
Posted on 2003-05-06 22:10:16 by AnotherWay83
From SDK

Note The ScrollWindow function is provided for backward compatibility. New applications should use the ScrollWindowEx function.

BOOL ScrollWindow(
HWND hWnd, // handle to window
int XAmount, // horizontal scrolling
int YAmount, // vertical scrolling
CONST RECT *lpRect, // client area
CONST RECT *lpClipRect // clipping rectangle
);

XAmount:
Specifies the amount, in device units, of horizontal scrolling. If the window being scrolled has the CS_OWNDC or CS_CLASSDC style, then this parameter uses logical units rather than device units. This parameter must be a negative value to scroll the content of the window to the left.
Posted on 2003-05-07 07:08:36 by Brad
AnotherWay83,

sorry, was asleep and read your post wrong,
scrollwindowex has flags for control, here may help:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/scrollbars/scrollbarreference/scrollbarfunctions/scrollwindowex.asp
Posted on 2003-05-07 08:22:34 by Brad
thanks brad, but i already have the win32.hlp file so its all described in there, but i cant get it to work...altho the description for scrollwindowEx is more detailed at the msdn site than it is ine win32 help file...ill try again tho
Posted on 2003-05-07 14:05:23 by AnotherWay83
bleh...screw this crap. it only seems to work predictably when both the lpRect and clipRect are NULL...if not then it does stuff that i just cant understand...and this goes for both scrollwindow and scrollwindowex

besides, i suspect that scrollwindow/ex uses a blt function anyway (i dont know for sure but for such operations it seems reasonable considering that the blt functions are quite fast and are often used by other functions like FillRect, thats what i read in charles petzold's book anyway) and those are thoroughly explained in his book anyway, so i'll just go with those

thanks anyway
Posted on 2003-05-07 15:57:42 by AnotherWay83