Changeset 5060


Ignore:
Timestamp:
Feb 3, 2001, 7:52:03 PM (24 years ago)
Author:
sandervl
Message:

Get/SetWindowLongA fixes (last error) + focus hack for realplayer 8

Location:
trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/user32/oslibwin.cpp

    r4825 r5060  
    1 /* $Id: oslibwin.cpp,v 1.85 2000-12-17 15:04:10 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.86 2001-02-03 18:52:02 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    6969        Owner = HWND_DESKTOP;
    7070  }
    71   BOOL TopLevel = hwndParent == HWND_DESKTOP;
    7271
    7372  if(classStyle & CS_SAVEBITS_W) dwWinStyle |= WS_SAVEBITS;
     
    8887
    8988  return WinCreateWindow (hwndParent,
    90                           hwndParent == HWND_DESKTOP ? WIN32_STDFRAMECLASS : WIN32_STDCLASS,
     89                          (hwndParent == HWND_DESKTOP) ? WIN32_STDFRAMECLASS : WIN32_STDCLASS,
    9190                          pszName, dwWinStyle, 0, 0, 0, 0,
    9291                          Owner, (fHWND_BOTTOM) ? HWND_BOTTOM : HWND_TOP,
  • TabularUnified trunk/src/user32/win32wbase.cpp

    r5056 r5060  
    1 /* $Id: win32wbase.cpp,v 1.231 2001-02-02 19:04:03 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.232 2001-02-03 18:52:02 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    889889    if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)
    890890    {
    891     dprintf(("WARNING: WM_NCACTIVATE return code = FALSE -> cancel processing"));
     891        dprintf(("WARNING: WM_NCACTIVATE return code = FALSE -> cancel processing"));
    892892        return 0;
    893893    }
     
    904904            threadidhwnd = O32_GetWindowThreadProcessId(hwndOS2Win, &procidhwnd);
    905905    }
     906//Warning: temporary hack to force focus to newly created window
     907//RealPlayer 8 does not pass WM_ACTIVATE to defwindowproc and doesn't call
     908//setfocus -> keyboard focus not set
     909//TODO: Find real cause!!
     910    if(GetFocus() == 0 && fActivate) {
     911        if(!(getStyle() & WS_MINIMIZE))
     912            SetFocus(getWindowHandle());
     913    }
     914//Warning: temporary hack to force focus to newly created window
    906915
    907916    if(fActivate) {
     
    14241433
    14251434    case WM_ACTIVATE:
    1426     /* The default action in Windows is to set the keyboard focus to
    1427      * the window, if it's being activated and not minimized */
     1435        /* The default action in Windows is to set the keyboard focus to
     1436         * the window, if it's being activated and not minimized */
    14281437        if (LOWORD(wParam) != WA_INACTIVE) {
    1429         if(!(getStyle() & WS_MINIMIZE))
    1430             SetFocus(getWindowHandle());
     1438            if(!(getStyle() & WS_MINIMIZE))
     1439                SetFocus(getWindowHandle());
    14311440        }
    14321441        return 0;
     
    25622571}
    25632572//******************************************************************************
     2573//Note: does not set last error if no parent (verified in NT4, SP6)
    25642574//******************************************************************************
    25652575HWND Win32BaseWindow::GetParent()
     
    33063316                }
    33073317                dprintf(("WARNING: SetWindowLong%c %x %d %x returned %x INVALID index!", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value));
    3308                 SetLastError(ERROR_INVALID_PARAMETER);
     3318                SetLastError(ERROR_INVALID_INDEX);      //verified in NT4, SP6
    33093319                return 0;
    33103320    }
     3321    //Note: NT4, SP6 does not set the last error to 0
    33113322    SetLastError(ERROR_SUCCESS);
    33123323    dprintf2(("SetWindowLong%c %x %d %x returned %x", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value, oldval));
     
    33473358            break;
    33483359        }
    3349         SetLastError(ERROR_INVALID_PARAMETER);
     3360        SetLastError(ERROR_INVALID_INDEX);      //verified in NT4, SP6
    33503361        return 0;
    33513362    }
    33523363    dprintf2(("GetWindowLongA %x %d %x", getWindowHandle(), index, value));
     3364    //Note: NT4, SP6 does not set the last error to 0
     3365    SetLastError(ERROR_SUCCESS);
    33533366    return value;
    33543367}
     
    33633376        oldval = ((WORD *)userWindowLong)[index/2];
    33643377        ((WORD *)userWindowLong)[index/2] = value;
     3378        //Note: NT4, SP6 does not set the last error to 0
     3379        SetLastError(ERROR_SUCCESS);
    33653380        return oldval;
    33663381    }
    3367     SetLastError(ERROR_INVALID_PARAMETER);
     3382    SetLastError(ERROR_INVALID_INDEX);  //verified in NT4, SP6
    33683383    return 0;
    33693384}
     
    33743389    if(index >= 0 && index/4 < nrUserWindowLong)
    33753390    {
     3391        //Note: NT4, SP6 does not set the last error to 0
     3392        SetLastError(ERROR_SUCCESS);
    33763393        return ((WORD *)userWindowLong)[index/2];
    33773394    }
    3378     SetLastError(ERROR_INVALID_PARAMETER);
     3395    SetLastError(ERROR_INVALID_INDEX);  //verified in NT4, SP6
    33793396    return 0;
    33803397}
  • TabularUnified trunk/src/user32/window.cpp

    r4848 r5060  
    1 /* $Id: window.cpp,v 1.86 2000-12-29 18:40:00 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.87 2001-02-03 18:52:02 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    321321}
    322322//******************************************************************************
     323//Note: does not set last error if no parent (verified in NT4, SP6)
    323324//******************************************************************************
    324325HWND WIN32API GetParent( HWND hwnd)
     
    332333        return 0;
    333334    }
    334 //    dprintf(("GetParent %x", hwnd));
     335    dprintf2(("GetParent %x", hwnd));
    335336    return window->GetParent();
    336337}
     
    348349    }
    349350    if(hwndNewParent == HWND_DESKTOP) {
    350     hwndNewParent = GetDesktopWindow();
     351        hwndNewParent = GetDesktopWindow();
    351352    }
    352353    else {
  • TabularUnified trunk/src/user32/windowword.cpp

    r4945 r5060  
    1 /* $Id: windowword.cpp,v 1.9 2001-01-14 17:15:47 sandervl Exp $ */
     1/* $Id: windowword.cpp,v 1.10 2001-02-03 18:52:03 sandervl Exp $ */
    22
    33/*
     
    1515#include <win32wbase.h>
    1616
    17 #define DBG_LOCALLOG    DBG_windowword
     17#define DBG_LOCALLOG    DBG_windowword
    1818#include "dbglocal.h"
    1919
     
    2727    if(window)
    2828    {
    29       return window->SetWindowLongA(nIndex,lNewLong);
     29        return window->SetWindowLongA(nIndex,lNewLong);
    3030    }
    3131    else {
    32          dprintf(("SetWindowLongA %d %x; window %x not found!", nIndex, lNewLong, hwnd));
     32        dprintf(("SetWindowLongA %d %x; window %x not found!", nIndex, lNewLong, hwnd));
     33        SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
     34        return 0;
    3335    }
    34     return 0;
    3536}
    3637//******************************************************************************
     
    4344    if(window)
    4445    {
    45       return window->SetWindowLongA(nIndex,lNewLong, TRUE);
     46        return window->SetWindowLongA(nIndex,lNewLong, TRUE);
    4647    }
    4748    else {
    48          dprintf(("SetWindowLongW; window %x not found!", hwnd));
     49        dprintf(("SetWindowLongW; window %x not found!", hwnd));
     50        SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
     51        return 0;
    4952    }
    50     return 0;
    5153}
    5254//******************************************************************************
     
    6466    {
    6567        dprintf(("GetWindowWord; window %x not found!", hwnd));
     68        SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
     69        return 0;
    6670    }
    67     return 0;
    6871}
    6972//******************************************************************************
     
    8184    {
    8285        dprintf(("SetWindowWord; window %x not found!", hwnd));
     86        SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
     87        return 0;
    8388    }
    84     return 0;
    8589}
    8690//******************************************************************************
     
    98102    {
    99103        dprintf(("GetWindowLongA; window %x (%d) not found!", hwnd, nIndex));
     104        SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
     105        return 0;
    100106    }
    101     return 0;
    102107}
    103108//******************************************************************************
     
    115120    {
    116121        dprintf(("GetWindowLongW; window %x not found!", hwnd));
     122        SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
     123        return 0;
    117124    }
    118     return 0;
    119125}
    120126//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.