SCROLLINFO info;
RECT childRect, clientRect;
HWND *list;
+ DWORD style;
GetClientRect( hwnd, &clientRect );
SetRectEmpty( &childRect );
int i;
for (i = 0; list[i]; i++)
{
- DWORD style = GetWindowLongW( list[i], GWL_STYLE );
+ style = GetWindowLongW( list[i], GWL_STYLE );
if (style & WS_MAXIMIZE)
{
HeapFree( GetProcessHeap(), 0, list );
info.cbSize = sizeof(info);
info.fMask = SIF_POS | SIF_RANGE;
- /* set the specific */
+ /* set the specific values and apply but only if window style allows */
+ style = GetWindowLongW( hwnd, GWL_STYLE );
switch( scroll )
{
case SB_BOTH:
case SB_HORZ:
- info.nMin = childRect.left;
- info.nMax = childRect.right - clientRect.right;
- info.nPos = clientRect.left - childRect.left;
- SetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
+ if (style & (WS_HSCROLL | WS_VSCROLL))
+ {
+ info.nMin = childRect.left;
+ info.nMax = childRect.right - clientRect.right;
+ info.nPos = clientRect.left - childRect.left;
+ SetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
+ }
if (scroll == SB_HORZ) break;
/* fall through */
case SB_VERT:
- info.nMin = childRect.top;
- info.nMax = childRect.bottom - clientRect.bottom;
- info.nPos = clientRect.top - childRect.top;
- SetScrollInfo(hwnd, SB_VERT, &info, TRUE);
+ if (style & (WS_HSCROLL | WS_VSCROLL))
+ {
+ info.nMin = childRect.top;
+ info.nMax = childRect.bottom - clientRect.bottom;
+ info.nPos = clientRect.top - childRect.top;
+ SetScrollInfo(hwnd, SB_VERT, &info, TRUE);
+ }
break;
}
}
ok(si.nMax != 100, "expected !100\n");
}
else
-todo_wine
ok(!ret, "style %#x: GetScrollInfo(SB_HORZ) should fail\n", style[i]);
ret = GetScrollInfo(mdi_client, SB_VERT, &si);
ok(si.nMax != 100, "expected !100\n");
}
else
-todo_wine
ok(!ret, "style %#x: GetScrollInfo(SB_VERT) should fail\n", style[i]);
DestroyWindow(mdi_child);