case WM_VSCROLL: //in switch(message) in WinProc
wmId = GetWindowLong((HWND) lParam, GWL_ID);
//only one scroll bar so don't check it
switch(LOWORD(wParam))
{
case SB_THUMBPOSITION:
case SB_THUMBTRACK:
nScrollPos = HIWORD(wParam);
break;
default:
break;
}
SetScrollPos (hDirectives, SB_CTL, nScrollPos, TRUE);
break;
//where
hDirectives = CreateWindow(TEXT("static"), NULL,
WS_CHILD | WS_BORDER | WS_VISIBLE | SS_RIGHT | SS_SUNKEN | WS_VSCROLL,
20, 20, 300, 300, hWnd,
(HMENU) ID_DIRECTIVE, ((LPCREATESTRUCT) lParam) ->hInstance, NULL);
窗口显示,我可以输入文本,但滚动条没有响应。