|
-
December 5th, 2007, 05:05 PM
#1
Window repaint error?
i have a frame inside a static window inside a static window and a scrollbar.
im usin this to make a scrolling panel, it works but...
when i scroll it up then back down, if the frame goes above the top of the main container 'StaticLeftContainerhWnd' i get streaks of the frame.
heres some code
inside the main window proc in the WM_CREATE msg i have
Code:
ScrollbarhWnd = CreateWindowEx(0, "SCROLLBAR", NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | SBS_VERT, 154, 0, 16, 240, hwnd, (HMENU)IDC_SCROLLBAR, GetModuleHandle(NULL), NULL);
StaticLeftContainerhWnd = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 174, 240, hwnd, (HMENU)IDC_STATICLEFTCONTAINER, GetModuleHandle(NULL), NULL);
StaticLeftScrollhWnd = CreateWindowEx(0, "STATIC", NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | SS_BLACKFRAME, 0, 0, 154, 240, StaticLeftContainerhWnd, (HMENU)IDC_STATICLEFTSCROLL, GetModuleHandle(NULL), NULL);
FramehWnd = CreateWindowEx(WS_EX_NOPARENTNOTIFY, "BUTTON", "Caption", WS_CHILDWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_GROUPBOX, 2, 3, 150, 40, StaticLeftScrollhWnd, (HMENU)IDC_FRAMENAME, GetModuleHandle(NULL), NULL);
and in the WM_SCROLL msg
Code:
case WM_VSCROLL:
{
siScrollInfo.nPos = GetScrollPos(ScrollbarhWnd, SB_CTL);
switch (LOWORD(wParam))
{
case SB_LINEUP:
{
if (siScrollInfo.nPos > 0) {
siScrollInfo.nPos--;
}
break;
}
case SB_LINEDOWN:
{
if (siScrollInfo.nPos < siScrollInfo.nMax) {
siScrollInfo.nPos++;
}
break;
}
}
SetWindowPos(StaticLeftScrollhWnd, 0, 0, -siScrollInfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
SetScrollPos(ScrollbarhWnd, SB_CTL, siScrollInfo.nPos, true);
break;
}
heres a screenshot to see whats actually goin on

ive tride updatewindow() on all the hwnds including the main window
ive tried invalidaterect() on all the hwnds including the main window
in different orders and tryin different 1s one at a time
i dont know whats going on, any help would be awesome
thank you,
chrunchy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|