Ignore:
Timestamp:
Dec 17, 2000, 4:04:14 PM (25 years ago)
Author:
sandervl
Message:

hook, mdi & focus fixes

File:
1 edited

Legend:

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

    r4585 r4825  
    1 /* $Id: window.cpp,v 1.84 2000-11-11 18:39:31 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.85 2000-12-17 15:04:13 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    13911391        }
    13921392
    1393 
    13941393        // get first child
    13951394        hWnd = GetWindow (hwndParent, GW_CHILD);
    13961395
    1397         while (hWnd != NULL) {
    1398 
     1396        while (hWnd != NULL)
     1397        {
    13991398                // do I need to skip this window?
    14001399                if (((uFlags & CWP_SKIPINVISIBLE) &&
     
    14041403                    ((uFlags & CWP_SKIPTRANSPARENT) &&
    14051404                     (GetWindowLongA (hWnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT)))
    1406 
    14071405                {
    14081406                        hWnd = GetWindow (hWnd, GW_HWNDNEXT);
     
    14211419                return hWnd;
    14221420        }
    1423 
    14241421        // the point is in the parentwindow but the parentwindow has no child
    14251422        // at this coordinate
    1426             dprintf(("ChildWindowFromPointEx returned parent %x", hwndParent));
     1423        dprintf(("ChildWindowFromPointEx returned parent %x", hwndParent));
    14271424        return hwndParent;
    14281425}
     
    14471444HWND WIN32API WindowFromPoint( POINT point)
    14481445{
     1446#if 0
     1447    INT     hittest = HTERROR;
     1448    HWND    retvalue = 0;
     1449    HWND    hwnd = GetDesktopWindow();
     1450    DWORD   dwStyle;
     1451    RECT    rectWindow, rectClient;
     1452    Win32BaseWindow *window;
     1453
     1454    dprintf(("WindowFromPoint (%d,%d)", point.x, point.y));
     1455
     1456    while(hwnd)
     1457    {
     1458        window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1459
     1460        /* If point is in window, and window is visible, and it  */
     1461        /* is enabled (or it's a top-level window), then explore */
     1462        /* its children. Otherwise, go to the next window.       */
     1463        dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
     1464
     1465        if ((dwStyle & WS_VISIBLE) && (!(dwStyle & WS_DISABLED) ||
     1466           ((dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)))
     1467        {
     1468            GetWindowRect(hwnd, &rectWindow);
     1469            if(PtInRect(&rectWindow, point) == TRUE)
     1470            {
     1471                /* If window is minimized or disabled, return at once */
     1472                if(dwStyle & WS_MINIMIZE)
     1473                {
     1474                    break;
     1475                }
     1476                if(dwStyle & WS_DISABLED)
     1477                {
     1478                    break;
     1479                }
     1480                retvalue = hwnd;
     1481
     1482                GetClientRect(hwnd, &rectClient);
     1483                InflateRect(&rectClient, rectWindow.left, rectWindow.top);
     1484
     1485                /* If point is not in client area, ignore the children */
     1486                if(PtInRect(&rectClient, point) == FALSE) {
     1487                    break;
     1488                }
     1489                if(window->getFirstChild()) {
     1490                     hwnd = ((Win32BaseWindow *)window->getFirstChild())->getWindowHandle();
     1491                }
     1492                else break;
     1493            }
     1494            else
     1495            {
     1496                if(window->getNextChild()) {
     1497                     hwnd = ((Win32BaseWindow *)window->getNextChild())->getWindowHandle();
     1498                }
     1499                else hwnd = 0;
     1500            }
     1501        }
     1502        else
     1503        {
     1504            if(window->getNextChild()) {
     1505                 hwnd = ((Win32BaseWindow *)window->getNextChild())->getWindowHandle();
     1506            }
     1507            else hwnd = 0;
     1508        }
     1509    }
     1510
     1511    dprintf(("WindowFromPoint (%d,%d) -> %x", point.x, point.y, hwnd));
     1512    return retvalue;
     1513#else
    14491514    HWND  hwndOS2, hwnd;
    14501515    POINT wPoint;
     
    14641529    dprintf(("WindowFromPoint (%d,%d) %x->1\n", point.x, point.y, hwndOS2));
    14651530    return windowDesktop->getWindowHandle();
     1531#endif
    14661532}
    14671533//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.