Changeset 5950 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Jun 10, 2001, 11:19:58 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r5935 r5950 1 /* $Id: win32wbase.cpp,v 1.26 0 2001-06-09 14:50:21sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.261 2001-06-10 09:19:58 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 241 241 RELEASE_WNDOBJ(wndparent); 242 242 } 243 if(owner) { 244 RELEASE_WNDOBJ(owner); 245 } 243 246 if(windowClass) { 244 247 RELEASE_CLASSOBJ(windowClass); … … 1055 1058 1056 1059 //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems 1057 if (win32top) OSLibWinSetFocus(win32top->getOS2FrameWindowHandle()); 1060 if (win32top) { 1061 OSLibWinSetFocus(win32top->getOS2FrameWindowHandle()); 1062 RELEASE_WNDOBJ(win32top); 1063 } 1058 1064 } 1059 1065 } … … 1721 1727 siblingWindow->SendInternalMessageA (BM_CLICK, 0, 0); 1722 1728 } 1723 1724 1729 sibling = siblingWindow->GetNextWindow (GW_HWNDNEXT); 1730 RELEASE_WNDOBJ(siblingWindow); 1725 1731 } 1726 1732 … … 2113 2119 else PostMessageA(window->getWindowHandle(), msg, wParam, lParam); 2114 2120 } 2121 RELEASE_WNDOBJ(window); 2115 2122 } 2116 2123 } … … 2137 2144 else PostMessageW(window->getWindowHandle(), msg, wParam, lParam); 2138 2145 } 2146 RELEASE_WNDOBJ(window); 2139 2147 } 2140 2148 } … … 2457 2465 if(wndBehind) { 2458 2466 swp.hwndInsertBehind = wndBehind->getOS2FrameWindowHandle(); 2467 RELEASE_WNDOBJ(wndBehind); 2459 2468 } 2460 2469 else { … … 2736 2745 fShow = TRUE; 2737 2746 } 2738 2747 if(oldparent) { 2748 RELEASE_WNDOBJ(oldparent); 2749 } 2739 2750 newparent = GetWindowFromHandle(hwndNewParent); 2740 2751 if(newparent && !newparent->isDesktopWindow()) … … 2950 2961 Win32BaseWindow *parent = GetWindowFromHandle(hwndParent); 2951 2962 Win32BaseWindow *child = GetWindowFromHandle(hwndChildAfter); 2963 Win32BaseWindow *firstchild = child; 2952 2964 2953 2965 dprintf(("FindWindowEx %x %x %x %s", hwndParent, hwndChildAfter, atom, lpszWindow)); … … 2956 2968 (hwndParent == 0 && hwndChildAfter != 0)) 2957 2969 { 2970 if(parent) RELEASE_WNDOBJ(parent); 2971 if(firstchild) RELEASE_WNDOBJ(firstchild); 2958 2972 dprintf(("Win32BaseWindow::FindWindowEx: parent or child not found %x %x", hwndParent, hwndChildAfter)); 2959 2973 SetLastError(ERROR_INVALID_WINDOW_HANDLE); … … 2963 2977 if(hwndParent != 0) 2964 2978 {//if the current process owns the window, just do a quick search 2979 lock(&critsect); 2965 2980 child = (Win32BaseWindow *)parent->getFirstChild(); 2966 2981 if(hwndChildAfter != 0) … … 2983 2998 { 2984 2999 dprintf(("FindWindowEx: Found window %x", child->getWindowHandle())); 2985 return child->getWindowHandle(); 3000 HWND hwndChild = child->getWindowHandle(); 3001 unlock(&critsect); 3002 if(parent) RELEASE_WNDOBJ(parent); 3003 if(firstchild) RELEASE_WNDOBJ(firstchild); 3004 dprintf(("FindWindowEx: Found window %x", child->getWindowHandle())); 3005 return hwndChild; 2986 3006 } 2987 3007 child = (Win32BaseWindow *)child->getNextChild(); 2988 3008 } 3009 unlock(&critsect); 3010 if(parent) RELEASE_WNDOBJ(parent); 3011 if(firstchild) RELEASE_WNDOBJ(firstchild); 2989 3012 } 2990 3013 else { … … 3019 3042 } 3020 3043 OSLibWinEndEnumWindows(henum); 3044 if(parent) RELEASE_WNDOBJ(parent); 3045 if(firstchild) RELEASE_WNDOBJ(firstchild); 3021 3046 } 3022 3047 SetLastError(ERROR_CANNOT_FIND_WND_CLASS); //TODO: not always correct … … 3532 3557 HWND Win32BaseWindow::getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious) 3533 3558 { 3534 Win32BaseWindow * child, *nextchild, *lastchild;3559 Win32BaseWindow *firstchild = NULL, *child, *nextchild, *lastchild; 3535 3560 HWND retvalue; 3536 3561 3562 lock(); 3537 3563 if (hwndCtrl) 3538 3564 { 3539 child = GetWindowFromHandle(hwndCtrl);3565 firstchild = child = GetWindowFromHandle(hwndCtrl); 3540 3566 if (!child) 3541 3567 { … … 3549 3575 if(child == NULL) break; 3550 3576 } 3551 3552 3577 if (!child || (child->getParent() != this)) 3553 3578 { … … 3611 3636 retvalue = lastchild->getWindowHandle(); 3612 3637 END: 3638 unlock(); 3639 if(firstchild) RELEASE_WNDOBJ(firstchild); 3613 3640 return retvalue; 3614 3641 } … … 3624 3651 if(HwGetWindowHandleData(hwnd, (DWORD *)&window) == TRUE) { 3625 3652 if(window) { 3626 ////dprintf(("addRef %x; refcount %d", hwnd, window->getRefCount()+1));3653 dprintf(("addRef %x; refcount %d", hwnd, window->getRefCount()+1)); 3627 3654 window->addRef(); 3628 3655 }
Note:
See TracChangeset
for help on using the changeset viewer.