- Timestamp:
- Mar 31, 2001, 1:59:47 AM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsgtranslate.cpp
r5404 r5409 1 /* $Id: oslibmsgtranslate.cpp,v 1.4 3 2001-03-30 11:14:35sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.44 2001-03-30 23:59:46 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 397 397 goto dummymessage; 398 398 } 399 winMsg->hwnd = hwnd; 399 400 } 400 401 #endif … … 473 474 goto dummymessage; 474 475 } 476 winMsg->hwnd = hwnd; 475 477 } 476 478 #endif -
trunk/src/user32/window.cpp
r5406 r5409 1 /* $Id: window.cpp,v 1.9 1 2001-03-30 22:08:20sandervl Exp $ */1 /* $Id: window.cpp,v 1.92 2001-03-30 23:59:47 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 1484 1484 } 1485 1485 //****************************************************************************** 1486 //****************************************************************************** 1487 static BOOL IsPointInWindow(HWND hwnd, POINT point) 1488 { 1489 RECT rectWindow; 1490 DWORD hittest, dwStyle, dwExStyle; 1491 1492 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 1493 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 1494 1495 GetWindowRect(hwnd, &rectWindow); 1496 1497 /* If point is in window, and window is visible, and it */ 1498 /* is enabled (or it's a top-level window), then explore */ 1499 /* its children. Otherwise, go to the next window. */ 1500 1501 if( (dwStyle & WS_VISIBLE) && 1502 ((dwExStyle & (WS_EX_LAYERED | WS_EX_TRANSPARENT)) != (WS_EX_LAYERED | WS_EX_TRANSPARENT)) && 1503 (!(dwStyle & WS_DISABLED) || ((dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)) && 1504 ((point.x >= rectWindow.left) && (point.x < rectWindow.right) && 1505 (point.y >= rectWindow.top) && (point.y < rectWindow.bottom)) 1506 #if 1 1507 ) 1508 #else 1509 && 1510 (wndPtr->hrgnWnd ? PtInRegion(wndPtr->hrgnWnd, 1)) 1511 #endif 1512 { 1513 hittest = SendMessageA(hwnd, WM_NCHITTEST, 0, MAKELONG(point.x, point.y)); 1514 if(hittest != HTTRANSPARENT) { 1515 return TRUE; 1516 } 1517 } 1518 return FALSE; 1519 } 1520 //****************************************************************************** 1486 1521 //TODO: Does this return handles of hidden or disabled windows? 1487 1522 //****************************************************************************** … … 1490 1525 HWND hwndOS2, hwnd; 1491 1526 POINT wPoint; 1492 DWORD hittest, dwStyle, dwExStyle;1493 1527 1494 1528 wPoint.x = point.x; … … 1501 1535 while(hwnd) 1502 1536 { 1503 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 1504 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 1505 1506 /* If point is in window, and window is visible, and it */ 1507 /* is enabled (or it's a top-level window), then explore */ 1508 /* its children. Otherwise, go to the next window. */ 1509 1510 if( (dwStyle & WS_VISIBLE) && 1511 ((dwExStyle & (WS_EX_LAYERED | WS_EX_TRANSPARENT)) != (WS_EX_LAYERED | WS_EX_TRANSPARENT)) && 1512 (!(dwStyle & WS_DISABLED) || ((dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)) 1513 #if 1 1514 ) 1515 #else 1516 && 1517 (wndPtr->hrgnWnd ? PtInRegion(wndPtr->hrgnWnd, 1)) 1518 #endif 1519 { 1520 hittest = SendMessageA(hwnd, WM_NCHITTEST, 0, MAKELONG(point.x, point.y)); 1521 if(hittest != HTTRANSPARENT) { 1522 dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd)); 1523 return hwnd; 1537 if(IsPointInWindow(hwnd, point)) { 1538 dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd)); 1539 return hwnd; 1540 } 1541 //try siblings 1542 HWND hwndSibling; 1543 HWND hwndParent = GetParent(hwnd); 1544 1545 if(hwndParent) { 1546 hwndSibling = GetWindow(hwndParent, GW_CHILD); 1547 while(hwndSibling) { 1548 if(hwndSibling != hwnd) { 1549 if(IsPointInWindow(hwndSibling, point)) { 1550 dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwndSibling)); 1551 return hwndSibling; 1552 } 1553 } 1554 hwndSibling = GetWindow(hwndSibling, GW_HWNDNEXT); 1524 1555 } 1525 1556 } 1526 //TODO: Not correct for overlapping sibling windows! 1527 hwnd = GetParent(hwnd); 1557 hwnd = hwndParent; 1528 1558 } 1529 1559 }
Note:
See TracChangeset
for help on using the changeset viewer.