- Timestamp:
- Dec 2, 1999, 8:30:41 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r1926 r1949 1 /* $Id: win32wbase.cpp,v 1.10 1 1999-12-01 18:43:08sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.102 1999-12-02 19:30:40 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 415 415 else 416 416 { 417 SetParent(0); 417 418 if (!cs->hwndParent || cs->hwndParent == windowDesktop->getWindowHandle()) { 418 419 owner = NULL; … … 2447 2448 //****************************************************************************** 2448 2449 //****************************************************************************** 2450 Win32BaseWindow *Win32BaseWindow::getParent() 2451 { 2452 Win32BaseWindow *wndparent = (Win32BaseWindow *)ChildWindow::GetParent(); 2453 return ((ULONG)wndparent == (ULONG)windowDesktop) ? NULL : wndparent; 2454 } 2455 //****************************************************************************** 2456 //****************************************************************************** 2449 2457 HWND Win32BaseWindow::GetParent() 2450 2458 { 2451 if(getParent()) { 2452 return getParent()->getWindowHandle(); 2453 } 2454 else return 0; 2459 Win32BaseWindow *wndparent; 2460 2461 if ((!(getStyle() & (WS_POPUP|WS_CHILD)))) 2462 { 2463 return 0; 2464 } 2465 wndparent = ((getStyle() & WS_CHILD) ? getParent() : getOwner()); 2466 2467 return (wndparent) ? wndparent->getWindowHandle() : 0; 2455 2468 } 2456 2469 //****************************************************************************** … … 2476 2489 } 2477 2490 else { 2478 setParent(windowDesktop);2479 getParent()->AddChild(this);2491 setParent(windowDesktop); 2492 windowDesktop->AddChild(this); 2480 2493 OSLibWinSetParent(getOS2FrameWindowHandle(), OSLIB_HWND_DESKTOP); 2481 2494 return oldhwnd; … … 2557 2570 dprintf(("EnumChildWindows: enumerating child %x", child->getWindowHandle())); 2558 2571 hwnd = child->getWindowHandle(); 2572 if(child->getOwner()) { 2573 continue; //shouldn't have an owner (Wine) 2574 } 2559 2575 if(lpfn(hwnd, lParam) == FALSE) 2560 2576 { … … 2580 2596 } 2581 2597 return rc; 2598 } 2599 //****************************************************************************** 2600 //Enumerate first-level children only and check thread id 2601 //****************************************************************************** 2602 BOOL Win32BaseWindow::EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam) 2603 { 2604 Win32BaseWindow *child = 0; 2605 ULONG tid, pid; 2606 BOOL rc; 2607 HWND hwnd; 2608 2609 dprintf(("EnumThreadWindows %x %x %x", dwThreadId, lpfn, lParam)); 2610 2611 for (child = (Win32BaseWindow *)getFirstChild(); child; child = (Win32BaseWindow *)child->getNextChild()) 2612 { 2613 OSLibWinQueryWindowProcess(child->getOS2WindowHandle(), &pid, &tid); 2614 2615 if(dwThreadId == tid) { 2616 dprintf2(("EnumThreadWindows: Found Window %x", child->getWindowHandle())); 2617 if((rc = lpfn(child->getWindowHandle(), lParam)) == FALSE) { 2618 break; 2619 } 2620 } 2621 } 2622 return TRUE; 2623 } 2624 //****************************************************************************** 2625 //Enumerate first-level children only 2626 //****************************************************************************** 2627 BOOL Win32BaseWindow::EnumWindows(WNDENUMPROC lpfn, LPARAM lParam) 2628 { 2629 Win32BaseWindow *child = 0; 2630 BOOL rc; 2631 HWND hwnd; 2632 2633 dprintf(("EnumWindows %x %x", lpfn, lParam)); 2634 2635 for (child = (Win32BaseWindow *)getFirstChild(); child; child = (Win32BaseWindow *)child->getNextChild()) 2636 { 2637 hwnd = child->getWindowHandle(); 2638 2639 dprintf2(("EnumWindows: Found Window %x", child->getWindowHandle())); 2640 if((rc = lpfn(child->getWindowHandle(), lParam)) == FALSE) { 2641 break; 2642 } 2643 } 2644 return TRUE; 2582 2645 } 2583 2646 //****************************************************************************** -
trunk/src/user32/win32wbase.h
r1920 r1949 1 /* $Id: win32wbase.h,v 1.4 7 1999-12-01 16:58:29 achimhaExp $ */1 /* $Id: win32wbase.h,v 1.48 1999-12-02 19:30:41 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 122 122 virtual BOOL isMDIChild(); 123 123 124 Win32BaseWindow *getParent() { return (Win32BaseWindow *)ChildWindow::GetParent(); };124 Win32BaseWindow *getParent(); 125 125 void setParent(Win32BaseWindow *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); }; 126 126 WNDPROC getWindowProc() { return win32wndproc; }; … … 229 229 230 230 BOOL EnumChildWindows(WNDENUMPROC lpfn, LPARAM lParam); 231 BOOL EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam); 232 BOOL EnumWindows(WNDENUMPROC lpfn, LPARAM lParam); 231 233 232 234 HWND getNextDlgTabItem(HWND hwndCtrl, BOOL fPrevious); -
trunk/src/user32/window.cpp
r1839 r1949 1 /* $Id: window.cpp,v 1.3 8 1999-11-25 19:22:04sandervl Exp $ */1 /* $Id: window.cpp,v 1.39 1999-12-02 19:30:41 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 1324 1324 BOOL WIN32API EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam) 1325 1325 { 1326 Win32BaseWindow *window; 1327 BOOL rc; 1328 ULONG henum; 1329 HWND hwndNext; 1330 ULONG tid; 1331 ULONG pid, curpid; 1332 1333 dprintf(("EnumThreadWindows\n")); 1334 1335 curpid = GetCurrentProcessId(); 1336 1337 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP); 1338 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0) 1339 { 1340 OSLibWinQueryWindowProcess(hwndNext, &pid, &tid); 1341 if(!(curpid == pid && dwThreadId == tid)) 1342 continue; 1343 1344 window = Win32BaseWindow::GetWindowFromOS2Handle(hwndNext); 1345 if(window == NULL) { 1346 window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndNext); 1347 if(!window) { 1348 //OS/2 window or non-frame window, so skip it 1349 continue; 1350 } 1351 } 1352 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) 1353 break; 1354 } 1355 OSLibWinEndEnumWindows (henum); 1356 return TRUE; 1326 return windowDesktop->EnumThreadWindows(dwThreadId, lpfn, lParam); 1357 1327 } 1358 1328 //****************************************************************************** … … 1382 1352 BOOL WIN32API EnumWindows(WNDENUMPROC lpfn, LPARAM lParam) 1383 1353 { 1384 Win32BaseWindow *window; 1385 BOOL rc; 1386 ULONG henum; 1387 HWND hwndNext, hwndParent = OSLIB_HWND_DESKTOP; 1388 1389 dprintf(("EnumThreadWindows\n")); 1390 1391 do { 1392 henum = OSLibWinBeginEnumWindows(hwndParent); 1393 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0) 1394 { 1395 window = Win32BaseWindow::GetWindowFromOS2Handle(hwndNext); 1396 if(window == NULL) { 1397 window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndNext); 1398 if(!window) { 1399 //OS/2 window or non-frame window, so skip it 1400 continue; 1401 } 1402 } 1403 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) { 1404 goto Abort; 1405 } 1406 } 1407 if(hwndParent == OSLIB_HWND_OBJECT) 1408 break; 1409 hwndParent = OSLIB_HWND_OBJECT; 1410 OSLibWinEndEnumWindows(henum); 1411 } 1412 while(TRUE); 1413 1414 Abort: 1415 OSLibWinEndEnumWindows(henum); 1416 return TRUE; 1354 return windowDesktop->EnumWindows(lpfn, lParam); 1417 1355 } 1418 1356 //****************************************************************************** … … 1453 1391 HWND WIN32API GetLastActivePopup( HWND hWnd) 1454 1392 { 1455 dprintf(("USER32: GetLastActivePopup")); 1393 HWND hwnd; 1394 1456 1395 hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd); 1457 1396 1458 return Win32BaseWindow::OS2ToWin32Handle(O32_GetLastActivePopup(hWnd)); 1397 hwnd = Win32BaseWindow::OS2ToWin32Handle(O32_GetLastActivePopup(hWnd)); 1398 1399 dprintf(("GetLastActivePopup %x returned %x", hWnd, hwnd)); 1400 return hwnd; 1459 1401 } 1460 1402 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.