Ignore:
Timestamp:
Sep 26, 1999, 5:25:55 PM (26 years ago)
Author:
sandervl
Message:

ScrollWindow fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/scroll.cpp

    r1057 r1064  
    1 /* $Id: scroll.cpp,v 1.2 1999-09-26 10:10:00 sandervl Exp $ */
     1/* $Id: scroll.cpp,v 1.3 1999-09-26 15:25:55 sandervl Exp $ */
    22/*
    33 * Scrollbar control
     
    11231123                BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */)
    11241124{
    1125     INT action;
    1126     INT retVal = SCROLL_SetScrollInfo( hwnd, nBar, info, &action );
     1125  Win32BaseWindow *window;
     1126  INT action;
     1127  INT retVal = SCROLL_SetScrollInfo( hwnd, nBar, info, &action );
     1128
     1129    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1130    if(!window) {
     1131        dprintf(("SetScrollInfo window not found!"));
     1132        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1133        return FALSE;
     1134    }
    11271135
    11281136    if( action & SA_SSI_HIDE )
     
    12801288                LPSCROLLINFO info /* [IO] (info.fMask [I] specifies which values are to retrieve) */)
    12811289{
    1282     SCROLLBAR_INFO *infoPtr;
    1283 
     1290  Win32BaseWindow *window;
     1291  SCROLLBAR_INFO *infoPtr;
     1292
     1293    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1294    if(!window) {
     1295        dprintf(("GetScrollInfo window not found!"));
     1296        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1297        return FALSE;
     1298    }
    12841299    if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE;
    12851300    if (info->fMask & ~(SIF_ALL | SIF_DISABLENOSCROLL)) return FALSE;
     
    13151330                BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */ )
    13161331{
    1317     SCROLLINFO info;
    1318     SCROLLBAR_INFO *infoPtr;
    1319     INT oldPos;
     1332  Win32BaseWindow *window;
     1333  SCROLLINFO info;
     1334  SCROLLBAR_INFO *infoPtr;
     1335  INT oldPos;
     1336
     1337    dprintf(("SetScrollPos %x %d %d %d", hwnd, nBar, nPos, bRedraw));
     1338    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1339    if(!window) {
     1340        dprintf(("SetScrollPos window not found!"));
     1341        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1342        return FALSE;
     1343    }
    13201344
    13211345    if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return 0;
     
    13421366                INT nBar /* [I] One of SB_HORZ, SB_VERT, or SB_CTL */)
    13431367{
    1344     SCROLLBAR_INFO *infoPtr;
     1368  Win32BaseWindow *window;
     1369  SCROLLBAR_INFO *infoPtr;
     1370
     1371    dprintf(("GetScrollPos %x %d", hwnd, nBar));
     1372
     1373    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1374    if(!window) {
     1375        dprintf(("GetScrollPos window not found!"));
     1376        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1377        return 0;
     1378    }
    13451379
    13461380    if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return 0;
     
    13591393                BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */)
    13601394{
    1361     SCROLLINFO info;
     1395  Win32BaseWindow *window;
     1396  SCROLLINFO info;
     1397
     1398    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1399    if(!window) {
     1400        dprintf(("SetScrollRange window not found!"));
     1401        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1402        return FALSE;
     1403    }
    13621404
    13631405    info.cbSize = sizeof(info);
     
    14131455                LPINT lpMax  /* [O] Where to store maximum value */)
    14141456{
    1415     SCROLLBAR_INFO *infoPtr;
     1457  Win32BaseWindow *window;
     1458  SCROLLBAR_INFO *infoPtr;
     1459
     1460    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1461    if(!window) {
     1462        dprintf(("GetScrollRange window not found!"));
     1463        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1464        return FALSE;
     1465    }
    14161466
    14171467    if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar )))
     
    15181568    if(!window) {
    15191569        dprintf(("ShowScrollBar window not found!"));
    1520         SetLastError(ERROR_INVALID_HANDLE);
     1570        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    15211571        return 0;
    15221572    }
     
    15521602    if(!window) {
    15531603        dprintf(("EnableScrollBar window not found!"));
    1554         SetLastError(ERROR_INVALID_HANDLE);
     1604        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    15551605        return 0;
    15561606    }
Note: See TracChangeset for help on using the changeset viewer.