Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Scrolling buttons on screen with Embedded VC++

Hi, I have the following problem:

When I scroll the window of my application, I can move the scrollbar, but the content of my window( text and some buttons) isn't moving. Can anyone help me?
here is the code for handling the WM_VSCROLL message that I use:

LRESULT DoVScrollScrollWnd (HWND hWnd, UINT wMsg, WPARAM wParam,
LPARAM lParam) {

int nScrollCode = (int)LOWORD(wParam);
int nPos = (short int)HIWORD(wParam);

SCROLLINFO si = {sizeof(SCROLLINFO),
SIF_PAGE|SIF_POS|SIF_RANGE|SIF_TRACKPOS, 0, 0, 0, 0,
0};
GetScrollInfo (hWnd, SB_VERT, &si);

int nNewPos = si.nPos;

switch (nScrollCode)
{
case SB_LINEUP:
nNewPos -= 2;
break;
case SB_LINEDOWN:
nNewPos += 2;
break;

case SB_PAGEUP:
nNewPos -= 10;
break;

case SB_PAGEDOWN:
nNewPos += 10;
break;

case SB_THUMBPOSITION:
nNewPos = nPos + si.nMin;
break;
}

si.fMask = SIF_POS;
si.nPos = nNewPos;
SetScrollInfo (hWnd, SB_VERT, &si, TRUE);

return 0;
}

hope you can help me out...

thx already,

Jack Sparrow
Sign In or Register to comment.