Hello!
I have a problem creating a window with a vertical scroll bar.
Here's what I try to do:
HWND InitializeCustomItem(....
.......
g_hWnd = CreateWindow(appName, appName,
WS_VISIBLE | WS_CHILD | WS_VSCROLL,
CW_USEDEFAULT, CW_USEDEFAULT, 240, 0,
hwndParent, NULL, g_hInst, NULL) ;
SCROLLINFO si;
ZeroMemory(&si, sizeof(si));
si.cbSize = sizeof(si);
si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE |
SIF_DISABLENOSCROLL;
si.nPos = 50;
si.nPage = 100;
si.nMin = 0;
si.nMax = appHeight;
SetScrollInfo(g_hWnd, SB_VERT, &si, TRUE);
. SetWindowLong(g_hWnd, GWL_WNDPROC, (LONG) WndProc);
....
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT uimessage, WPARAM wParam,
LPARAM lParam)
{
.....
I set appHeight to 120 at the beginning.
In response to WM_TODAYCUSTOM_QUERYREFRESHCACHE , I set the ptli->cyp
to appHeight and return true (only once, of course, except for
resizes)
Later I create a bitmap:
case WM_CREATE:
{
if (!done_once) {
hBitmap = Test_NewDIBSection(appWidth, /
*appHeight*/480, (void **)
&bitmapa);
hDC = GetDC(hwnd);
hDCMem = CreateCompatibleDC(hDC);
hOldBitmap = (HBITMAP) SelectObject(hDCMem,
hBitmap);
done_once = true;
}
....
}
which works fine, however this bitmap is limited to the appHeight
size, while
I would very much like to scroll it down to see more. My window's
scroll bar appears, but it doesn't move, as if everything there is to
see is already shown. Also, the main today screen scroll bar appears
if necessary - and it works fine, scrolling my bitmap, but
unfortunately I need the internal scroll bar.
I understand that I can probably do it manually by responding to
WM_VSCROLL messages, but I doubt it would be as effective as a pro-
made scrolling. Does anybody know (probably most do :-( ), how can I
scroll my bitmap? I'm pretty sure that a smooth way to do it exists,
but I am simply missing something and have no idea, what it might be.
Thanks for any help!
gegitor