Changeset 5404 for trunk/src/user32/window.cpp
- Timestamp:
- Mar 30, 2001, 1:14:36 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/window.cpp
r5237 r5404 1 /* $Id: window.cpp,v 1. 89 2001-02-21 21:30:44sandervl Exp $ */1 /* $Id: window.cpp,v 1.90 2001-03-30 11:14:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 4 4 * 5 * Copyright 1999 Sander van Leeuwen5 * Copyright 1999-2001 Sander van Leeuwen (sandervl@xs4all.nl) 6 6 * Copyright 1999 Daniela Engert (dani@ngrt.de) 7 7 * Copyright 2000 Christoph Bratschi (cbratschi@datacomm.ch) … … 18 18 * TODO: ShowOwnedPopups needs to be tested 19 19 * GetLastActivePopup needs to be rewritten 20 * ArrangeIconicWindows probably also20 * ArrangeIconicWindows probably too 21 21 * 22 22 */ … … 700 700 dprintf(("SetFocus %x (%x) -> %x (%x)\n", lastFocus_W, lastFocus, hwnd, hwnd_O)); 701 701 702 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 702 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 703 703 //must delay this function call 704 704 if(teb->o.odin.fWM_SETFOCUS) { … … 724 724 return 0; 725 725 } 726 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 726 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 727 727 //If focus was changed during WM_SETFOCUS, the focus window handle is 728 728 //stored in teb->o.odin.hwndFocus (set back to 0 when delayed SetFocus … … 1493 1493 HWND WIN32API WindowFromPoint( POINT point) 1494 1494 { 1495 #if 01496 INT hittest = HTERROR;1497 HWND retvalue = 0;1498 HWND hwnd = GetDesktopWindow();1499 DWORD dwStyle;1500 RECT rectWindow, rectClient;1501 Win32BaseWindow *window;1502 1503 dprintf(("WindowFromPoint (%d,%d)", point.x, point.y));1504 1505 while(hwnd)1506 {1507 window = Win32BaseWindow::GetWindowFromHandle(hwnd);1508 1509 /* If point is in window, and window is visible, and it */1510 /* is enabled (or it's a top-level window), then explore */1511 /* its children. Otherwise, go to the next window. */1512 dwStyle = GetWindowLongA(hwnd, GWL_STYLE);1513 1514 if ((dwStyle & WS_VISIBLE) && (!(dwStyle & WS_DISABLED) ||1515 ((dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)))1516 {1517 GetWindowRect(hwnd, &rectWindow);1518 if(PtInRect(&rectWindow, point) == TRUE)1519 {1520 /* If window is minimized or disabled, return at once */1521 if(dwStyle & WS_MINIMIZE)1522 {1523 break;1524 }1525 if(dwStyle & WS_DISABLED)1526 {1527 break;1528 }1529 retvalue = hwnd;1530 1531 GetClientRect(hwnd, &rectClient);1532 InflateRect(&rectClient, rectWindow.left, rectWindow.top);1533 1534 /* If point is not in client area, ignore the children */1535 if(PtInRect(&rectClient, point) == FALSE) {1536 break;1537 }1538 if(window->getFirstChild()) {1539 hwnd = ((Win32BaseWindow *)window->getFirstChild())->getWindowHandle();1540 }1541 else break;1542 }1543 else1544 {1545 if(window->getNextChild()) {1546 hwnd = ((Win32BaseWindow *)window->getNextChild())->getWindowHandle();1547 }1548 else hwnd = 0;1549 }1550 }1551 else1552 {1553 if(window->getNextChild()) {1554 hwnd = ((Win32BaseWindow *)window->getNextChild())->getWindowHandle();1555 }1556 else hwnd = 0;1557 }1558 }1559 1560 dprintf(("WindowFromPoint (%d,%d) -> %x", point.x, point.y, hwnd));1561 return retvalue;1562 #else1563 1495 HWND hwndOS2, hwnd; 1564 1496 POINT wPoint; 1497 DWORD hittest, dwStyle, dwExStyle; 1565 1498 1566 1499 wPoint.x = point.x; … … 1570 1503 if(hwndOS2) 1571 1504 { 1572 hwnd = OS2ToWin32Handle(hwndOS2); 1573 if(hwnd) { 1574 dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd)); 1575 return hwnd; 1576 } 1505 hwnd = OS2ToWin32Handle(hwndOS2); 1506 while(hwnd) 1507 { 1508 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 1509 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 1510 1511 /* If point is in window, and window is visible, and it */ 1512 /* is enabled (or it's a top-level window), then explore */ 1513 /* its children. Otherwise, go to the next window. */ 1514 1515 if( (dwStyle & WS_VISIBLE) && 1516 ((dwExStyle & (WS_EX_LAYERED | WS_EX_TRANSPARENT)) != (WS_EX_LAYERED | WS_EX_TRANSPARENT)) && 1517 (!(dwStyle & WS_DISABLED) || ((dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)) 1518 #if 1 1519 ) 1520 #else 1521 && 1522 (wndPtr->hrgnWnd ? PtInRegion(wndPtr->hrgnWnd, 1)) 1523 #endif 1524 { 1525 hittest = SendMessageA(hwnd, WM_NCHITTEST, 0, MAKELONG(point.x, point.y)); 1526 if(hittest != HTTRANSPARENT) { 1527 dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd)); 1528 return hwnd; 1529 } 1530 } 1531 //TODO: Not correct for overlapping sibling windows! 1532 hwnd = GetParent(hwnd); 1533 } 1577 1534 } 1578 1535 dprintf(("WindowFromPoint (%d,%d) %x->1\n", point.x, point.y, hwndOS2)); 1579 1536 return windowDesktop->getWindowHandle(); 1580 #endif1581 1537 } 1582 1538 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.