Changeset 1917 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Dec 1, 1999, 11:49:45 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r1860 r1917 1 /* $Id: win32wbase.cpp,v 1.9 8 1999-11-27 14:16:35 cbratschiExp $ */1 /* $Id: win32wbase.cpp,v 1.99 1999-12-01 10:49:45 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 1496 1496 //****************************************************************************** 1497 1497 //****************************************************************************** 1498 LRESULT Win32BaseWindow::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam) 1499 { 1498 LRESULT Win32BaseWindow::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam, BOOL fReentered) 1499 { 1500 //Lotus Notes v5.0.1 calls SetWindowTextA for unicode static window -> calls DefWindowProcA 1501 if(IsUnicode() && !fReentered) { 1502 return DefWindowProcW(Msg, wParam, lParam); 1503 } 1500 1504 switch(Msg) 1501 1505 { … … 1527 1531 windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR)); 1528 1532 lstrcpyAtoW(windowNameW, windowNameA); 1529 } else 1533 } 1534 else 1530 1535 { 1531 1536 windowNameA = NULL; … … 1533 1538 wndNameLength = 0; 1534 1539 } 1535 dprintf(("WM_SETTEXT of % dto %s\n", Win32Hwnd, lParam));1540 dprintf(("WM_SETTEXT of %x to %s\n", Win32Hwnd, lParam)); 1536 1541 1537 1542 if(OS2HwndFrame && (dwStyle & WS_CAPTION) == WS_CAPTION) … … 1789 1794 windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR)); 1790 1795 lstrcpyW(windowNameW,lpsz); 1791 } else 1796 } 1797 else 1792 1798 { 1793 1799 windowNameA = NULL; … … 1803 1809 1804 1810 default: 1805 return DefWindowProcA(Msg, wParam, lParam );1811 return DefWindowProcA(Msg, wParam, lParam, TRUE); 1806 1812 } 1807 1813 } … … 2344 2350 if (isChild()) 2345 2351 { 2346 hParent = getParent()->getOS2WindowHandle(); 2352 Win32BaseWindow *windowParent = getParent(); 2353 if(windowParent) { 2354 hParent = getParent()->getOS2WindowHandle(); 2355 } 2356 else dprintf(("WARNING: Win32BaseWindow::SetWindowPos window %x is child but has no parent!!", getWindowHandle())); 2347 2357 } 2348 2358 OSLibWinQueryWindowPos(OS2HwndFrame, &swpOld); … … 2734 2744 HWND Win32BaseWindow::SetActiveWindow() 2735 2745 { 2736 return OSLibWinSetActiveWindow(OS2HwndFrame); 2737 } 2738 //****************************************************************************** 2739 //WM_ENABLE is sent to hwnd, but not to it's children (as it should be) 2740 //****************************************************************************** 2741 BOOL Win32BaseWindow::EnableWindow(BOOL fEnable) 2742 { 2743 return OSLibWinEnableWindow(OS2HwndFrame, fEnable); 2744 } 2745 //****************************************************************************** 2746 //****************************************************************************** 2747 BOOL Win32BaseWindow::CloseWindow() 2748 { 2749 return OSLibWinMinimizeWindow(OS2HwndFrame); 2750 } 2751 //****************************************************************************** 2752 //****************************************************************************** 2753 HWND Win32BaseWindow::GetActiveWindow() 2754 { 2755 HWND hwndActive; 2746 HWND hwndActive; 2756 2747 Win32BaseWindow *win32wnd; 2757 2748 ULONG magic; 2758 2749 2759 hwndActive = OSLibWinQueryActiveWindow(); 2760 2750 hwndActive = OSLibWinSetActiveWindow(OS2HwndFrame); 2761 2751 win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR); 2762 2752 magic = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC); … … 2765 2755 return win32wnd->getWindowHandle(); 2766 2756 } 2767 return hwndActive; 2757 return 0; 2758 } 2759 //****************************************************************************** 2760 //WM_ENABLE is sent to hwnd, but not to it's children (as it should be) 2761 //****************************************************************************** 2762 BOOL Win32BaseWindow::EnableWindow(BOOL fEnable) 2763 { 2764 return OSLibWinEnableWindow(OS2HwndFrame, fEnable); 2765 } 2766 //****************************************************************************** 2767 //****************************************************************************** 2768 BOOL Win32BaseWindow::CloseWindow() 2769 { 2770 return OSLibWinMinimizeWindow(OS2HwndFrame); 2771 } 2772 //****************************************************************************** 2773 //****************************************************************************** 2774 HWND Win32BaseWindow::GetActiveWindow() 2775 { 2776 HWND hwndActive; 2777 Win32BaseWindow *win32wnd; 2778 ULONG magic; 2779 2780 hwndActive = OSLibWinQueryActiveWindow(); 2781 2782 win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR); 2783 magic = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC); 2784 if(CheckMagicDword(magic) && win32wnd) 2785 { 2786 return win32wnd->getWindowHandle(); 2787 } 2788 return 0; 2789 // return hwndActive; 2768 2790 } 2769 2791 //****************************************************************************** … … 2823 2845 BOOL Win32BaseWindow::SetWindowTextA(LPSTR lpsz) 2824 2846 { 2847 //hmm. Notes v5.0.1 creates static window with CreateWindowExW and calls this... 2848 if(IsUnicode() && lpsz) { 2849 LPWSTR lpWindowNameW = (LPWSTR)alloca((strlen(lpsz)+1)*sizeof(WCHAR)); 2850 lstrcpyAtoW(lpWindowNameW, lpsz); 2851 2852 return SendInternalMessageW(WM_SETTEXT,0,(LPARAM)lpWindowNameW); 2853 } 2825 2854 return SendInternalMessageA(WM_SETTEXT,0,(LPARAM)lpsz); 2826 2855 } … … 2934 2963 2935 2964 switch(index) { 2936 2937 2965 case GWL_EXSTYLE: 2966 value = dwExStyle; 2938 2967 break; 2939 2940 2968 case GWL_STYLE: 2969 value = dwStyle; 2941 2970 break; 2942 2943 2971 case GWL_WNDPROC: 2972 value = (ULONG)getWindowProc(); 2944 2973 break; 2945 2946 2974 case GWL_HINSTANCE: 2975 value = hInstance; 2947 2976 break; 2948 2949 2950 2951 2952 elsevalue = 0;2977 case GWL_HWNDPARENT: 2978 if(getParent()) { 2979 value = getParent()->getWindowHandle(); 2980 } 2981 else value = 0; 2953 2982 break; 2954 2955 2983 case GWL_ID: 2984 value = getWindowId(); 2956 2985 break; 2957 2958 2986 case GWL_USERDATA: 2987 value = userData; 2959 2988 break; 2960 2961 2962 2963 2989 default: 2990 if(index >= 0 && index/4 < nrUserWindowLong) 2991 { 2992 value = userWindowLong[index/4]; 2964 2993 break; 2965 2966 2967 2994 } 2995 SetLastError(ERROR_INVALID_PARAMETER); 2996 return 0; 2968 2997 } 2969 2998 dprintf2(("GetWindowLongA %x %d %x", getWindowHandle(), index, value)); … … 3013 3042 return window; 3014 3043 } 3015 else return NULL; 3044 // dprintf2(("Win32BaseWindow::GetWindowFromHandle: not a win32 window %x", hwnd)); 3045 return NULL; 3016 3046 } 3017 3047 //****************************************************************************** … … 3033 3063 return win32wnd; 3034 3064 } 3065 // dprintf2(("Win32BaseWindow::GetWindowFromOS2Handle: not an Odin os2 window %x", hwnd)); 3035 3066 return 0; 3036 3067 } … … 3050 3081 return window->getOS2WindowHandle(); 3051 3082 } 3052 else return hwnd; 3083 // dprintf2(("Win32BaseWindow::Win32ToOS2Handle: not a win32 window %x", hwnd)); 3084 return hwnd; 3053 3085 } 3054 3086 //****************************************************************************** … … 3061 3093 return window->getOS2FrameWindowHandle(); 3062 3094 } 3063 else return hwnd; 3095 // dprintf2(("Win32BaseWindow::Win32ToOS2FrameHandle: not a win32 window %x", hwnd)); 3096 return hwnd; 3064 3097 } 3065 3098 //****************************************************************************** … … 3076 3109 return window->getWindowHandle(); 3077 3110 } 3078 else return 0; 3111 // dprintf2(("Win32BaseWindow::OS2ToWin32Handle: not a win32 window %x", hwnd)); 3112 return 0; 3079 3113 // else return hwnd; //OS/2 window handle 3080 3114 }
Note:
See TracChangeset
for help on using the changeset viewer.