Ignore:
Timestamp:
Dec 18, 1999, 5:31:52 PM (26 years ago)
Author:
cbratschi
Message:

MDI fixes, ChildWindowFromPointEx

File:
1 edited

Legend:

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

    r2084 r2114  
    1 /* $Id: window.cpp,v 1.42 1999-12-16 00:11:48 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.43 1999-12-18 16:31:52 cbratschi Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    458458    if(!window) {
    459459        dprintf(("ShowWindow, window %x not found", hwnd));
    460         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     460        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    461461        return 0;
    462462    }
     
    11451145    pDWP = (DWP *) hdwp;
    11461146    if (!pDWP) {
    1147         dprintf(("**EndDeferWindowPos invalid parameter\n"));
     1147        dprintf(("**EndDeferWindowPos invalid parameter\n"));
    11481148        SetLastError(ERROR_INVALID_PARAMETER);
    11491149        return FALSE;
     
    11691169    return ChildWindowFromPointEx(hwnd, pt, 0);
    11701170}
    1171 //******************************************************************************
    1172 //******************************************************************************
    11731171/*****************************************************************************
    11741172 * Name      : HWND WIN32API ChildWindowFromPointEx
    1175  * Purpose   : The GetWindowRect function retrieves the dimensions of the
    1176  *             bounding rectangle of the specified window. The dimensions are
    1177  *             given in screen coordinates that are relative to the upper-left
    1178  *             corner of the screen.
     1173 * Purpose   : pt: client coordinates
    11791174 * Parameters:
    11801175 * Variables :
     
    11861181 * Author    : Rene Pronk [Sun, 1999/08/08 23:30]
    11871182 *****************************************************************************/
    1188 
    11891183HWND WIN32API ChildWindowFromPointEx (HWND hwndParent, POINT pt, UINT uFlags)
    11901184{
    11911185        RECT rect;
    11921186        HWND hWnd;
    1193         POINT absolutePt;
     1187        POINT framePt;
    11941188
    11951189        dprintf(("ChildWindowFromPointEx(%08xh,%08xh,%08xh).\n",
     
    12021196        }
    12031197
    1204         // absolutePt has its top in the upper-left corner of the screen
    1205         absolutePt = pt;
    1206         ClientToScreen (hwndParent, &absolutePt);
    1207 
    1208         // make rect the size of the parent window
    1209         GetWindowRect (hwndParent, &rect);
    1210         rect.right = rect.right - rect.left;
    1211         rect.bottom = rect.bottom - rect.top;
    1212         rect.left = 0;
    1213         rect.top = 0;
    1214 
    1215         if (PtInRect (&rect, pt) == 0) {
     1198        MapWindowPoints(hwndParent,GetParent(hwndParent),&framePt,1);
     1199        if (PtInRect (&rect, framePt) == 0) {
    12161200                // point is outside window
    12171201                return NULL;
    12181202        }
     1203
    12191204
    12201205        // get first child
     
    12381223                // is the point in this window's rect?
    12391224                GetWindowRect (hWnd, &rect);
    1240                 if (PtInRect (&rect, absolutePt) == FALSE) {
     1225                if (PtInRect (&rect,pt) == FALSE) {
    12411226                        hWnd = GetWindow (hWnd, GW_HWNDNEXT);
    12421227                        continue;
     
    12801265
    12811266    hwndOS2 = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&wPoint);
    1282     if(hwndOS2) {
     1267    if(hwndOS2)
     1268    {
     1269      hwnd = Win32BaseWindow::OS2ToWin32Handle(hwndOS2);
     1270      if (!hwnd)
     1271      {
     1272        //CB: could be a frame control
     1273        hwndOS2 = OSLibWinQueryWindow(hwndOS2,QWOS_PARENT);
    12831274        hwnd = Win32BaseWindow::OS2ToWin32Handle(hwndOS2);
    1284         if(hwnd) {
    1285                 dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd));
    1286                 return hwnd;
    1287         }
     1275      }
     1276      if(hwnd) {
     1277              dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd));
     1278              return hwnd;
     1279      }
    12881280    }
    12891281    dprintf(("WindowFromPoint (%d,%d) %x->1\n", point.x, point.y, hwndOS2));
     
    13031295    }
    13041296    return window->IsWindowUnicode();
    1305 }
    1306 /*****************************************************************************
    1307  * Name      : WORD WIN32API CascadeWindows
    1308  * Purpose   : The CascadeWindows function cascades the specified windows or
    1309  *             the child windows of the specified parent window.
    1310  * Parameters: HWND hwndParent         handle of parent window
    1311  *             UINT wHow               types of windows not to arrange
    1312  *             CONST RECT * lpRect     rectangle to arrange windows in
    1313  *             UINT cKids              number of windows to arrange
    1314  *             const HWND FAR * lpKids array of window handles
    1315  * Variables :
    1316  * Result    : If the function succeeds, the return value is the number of windows arranged.
    1317  *             If the function fails, the return value is zero.
    1318  * Remark    :
    1319  * Status    : UNTESTED STUB
    1320  *
    1321  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1322  *****************************************************************************/
    1323 
    1324 WORD WIN32API CascadeWindows(HWND       hwndParent,
    1325                              UINT       wHow,
    1326                              CONST LPRECT lpRect,
    1327                              UINT       cKids,
    1328                              const HWND *lpKids)
    1329 {
    1330   dprintf(("USER32:CascadeWindows(%08xh,%u,%08xh,%u,%08x) not implemented.\n",
    1331          hwndParent,
    1332          wHow,
    1333          lpRect,
    1334          cKids,
    1335          lpKids));
    1336 
    1337   return (0);
    13381297}
    13391298/***********************************************************************
     
    13481307BOOL WIN32API EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam)
    13491308{
    1350   return windowDesktop->EnumThreadWindows(dwThreadId, lpfn, lParam); 
     1309  return windowDesktop->EnumThreadWindows(dwThreadId, lpfn, lParam);
    13511310}
    13521311//******************************************************************************
     
    13761335BOOL WIN32API EnumWindows(WNDENUMPROC lpfn, LPARAM lParam)
    13771336{
    1378   return windowDesktop->EnumWindows(lpfn, lParam); 
     1337  return windowDesktop->EnumWindows(lpfn, lParam);
    13791338}
    13801339//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.