Commit 9d3058aa authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Use SIF_RETURNPREV for SetScrollPos implementation.

parent c9c69dff
......@@ -518,18 +518,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetScrollInfo(HWND hwnd, INT nBar, LPSCROLLINFO in
* Note the ambiguity when 0 is returned. Use GetLastError
* to make sure there was an error (and to know which one).
*/
INT WINAPI DECLSPEC_HOTPATCH SetScrollPos( HWND hwnd, INT nBar, INT nPos, BOOL bRedraw)
int WINAPI DECLSPEC_HOTPATCH SetScrollPos( HWND hwnd, int bar, int pos, BOOL redraw )
{
SCROLLINFO info;
SCROLLBAR_INFO *infoPtr;
INT oldPos = 0;
if ((infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, FALSE ))) oldPos = infoPtr->curVal;
info.cbSize = sizeof(info);
info.nPos = nPos;
info.fMask = SIF_POS;
NtUserSetScrollInfo( hwnd, nBar, &info, bRedraw );
return oldPos;
info.nPos = pos;
info.fMask = SIF_POS | SIF_RETURNPREV;
return NtUserSetScrollInfo( hwnd, bar, &info, redraw );
}
......
......@@ -738,7 +738,6 @@ static void test_subclass(void)
res = SetScrollPos(hwnd, SB_CTL, 1, FALSE);
ok(res == 2, "SetScrollPos returned %Iu\n", res);
ok(set_scrollinfo.cbSize == sizeof(SCROLLINFO), "cbSize = %u\n", set_scrollinfo.cbSize);
todo_wine
ok(set_scrollinfo.fMask == (0x1000 | SIF_POS), "fMask = %x\n", set_scrollinfo.fMask);
ok(set_scrollinfo.nPos == 1, "nPos = %x\n", set_scrollinfo.nPos);
......@@ -780,7 +779,6 @@ static void test_subclass(void)
res = SetScrollPos(hwnd, SB_CTL, 1, FALSE);
ok(res == 0, "SetScrollPos returned %Iu\n", res);
ok(set_scrollinfo.cbSize == sizeof(SCROLLINFO), "cbSize = %u\n", set_scrollinfo.cbSize);
todo_wine
ok(set_scrollinfo.fMask == (0x1000 | SIF_POS), "fMask = %x\n", set_scrollinfo.fMask);
ok(set_scrollinfo.nPos == 1, "nPos = %x\n", set_scrollinfo.nPos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment