Ignore:
Timestamp:
May 11, 2001, 10:40:40 PM (24 years ago)
Author:
sandervl
Message:

fixes

File:
1 edited

Legend:

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

    r5685 r5696  
    1 /* $Id: window.cpp,v 1.95 2001-05-11 08:39:46 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.96 2001-05-11 20:40:40 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    715715HWND WIN32API SetFocus(HWND hwnd)
    716716{
     717 Win32BaseWindow *window;
    717718 HWND lastFocus, lastFocus_W, hwnd_O;
    718719 BOOL activate;
     
    725726    }
    726727
    727     hwnd_O    = Win32ToOS2Handle (hwnd);
    728     lastFocus = OSLibWinQueryFocus (OSLIB_HWND_DESKTOP);
     728    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     729    if(!window) {
     730        dprintf(("SetFocus, window %x not found", hwnd));
     731        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     732        return 0;
     733    }
     734
     735    hwnd_O    = window->getOS2FrameWindowHandle();
     736    if(teb->o.odin.hwndFocus) {
     737         lastFocus = teb->o.odin.hwndFocus;
     738    }
     739    else lastFocus = OSLibWinQueryFocus (OSLIB_HWND_DESKTOP);
     740
    729741    activate  = ((hwnd_O == lastFocus) || OSLibWinIsChild (lastFocus, hwnd_O));
    730742    lastFocus_W = OS2ToWin32Handle (lastFocus);
     
    742754        return lastFocus_W;
    743755    }
     756    teb->o.odin.hwndFocus = 0;
    744757    return (OSLibWinSetFocus (OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0;
    745758}
Note: See TracChangeset for help on using the changeset viewer.