Changeset 5685 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- May 11, 2001, 10:39:46 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r5646 r5685 1 /* $Id: win32wbase.cpp,v 1.25 4 2001-05-03 17:51:01sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.255 2001-05-11 08:39:45 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 4 4 * 5 * Copyright 1998-200 0Sander van Leeuwen (sandervl@xs4all.nl)5 * Copyright 1998-2001 Sander van Leeuwen (sandervl@xs4all.nl) 6 6 * Copyright 1999 Daniela Engert (dani@ngrt.de) 7 7 * Copyright 1999-2000 Christoph Bratschi (cbratschi@datacomm.ch) … … 106 106 fCreationFinished= FALSE; 107 107 fMinMaxChange = FALSE; 108 fOwnDCDirty = FALSE; 108 fVisibleRegionChanged = FALSE; 109 fEraseBkgndFlag = TRUE; 109 110 110 111 windowNameA = NULL; … … 116 117 magic = WIN32PM_MAGIC; 117 118 OS2Hwnd = 0; 119 OS2HwndFrame = 0; 118 120 hSysMenu = 0; 119 121 Win32Hwnd = 0; … … 146 148 hIcon = 0; 147 149 hIconSm = 0; 148 149 EraseBkgndFlag = TRUE;150 150 151 151 horzScrollInfo = NULL; … … 467 467 (owner) ? owner->getOS2WindowHandle() : ((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP), 468 468 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, 469 0, fTaskList,fXDefault | fCXDefault,windowClass->getStyle() );469 0, fTaskList,fXDefault | fCXDefault,windowClass->getStyle(), &OS2HwndFrame); 470 470 if(OS2Hwnd == 0) { 471 471 dprintf(("Window creation failed!! OS LastError %0x", OSLibWinGetLastError())); … … 688 688 689 689 if(fTaskList) { 690 hTaskList = OSLibWinAddToTaskList(OS2Hwnd , windowNameA, (cs->style & WS_VISIBLE) ? 1 : 0);690 hTaskList = OSLibWinAddToTaskList(OS2HwndFrame, windowNameA, (cs->style & WS_VISIBLE) ? 1 : 0); 691 691 } 692 692 … … 871 871 else setStyle(getStyle() & ~WS_VISIBLE); 872 872 873 return SendInternalMessageA(WM_SHOWWINDOW, fShow, 0); 873 //already sent from ShowWindow 874 //// return SendInternalMessageA(WM_SHOWWINDOW, fShow, 0); 875 return 0; 874 876 } 875 877 //****************************************************************************** … … 897 899 //****************************************************************************** 898 900 //****************************************************************************** 899 #if 0900 ULONG Win32BaseWindow::MsgMinMax()901 {902 903 }904 #endif905 //******************************************************************************906 //******************************************************************************907 901 ULONG Win32BaseWindow::MsgScroll(ULONG msg, ULONG scrollCode, ULONG scrollPos) 908 902 { … … 911 905 return SendInternalMessageA(msg, MAKELONG(scrollCode, scrollPos), 0); 912 906 } 913 //******************************************************************************914 //******************************************************************************915 #ifndef ODIN_HITTEST916 ULONG Win32BaseWindow::MsgHitTest(MSG *msg)917 {918 lastHitTestVal = DispatchMsgA(msg);919 920 dprintf2(("MsgHitTest %x (%d,%d) (%d,%d) (%d,%d) returned %x", getWindowHandle(), LOWORD(msg->lParam), HIWORD(msg->lParam), rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom, lastHitTestVal));921 922 if (lastHitTestVal == HTTRANSPARENT)923 return HTOS_TRANSPARENT;924 else925 return HTOS_NORMAL;926 }927 #endif928 907 //****************************************************************************** 929 908 //****************************************************************************** … … 957 936 958 937 if(hwndOS2Win) { 959 960 } 961 //Warning: temporary hack to force focus to newly created window962 //RealPlayer 8 does not pass WM_ACTIVATE to defwindowproc and doesn't call963 //setfocus -> keyboard focus not set964 //TODO: Find real cause!!938 threadidhwnd = O32_GetWindowThreadProcessId(hwndOS2Win, &procidhwnd); 939 } 940 //Warning: temporary hack to force focus to newly created window 941 //RealPlayer 8 does not pass WM_ACTIVATE to defwindowproc and doesn't call 942 //setfocus -> keyboard focus not set 943 //TODO: Find real cause!! 965 944 if(GetFocus() == 0 && fActivate) { 966 945 if(!(getStyle() & WS_MINIMIZE)) 967 946 SetFocus(getWindowHandle()); 968 947 } 969 //Warning: temporary hack to force focus to newly created window948 //Warning: temporary hack to force focus to newly created window 970 949 971 950 if(fActivate) { 972 973 } 974 else 951 SendInternalMessageA(WM_ACTIVATEAPP, 1, dwThreadId); //activate; specify window thread id 952 } 953 else SendInternalMessageA(WM_ACTIVATEAPP, 0, threadidhwnd); //deactivate; specify thread id of other process 975 954 return rc; 976 955 } … … 1067 1046 1068 1047 //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems 1069 if (win32top) OSLibWinSetFocus(win32top->getOS2 WindowHandle());1048 if (win32top) OSLibWinSetFocus(win32top->getOS2FrameWindowHandle()); 1070 1049 } 1071 1050 } … … 1122 1101 } 1123 1102 //****************************************************************************** 1124 //****************************************************************************** 1125 ULONG Win32BaseWindow::MsgNCPaint() 1126 { 1127 RECT rect; 1128 1129 if(GetOS2UpdateRect(this,&rect)) 1130 { 1103 //TODO: Should use update region, not rectangle 1104 //****************************************************************************** 1105 ULONG Win32BaseWindow::MsgNCPaint(PRECT pUpdateRect) 1106 { 1131 1107 HRGN hrgn; 1132 1108 ULONG rc; 1133 1109 RECT client = rectClient; 1134 1110 1135 if ((rect.left >= client.left) && (rect.left < client.right) && 1136 (rect.right >= client.left) && (rect.right < client.right) && 1137 (rect.top >= client.top) && (rect.top < client.bottom) && 1138 (rect.bottom >= client.top) && (rect.bottom < client.bottom)) 1139 { 1140 return 0; 1141 } 1142 1143 dprintf(("MsgNCPaint (%d,%d)(%d,%d)", rect.left, rect.top, rect.right, rect.bottom)); 1144 hrgn = CreateRectRgnIndirect(&rect); 1145 if (!hrgn) return 0; 1146 1147 rc = SendInternalMessageA(WM_NCPAINT, hrgn, 0); 1148 1149 DeleteObject(hrgn); 1150 1151 return rc; 1152 } 1153 else return 0; 1111 if ((pUpdateRect->left >= client.left) && (pUpdateRect->left < client.right) && 1112 (pUpdateRect->right >= client.left) && (pUpdateRect->right < client.right) && 1113 (pUpdateRect->top >= client.top) && (pUpdateRect->top < client.bottom) && 1114 (pUpdateRect->bottom >= client.top) && (pUpdateRect->bottom < client.bottom)) 1115 { 1116 return 0; 1117 } 1118 1119 dprintf(("MsgNCPaint (%d,%d)(%d,%d)", pUpdateRect->left, pUpdateRect->top, pUpdateRect->right, pUpdateRect->bottom)); 1120 hrgn = CreateRectRgnIndirect(pUpdateRect); 1121 1122 rc = SendInternalMessageA(WM_NCPAINT, hrgn, 0); 1123 1124 DeleteObject(hrgn); 1125 1126 return rc; 1154 1127 } 1155 1128 //****************************************************************************** … … 1164 1137 ULONG rc; 1165 1138 1166 if(lpWndPos)1167 {1139 if(lpWndPos) 1140 { 1168 1141 //set new window rectangle 1169 1142 setWindowRect(lpWndPos->x, lpWndPos->y, lpWndPos->x+lpWndPos->cx, 1170 1143 lpWndPos->y+lpWndPos->cy); 1171 1144 newWindowRect = rectWindow; 1172 }1173 else {1145 } 1146 else { 1174 1147 wndPos.hwnd = getWindowHandle(); 1175 1148 wndPos.hwndInsertAfter = 0; … … 1181 1154 wndPos.flags = SWP_FRAMECHANGED; 1182 1155 lpWndPos = &wndPos; 1183 } 1184 1185 newClientRect = rectClient; 1186 rc = SendNCCalcSize(TRUE, &newWindowRect, &oldWindowRect, &client, lpWndPos, &newClientRect); 1187 rectClient = newClientRect; //must update rectClient here 1188 1189 dprintf(("MsgFormatFrame: old client rect (%d,%d)(%d,%d), new client (%d,%d)(%d,%d)", client.left, client.top, client.right, client.bottom, rectClient.left, rectClient.top, rectClient.right, rectClient.bottom)); 1190 dprintf(("MsgFormatFrame: old window rect (%d,%d)(%d,%d), new window (%d,%d)(%d,%d)", oldWindowRect.left, oldWindowRect.top, oldWindowRect.right, oldWindowRect.bottom, rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom)); 1156 } 1157 1158 newClientRect = rectClient; 1159 rc = SendNCCalcSize(TRUE, &newWindowRect, &oldWindowRect, &client, lpWndPos, &newClientRect); 1160 rectClient = newClientRect; //must update rectClient here 1161 1162 dprintf(("MsgFormatFrame: old client rect (%d,%d)(%d,%d), new client (%d,%d)(%d,%d)", client.left, client.top, client.right, client.bottom, rectClient.left, rectClient.top, rectClient.right, rectClient.bottom)); 1163 dprintf(("MsgFormatFrame: old window rect (%d,%d)(%d,%d), new window (%d,%d)(%d,%d)", oldWindowRect.left, oldWindowRect.top, oldWindowRect.right, oldWindowRect.bottom, rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom)); 1164 1165 if(fNoSizeMsg || !EqualRect(&client, &rectClient)) { 1166 OSLibWinSetClientPos(getOS2WindowHandle(), rectClient.left, rectClient.top, getClientWidth(), getClientHeight(), getWindowHeight()); 1167 } 1191 1168 1192 1169 #if 1 … … 1430 1407 HandleNCPaint((HRGN)1); 1431 1408 if(hTaskList) { 1432 OSLibWinChangeTaskList(hTaskList, OS2Hwnd , getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0);1409 OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0); 1433 1410 } 1434 1411 } … … 1590 1567 return 1; 1591 1568 } 1592 1569 1593 1570 if (!windowClass || !windowClass->getBackgroundBrush()) return 0; 1594 1571 … … 1917 1894 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 1918 1895 { 1919 HandleNCPaint((HRGN)1);1920 if(hTaskList) {1921 OSLibWinChangeTaskList(hTaskList, OS2Hwnd, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0);1922 }1896 HandleNCPaint((HRGN)1); 1897 if(hTaskList) { 1898 OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0); 1899 } 1923 1900 } 1924 1901 … … 2231 2208 case SW_HIDE: 2232 2209 if (!wasVisible) goto END; 2233 swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | 2234 SWP_NOACTIVATE | SWP_NOZORDER;2210 2211 swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER; 2235 2212 break; 2236 2213 … … 2242 2219 /* fall through */ 2243 2220 case SW_MINIMIZE: 2244 if(!(getStyle() & WS_CHILD)) 2245 { 2246 if( !(getStyle() & WS_MINIMIZE) ) 2247 swp |= MinMaximize(SW_MINIMIZE, &newPos ); 2248 2249 swp |= SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW; 2250 } 2251 else { 2252 swp |= SWP_FRAMECHANGED; 2253 if( !(getStyle() & WS_MINIMIZE) ) { 2254 swp |= MinMaximize(SW_MINIMIZE, &newPos ); 2255 fMinMaxChange = TRUE; //-> invalidate entire window in WM_CALCINVALIDRECT 2256 } 2257 else swp |= SWP_NOSIZE | SWP_NOMOVE; 2258 } 2221 swp |= SWP_FRAMECHANGED; 2222 if( !(getStyle() & WS_MINIMIZE) ) { 2223 swp |= MinMaximize(SW_MINIMIZE, &newPos ); 2224 fMinMaxChange = TRUE; //-> invalidate entire window in WM_CALCINVALIDRECT 2225 } 2226 else swp |= SWP_NOSIZE | SWP_NOMOVE; 2259 2227 break; 2260 2228 … … 2317 2285 2318 2286 if(!(swp & SWP_NOACTIVATE)) { 2319 OSLibWinSetActiveWindow(OS2Hwnd );2287 OSLibWinSetActiveWindow(OS2HwndFrame); 2320 2288 } 2321 2289 … … 2454 2422 } 2455 2423 } 2456 OSLibWinQueryWindowPos(OS2Hwnd , &swpOld);2424 OSLibWinQueryWindowPos(OS2HwndFrame, &swpOld); 2457 2425 } 2458 2426 2459 2427 if(getParent()) { 2460 OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, getParent()->getWindowHeight(), 2461 getParent()->getClientRectPtr()->left, 2462 getParent()->getClientRectPtr()->top, 2463 OS2Hwnd); 2464 } 2465 else OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, OSLibQueryScreenHeight(), 0, 0, OS2Hwnd); 2428 OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, getParent()->getClientHeight(), 2429 OS2HwndFrame); 2430 } 2431 else OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, OSLibQueryScreenHeight(), OS2HwndFrame); 2432 2466 2433 if (swp.fl == 0) { 2467 2434 if(fuFlags & SWP_FRAMECHANGED) … … 2477 2444 Win32BaseWindow *wndBehind = Win32BaseWindow::GetWindowFromHandle(swp.hwndInsertBehind); 2478 2445 if(wndBehind) { 2479 swp.hwndInsertBehind = wndBehind->getOS2 WindowHandle();2446 swp.hwndInsertBehind = wndBehind->getOS2FrameWindowHandle(); 2480 2447 } 2481 2448 else { … … 2484 2451 } 2485 2452 } 2486 swp.hwnd = OS2Hwnd ;2453 swp.hwnd = OS2HwndFrame; 2487 2454 2488 2455 if(fuFlags & SWP_SHOWWINDOW && !IsWindowVisible(getWindowHandle())) { … … 2490 2457 if(hTaskList) { 2491 2458 dprintf(("Adding window %x to tasklist", getWindowHandle())); 2492 OSLibWinChangeTaskList(hTaskList, OS2Hwnd , getWindowNameA(), 1);2459 OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), 1); 2493 2460 } 2494 2461 } … … 2498 2465 if(hTaskList && !(getStyle() & WS_MINIMIZE)) { 2499 2466 dprintf(("Removing window %x from tasklist", getWindowHandle())); 2500 OSLibWinChangeTaskList(hTaskList, OS2Hwnd , getWindowNameA(), 0);2467 OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), 0); 2501 2468 } 2502 2469 } … … 2510 2477 } 2511 2478 2512 //Restore window origin of parent window with CS_OWNDC style2513 //(fixes paint offset problems in Opera windows)2514 if(getParent() && getParent()->isOwnDC()) {2515 dprintfOrigin(getParent()->getOwnDC());2516 selectClientArea(getParent(), getParent()->getOwnDC());2517 }2518 2519 2479 if((fuFlags & SWP_FRAMECHANGED) && (fuFlags & (SWP_NOMOVE | SWP_NOSIZE) == (SWP_NOMOVE | SWP_NOSIZE))) 2520 2480 { 2521 2481 NotifyFrameChanged(&wpos, &oldClientRect); 2522 2482 } 2523 2483 return (rc); … … 2713 2673 2714 2674 fDestroyWindowCalled = TRUE; 2715 return OSLibWinDestroyWindow(OS2Hwnd );2675 return OSLibWinDestroyWindow(OS2HwndFrame); 2716 2676 } 2717 2677 //****************************************************************************** … … 2770 2730 setParent(newparent); 2771 2731 getParent()->addChild(this); 2772 OSLibWinSetParent(getOS2 WindowHandle(), getParent()->getOS2WindowHandle());2732 OSLibWinSetParent(getOS2FrameWindowHandle(), getParent()->getOS2WindowHandle()); 2773 2733 if(!(getStyle() & WS_CHILD)) 2774 2734 { … … 2776 2736 setStyle(getStyle() | WS_CHILD); 2777 2737 if(getWindowId()) 2778 2779 2780 2781 2738 { 2739 DestroyMenu( (HMENU) getWindowId() ); 2740 setWindowId(0); 2741 } 2782 2742 } 2783 2743 } … … 2785 2745 setParent(windowDesktop); 2786 2746 windowDesktop->addChild(this); 2787 OSLibWinSetParent(getOS2 WindowHandle(), OSLIB_HWND_DESKTOP);2747 OSLibWinSetParent(getOS2FrameWindowHandle(), OSLIB_HWND_DESKTOP); 2788 2748 2789 2749 //TODO: Send WM_STYLECHANGED msg? … … 2824 2784 2825 2785 hwndTop = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_TOP); 2826 if(!isDesktopWindow()) { 2827 topwindow = GetWindowFromOS2Handle(hwndTop); 2828 if(topwindow) { 2829 return topwindow->getWindowHandle(); 2830 } 2831 return 0; 2786 if(!isDesktopWindow()) 2787 { 2788 topwindow = GetWindowFromOS2FrameHandle(hwndTop); 2789 if(topwindow) { 2790 return topwindow->getWindowHandle(); 2791 } 2792 return 0; 2832 2793 } 2833 2794 while(hwndTop) { 2834 topwindow = GetWindowFromOS2Handle(hwndTop);2835 if(topwindow) {2836 return topwindow->getWindowHandle();2837 }2795 topwindow = GetWindowFromOS2FrameHandle(hwndTop); 2796 if(topwindow) { 2797 return topwindow->getWindowHandle(); 2798 } 2838 2799 hwndTop = OSLibWinQueryWindow(hwndTop, QWOS_NEXT); 2839 2800 } … … 3011 2972 while(hwnd) 3012 2973 { 3013 wnd = GetWindowFromOS2 Handle(hwnd);2974 wnd = GetWindowFromOS2FrameHandle(hwnd); 3014 2975 if(wnd == NULL) { 3015 2976 hwnd = OSLibWinQueryClientWindow(hwnd); … … 3041 3002 Win32BaseWindow *window; 3042 3003 3043 #if 13044 3004 switch(uCmd) 3045 3005 { … … 3049 3009 window = (Win32BaseWindow *)getParent(); 3050 3010 hwndRelated = OSLibWinQueryWindow(window->getOS2WindowHandle(), QWOS_TOP); 3051 window = GetWindowFromOS2 Handle(hwndRelated);3011 window = GetWindowFromOS2FrameHandle(hwndRelated); 3052 3012 if(window) { 3053 3013 hwndRelated = window->getWindowHandle(); 3054 3014 } 3055 3015 else hwndRelated = 0; 3056 3016 } 3057 else hwndRelated = 0; //TODO: not correct; should get first child in z-order of desktop 3017 else { 3018 dprintf(("WARNING: GW_HWNDFIRST not correctly implemented for toplevel/most windows!")); 3019 hwndRelated = 0; //TODO: not correct; should get first child in z-order of desktop 3020 } 3058 3021 break; 3059 3022 3060 3023 case GW_HWNDLAST: 3061 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_BOTTOM); 3062 window = GetWindowFromOS2Handle(hwndRelated); 3063 if(window) { 3064 hwndRelated = window->getWindowHandle(); 3065 } 3066 else hwndRelated = 0; 3024 if(getParent()) { 3025 window = (Win32BaseWindow *)getParent(); 3026 hwndRelated = OSLibWinQueryWindow(window->getOS2WindowHandle(), QWOS_BOTTOM); 3027 dprintf(("os2 handle %x", hwndRelated)); 3028 window = GetWindowFromOS2FrameHandle(hwndRelated); 3029 if(window) { 3030 hwndRelated = window->getWindowHandle(); 3031 } 3032 else hwndRelated = 0; 3033 } 3034 else { 3035 dprintf(("WARNING: GW_HWNDLAST not correctly implemented for toplevel/most windows!")); 3036 hwndRelated = 0; //TODO: not correct; should get first child in z-order of desktop 3037 } 3067 3038 break; 3068 3039 3069 3040 case GW_HWNDNEXT: 3070 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_NEXT); 3071 window = GetWindowFromOS2Handle(hwndRelated); 3072 if(window) { 3073 hwndRelated = window->getWindowHandle(); 3074 } 3075 else hwndRelated = 0; 3041 if(getParent()) { 3042 hwndRelated = OSLibWinQueryWindow(getOS2FrameWindowHandle(), QWOS_NEXT); 3043 window = GetWindowFromOS2FrameHandle(hwndRelated); 3044 if(window) { 3045 hwndRelated = window->getWindowHandle(); 3046 } 3047 else hwndRelated = 0; 3048 } 3049 else { 3050 dprintf(("WARNING: GW_HWNDNEXT not correctly implemented for toplevel/most windows!")); 3051 hwndRelated = 0; //TODO: not correct; should get first child in z-order of desktop 3052 } 3076 3053 break; 3077 3054 3078 3055 case GW_HWNDPREV: 3079 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_PREV); 3080 window = GetWindowFromOS2Handle(hwndRelated); 3081 if(window) { 3082 hwndRelated = window->getWindowHandle(); 3083 } 3084 else hwndRelated = 0; 3056 if(getParent()) { 3057 hwndRelated = OSLibWinQueryWindow(getOS2FrameWindowHandle(), QWOS_PREV); 3058 window = GetWindowFromOS2FrameHandle(hwndRelated); 3059 if(window) { 3060 hwndRelated = window->getWindowHandle(); 3061 } 3062 else hwndRelated = 0; 3063 } 3064 else { 3065 dprintf(("WARNING: GW_HWNDPREV not correctly implemented for toplevel/most windows!")); 3066 hwndRelated = 0; //TODO: not correct; should get first child in z-order of desktop 3067 } 3085 3068 break; 3086 3069 … … 3093 3076 case GW_CHILD: 3094 3077 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_TOP); 3095 window = GetWindowFromOS2 Handle(hwndRelated);3078 window = GetWindowFromOS2FrameHandle(hwndRelated); 3096 3079 if(window) { 3097 3080 hwndRelated = window->getWindowHandle(); … … 3100 3083 break; 3101 3084 } 3102 #else3103 switch(uCmd)3104 {3105 case GW_HWNDFIRST:3106 if(getParent()) {3107 window = (Win32BaseWindow *)getParent()->getFirstChild();3108 hwndRelated = window->getWindowHandle();3109 }3110 break;3111 3112 case GW_HWNDLAST:3113 if(!getParent())3114 {3115 goto end;3116 }3117 3118 window = this;3119 while(window->getNextChild())3120 {3121 window = (Win32BaseWindow *)window->getNextChild();3122 }3123 hwndRelated = window->getWindowHandle();3124 break;3125 3126 case GW_HWNDNEXT:3127 window = (Win32BaseWindow *)getNextChild();3128 if(window) {3129 hwndRelated = window->getWindowHandle();3130 }3131 break;3132 3133 case GW_HWNDPREV:3134 if(!getParent())3135 {3136 goto end;3137 }3138 window = (Win32BaseWindow *)(getParent()->getFirstChild()); /* First sibling */3139 if(window == this)3140 {3141 hwndRelated = 0; /* First in list */3142 goto end;3143 }3144 while(window->getNextChild())3145 {3146 if (window->getNextChild() == this)3147 {3148 hwndRelated = window->getWindowHandle();3149 goto end;3150 }3151 window = (Win32BaseWindow *)window->getNextChild();3152 }3153 break;3154 3155 case GW_OWNER:3156 if(getOwner()) {3157 hwndRelated = getOwner()->getWindowHandle();3158 }3159 break;3160 3161 case GW_CHILD:3162 if(getFirstChild()) {3163 hwndRelated = ((Win32BaseWindow *)getFirstChild())->getWindowHandle();3164 }3165 break;3166 }3167 #endif3168 3085 end: 3169 3086 dprintf(("GetWindow %x %d returned %x", getWindowHandle(), uCmd, hwndRelated)); … … 3227 3144 SendMessageA(WM_CANCELMODE, 0, 0); 3228 3145 } 3229 OSLibWinEnableWindow(OS2Hwnd , fEnable);3146 OSLibWinEnableWindow(OS2HwndFrame, fEnable); 3230 3147 if(fEnable == FALSE) { 3231 3148 //SvL: No need to clear focus as PM already does this … … 3436 3353 setStyle(ss.styleNew); 3437 3354 SendInternalMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss); 3438 OSLibSetWindowStyle(getOS2 WindowHandle(), getStyle(), getExStyle());3355 OSLibSetWindowStyle(getOS2FrameWindowHandle(), getOS2WindowHandle(), getStyle(), getExStyle()); 3439 3356 #ifdef DEBUG 3440 3357 PrintWindowStyle(ss.styleNew, 0); … … 3607 3524 // dprintf2(("Win32BaseWindow::GetWindowFromOS2Handle: not an Odin os2 window %x", hwnd)); 3608 3525 return 0; 3526 } 3527 //****************************************************************************** 3528 //****************************************************************************** 3529 Win32BaseWindow *Win32BaseWindow::GetWindowFromOS2FrameHandle(HWND hwnd) 3530 { 3531 return GetWindowFromOS2Handle(OSLibWinWindowFromID(hwnd,OSLIB_FID_CLIENT)); 3609 3532 } 3610 3533 //****************************************************************************** … … 3808 3731 return window->getWindowHandle(); 3809 3732 } 3733 window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwnd); 3734 if(window) { 3735 return window->getWindowHandle(); 3736 } 3737 3810 3738 // dprintf2(("Win32BaseWindow::OS2ToWin32Handle: not a win32 window %x", hwnd)); 3811 3739 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.