- Timestamp:
- Jun 10, 2001, 11:19:58 AM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/gen_object.cpp
r5935 r5950 1 /* $Id: gen_object.cpp,v 1. 8 2001-06-09 14:50:17 sandervl Exp $ */1 /* $Id: gen_object.cpp,v 1.9 2001-06-10 09:19:57 sandervl Exp $ */ 2 2 /* 3 3 * Generic Object Class for OS/2 … … 88 88 //****************************************************************************** 89 89 //****************************************************************************** 90 #ifdef DEBUG 91 LONG GenericObject::addRef() 92 { 93 dprintf(("addRef %x -> refcount %x", this, refCount)); 94 return InterlockedIncrement(&refCount); 95 } 96 #endif 97 //****************************************************************************** 98 //****************************************************************************** 90 99 LONG GenericObject::release() 91 100 { 92 //// dprintf(("release -> refcount %x", refCount));101 dprintf(("release %x -> refcount %x", this, refCount)); 93 102 #ifdef DEBUG 94 103 if(refCount-1 < 0) { -
trunk/src/user32/gen_object.h
r5935 r5950 1 /* $Id: gen_object.h,v 1. 6 2001-06-09 14:50:17 sandervl Exp $ */1 /* $Id: gen_object.h,v 1.7 2001-06-10 09:19:57 sandervl Exp $ */ 2 2 /* 3 3 * Generic Object Class for OS/2 … … 29 29 void unlink(); 30 30 31 #ifdef DEBUG 32 LONG addRef(); 33 #else 31 34 LONG addRef() { return InterlockedIncrement(&refCount); }; 35 #endif 32 36 LONG getRefCount() { return refCount; }; 33 37 LONG release(); -
trunk/src/user32/icontitle.cpp
r5935 r5950 1 /* $Id: icontitle.cpp,v 1. 7 2001-06-09 14:50:17 sandervl Exp $ */1 /* $Id: icontitle.cpp,v 1.8 2001-06-10 09:19:57 sandervl Exp $ */ 2 2 /* 3 3 * Icontitle window class. … … 57 57 { 58 58 win32wnd->setOwner(parent); /* MDI depends on this */ 59 //No RELEASE_WNDOBJ necessary. Done in dtor of window 59 60 win32wnd->setStyle(win32wnd->getStyle() & ~(WS_CAPTION | WS_BORDER)); 60 61 if (parent->getStyle() & WS_DISABLED ) win32wnd->setStyle(win32wnd->getStyle() | WS_DISABLED); 61 RELEASE_WNDOBJ(win32wnd);62 62 return hWnd; 63 63 } -
trunk/src/user32/win32dlg.cpp
r5935 r5950 1 /* $Id: win32dlg.cpp,v 1.6 6 2001-06-09 14:50:20sandervl Exp $ */1 /* $Id: win32dlg.cpp,v 1.67 2001-06-10 09:19:58 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 340 340 // this style was useful for Win3.1 but today there are threads 341 341 // solution: send only few WM_ENTERIDLE messages 342 343 #if 1344 342 while (TRUE) 345 343 { … … 388 386 break; 389 387 } 390 #else391 while (TRUE) {392 // while (OSLibWinPeekMsg(&msg, getWindowHandle(), owner, MSGF_DIALOGBOX,393 // MSG_REMOVE, !(getStyle() & DS_NOIDLEMSG), NULL ))394 // if(OSLibWinPeekMsg(&msg, topOwner->getOS2FrameWindowHandle(), 0, 0, MSG_REMOVE))395 if(OSLibWinPeekMsg(&msg, 0, 0, 0, PM_REMOVE))396 {397 if(msg.message == WM_QUIT) {398 dprintf(("Win32Dialog::doDialogBox: received WM_QUIT"));399 break;400 }401 if (!IsDialogMessageA( getWindowHandle(), &msg))402 {403 TranslateMessage( &msg );404 DispatchMessageA( &msg );405 }406 if (dialogFlags & DF_END) break;407 }408 else {409 if(!(getStyle() & DS_NOIDLEMSG)) {410 topOwner->SendInternalMessageA(WM_ENTERIDLE, MSGF_DIALOGBOX, getWindowHandle());411 }412 }413 }414 #endif415 388 topOwner->setModalDialogOwner(bOldOwner); 416 389 topOwner->setOS2HwndModalDialog(hwndOldDialog); 417 390 if (!bOldOwner) topOwner->EnableWindow(TRUE); 418 RELEASE_WNDOBJ(topOwner);419 }391 } 392 RELEASE_WNDOBJ(topOwner); 420 393 retval = idResult; 421 394 DestroyWindow(); -
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.