- Timestamp:
- Aug 29, 1999, 10:05:08 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/defwndproc.cpp
r392 r740 1 /* $Id: defwndproc.cpp,v 1. 4 1999-07-25 15:51:55sandervl Exp $ */1 /* $Id: defwndproc.cpp,v 1.5 1999-08-29 20:05:07 sandervl Exp $ */ 2 2 3 3 /* … … 6 6 * Copyright 1998 Sander van Leeuwen 7 7 * 8 * 9 * TODO: Incomplete default window handlers + incorrect handler (defframe) 8 10 * 9 11 * Project Odin Software License can be found in LICENSE.TXT … … 116 118 } 117 119 //****************************************************************************** 120 //TODO: Should be handled differently than the normal wnd proc 118 121 //****************************************************************************** 119 122 LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam) 120 123 { 121 #ifdef DEBUG 122 //// WriteLog("*DFP*"); 123 #endif 124 switch(Msg) { 125 case WM_SETREDRAW: //Open32 does not set the visible flag 126 if(wParam) 127 SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE); 128 else 129 SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE); 130 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam); 131 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 132 return(TRUE); 133 case WM_CTLCOLORMSGBOX: 134 case WM_CTLCOLOREDIT: 135 case WM_CTLCOLORLISTBOX: 136 case WM_CTLCOLORBTN: 137 case WM_CTLCOLORDLG: 138 case WM_CTLCOLORSTATIC: 139 case WM_CTLCOLORSCROLLBAR: 140 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 141 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 142 return GetSysColorBrush(COLOR_BTNFACE); 143 144 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 145 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame)); 146 return 0; 147 148 default: 149 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam); 124 Win32Window *window; 125 126 window = Win32Window::GetWindowFromHandle(hwndFrame); 127 if(!window) { 128 dprintf(("DefFrameProcA, window %x not found", hwndFrame)); 129 return 0; 130 } 131 return window->DefWindowProcA(Msg, wParam, lParam); 132 } 133 //****************************************************************************** 134 //TODO: Should be handled differently than the normal wnd proc 135 //****************************************************************************** 136 LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam) 137 { 138 Win32Window *window; 139 140 window = Win32Window::GetWindowFromHandle(hwndFrame); 141 if(!window) { 142 dprintf(("DefFrameProcW, window %x not found", hwndFrame)); 143 return 0; 144 } 145 return window->DefWindowProcW(Msg, wParam, lParam); 146 } 147 //****************************************************************************** 148 //****************************************************************************** 149 LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 150 { 151 #ifdef DEBUG 152 //// WriteLog("*DMP*"); 153 #endif 154 switch(Msg) { 155 case WM_SETREDRAW: //Open32 does not set the visible flag 156 if(wParam) 157 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 158 else 159 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE); 160 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); 161 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 162 return(TRUE); 163 case WM_CTLCOLORMSGBOX: 164 case WM_CTLCOLOREDIT: 165 case WM_CTLCOLORLISTBOX: 166 case WM_CTLCOLORBTN: 167 case WM_CTLCOLORDLG: 168 case WM_CTLCOLORSTATIC: 169 case WM_CTLCOLORSCROLLBAR: 170 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 171 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 172 return GetSysColorBrush(COLOR_BTNFACE); 173 174 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 175 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 176 return 0; 177 178 default: 179 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); 150 180 } 151 181 } … … 153 183 //NOTE: Unicode msg translation! 154 184 //****************************************************************************** 155 LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)156 {157 #ifdef DEBUG158 //// WriteLog("*DFPW*");159 #endif160 switch(Msg) {161 case WM_SETREDRAW: //Open32 does not set the visible flag162 if(wParam)163 SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);164 else165 SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);166 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);167 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)168 return(TRUE);169 case WM_CTLCOLORMSGBOX:170 case WM_CTLCOLOREDIT:171 case WM_CTLCOLORLISTBOX:172 case WM_CTLCOLORBTN:173 case WM_CTLCOLORDLG:174 case WM_CTLCOLORSTATIC:175 case WM_CTLCOLORSCROLLBAR:176 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));177 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));178 return GetSysColorBrush(COLOR_BTNFACE);179 180 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!181 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));182 return 0;183 184 default:185 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);186 }187 }188 //******************************************************************************189 //******************************************************************************190 LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)191 {192 #ifdef DEBUG193 //// WriteLog("*DMP*");194 #endif195 switch(Msg) {196 case WM_SETREDRAW: //Open32 does not set the visible flag197 if(wParam)198 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);199 else200 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);201 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);202 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)203 return(TRUE);204 case WM_CTLCOLORMSGBOX:205 case WM_CTLCOLOREDIT:206 case WM_CTLCOLORLISTBOX:207 case WM_CTLCOLORBTN:208 case WM_CTLCOLORDLG:209 case WM_CTLCOLORSTATIC:210 case WM_CTLCOLORSCROLLBAR:211 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));212 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));213 return GetSysColorBrush(COLOR_BTNFACE);214 215 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!216 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));217 return 0;218 219 default:220 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);221 }222 }223 //******************************************************************************224 //NOTE: Unicode msg translation!225 //******************************************************************************226 185 LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 227 186 { -
trunk/src/user32/new/oslibmsg.cpp
r342 r740 1 /* $Id: oslibmsg.cpp,v 1. 2 1999-07-20 07:42:35sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.3 1999-08-29 20:05:07 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 62 62 void OSLibWinPostQuitMessage(ULONG nExitCode) 63 63 { 64 WinPostQueueMsg( GetThreadMessageQueue(), WM_QUIT, (MPARAM)nExitCode, 0);64 WinPostQueueMsg(NULLHANDLE, WM_QUIT, (MPARAM)nExitCode, 0); 65 65 } 66 66 //****************************************************************************** -
trunk/src/user32/new/pmwindow.cpp
r729 r740 1 /* $Id: pmwindow.cpp,v 1.2 4 1999-08-28 19:32:46sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.25 1999-08-29 20:05:07 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 434 434 case WM_MOUSEMOVE: 435 435 { 436 //Only send this message when the mouse isn't captured 437 if(WinQueryCapture(HWND_DESKTOP) != NULLHANDLE) { 438 goto RunDefWndProc; 439 } 436 440 ULONG keystate = 0; 437 441 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1)) … … 589 593 590 594 case WM_HITTEST: 591 if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y(OSLIB_HWND_DESKTOP, hwnd, (*(POINTS *)&mp1).y))) { 592 goto RunDefWndProc; 593 } 595 // Only send this message if the window is enabled 596 if (WinIsWindowEnabled(hwnd)) 597 { 598 if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y(OSLIB_HWND_DESKTOP, hwnd, (*(POINTS *)&mp1).y))) { 599 goto RunDefWndProc; 600 } 601 } 602 else goto RunDefWndProc; 594 603 break; 595 604 -
trunk/src/user32/new/win32wnd.cpp
r729 r740 1 /* $Id: win32wnd.cpp,v 1.3 4 1999-08-28 19:32:47 sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.35 1999-08-29 20:05:07 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 880 880 { 881 881 if(hwnd == 0) { 882 //other app lost focus883 SendInternalMessageA(WM_ACTIVATEAPP, TRUE, 0); //TODO: Need thread id from hwnd app884 } 885 return SendInternalMessageA(WM_SETFOCUS, hwnd, 0);882 //other app lost focus 883 SendInternalMessageA(WM_ACTIVATEAPP, TRUE, 0); //TODO: Need thread id from hwnd app 884 } 885 return SendInternalMessageA(WM_SETFOCUS, hwnd, 0); 886 886 } 887 887 //****************************************************************************** … … 890 890 { 891 891 if(hwnd == 0) { 892 //other app lost focus893 SendInternalMessageA(WM_ACTIVATEAPP, FALSE, 0); //TODO: Need thread id from hwnd app894 } 895 return SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);892 //other app lost focus 893 SendInternalMessageA(WM_ACTIVATEAPP, FALSE, 0); //TODO: Need thread id from hwnd app 894 } 895 return SendInternalMessageA(WM_KILLFOCUS, hwnd, 0); 896 896 } 897 897 //****************************************************************************** … … 949 949 } 950 950 } 951 SendInternalMessageA(win32ncmsg, lastHitTestVal, MAKELONG(ncx, ncy)); //TODO: 952 return SendInternalMessageA(win32msg, 0, MAKELONG(clx, cly)); 951 SendInternalMessageA(WM_SETCURSOR, Win32Hwnd, MAKELONG(lastHitTestVal, win32ncmsg)); 952 953 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 954 if(lastHitTestVal != HTCLIENT) { 955 SendInternalMessageA(win32ncmsg, lastHitTestVal, MAKELONG(ncx, ncy)); //TODO: 956 } 957 return SendInternalMessageA(win32msg, 0, MAKELONG(clx, cly)); 953 958 } 954 959 //****************************************************************************** … … 957 962 { 958 963 ULONG winstate = 0; 964 ULONG setcursormsg = WM_MOUSEMOVE; 959 965 960 966 if(keystate & WMMOVE_LBUTTON) … … 969 975 winstate |= MK_CONTROL; 970 976 971 return SendInternalMessageA(WM_MOUSEMOVE, keystate, MAKELONG(x, y)); 977 if(lastHitTestVal != HTCLIENT) { 978 setcursormsg = WM_NCMOUSEMOVE; 979 } 980 //TODO: hiword should be 0 if window enters menu mode (SDK docs) 981 SendInternalMessageA(WM_SETCURSOR, Win32Hwnd, MAKELONG(lastHitTestVal, setcursormsg)); 982 983 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 984 if(lastHitTestVal != HTCLIENT) { 985 SendInternalMessageA(WM_NCMOUSEMOVE, lastHitTestVal, MAKELONG(x, y)); 986 } 987 return SendInternalMessageA(WM_MOUSEMOVE, keystate, MAKELONG(x, y)); 972 988 } 973 989 //****************************************************************************** … … 1147 1163 return 0; //TODO: Send WM_SYSCOMMAND if required 1148 1164 1149 case WM_NCHITTEST: //TODO: 1150 return 0;1165 case WM_NCHITTEST: //TODO: Calculate position of 1166 return HTCLIENT; 1151 1167 1152 1168 default: -
trunk/src/user32/new/window.cpp
r724 r740 1 /* $Id: window.cpp,v 1.1 7 1999-08-28 14:09:30sandervl Exp $ */1 /* $Id: window.cpp,v 1.18 1999-08-29 20:05:08 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 82 82 //****************************************************************************** 83 83 //****************************************************************************** 84 HWND WIN32API CreateMDIWindowA(LPCSTR arg1, LPCSTR arg2, DWORD arg3,85 int arg4, int arg5, int arg6, int arg7,86 HWND arg8, HINSTANCE arg9, LPARAM arg10)87 {88 HWND hwnd;89 90 dprintf(("USER32: CreateMDIWindowA\n"));91 92 hwnd = O32_CreateMDIWindow((LPSTR)arg1, (LPSTR)arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);93 94 dprintf(("USER32: CreateMDIWindowA returned %X\n", hwnd));95 return hwnd;96 }97 //******************************************************************************98 //******************************************************************************99 HWND WIN32API CreateMDIWindowW(LPCWSTR arg1, LPCWSTR arg2, DWORD arg3, int arg4,100 int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9,101 LPARAM arg10)102 {103 HWND hwnd;104 char *astring1 = NULL, *astring2 = NULL;105 106 if((int)arg1 >> 16 != 0) {107 astring1 = UnicodeToAsciiString((LPWSTR)arg1);108 }109 else astring1 = (char *)arg2;110 111 astring2 = UnicodeToAsciiString((LPWSTR)arg2);112 113 hwnd = O32_CreateMDIWindow(astring1, astring2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);114 115 if(astring1) FreeAsciiString(astring1);116 FreeAsciiString(astring2);117 dprintf(("USER32: CreateMDIWindowW hwnd = %X\n", hwnd));118 return(hwnd);119 }120 //******************************************************************************121 //******************************************************************************122 84 HWND WIN32API CreateWindowExW(DWORD exStyle, LPCWSTR className, 123 85 LPCWSTR windowName, DWORD style, INT x, … … 171 133 } 172 134 return window->getWindowHandle(); 135 } 136 //****************************************************************************** 137 //****************************************************************************** 138 HWND WIN32API CreateMDIWindowA(LPCSTR lpszClassName, LPCSTR lpszWindowName, 139 DWORD dwStyle, int x, int y, int nWidth, 140 int nHeight, HWND hwndParent, 141 HINSTANCE hInstance, LPARAM lParam ) 142 { 143 HWND hwnd; 144 MDICREATESTRUCTA cs; 145 Win32Window *window; 146 147 window = Win32Window::GetWindowFromHandle(hwndParent); 148 if(!window) { 149 dprintf(("CreateMDIWindowA, window %x not found", hwndParent)); 150 return 0; 151 } 152 153 dprintf(("USER32: CreateMDIWindowA\n")); 154 cs.szClass = lpszClassName; 155 cs.szTitle = lpszWindowName; 156 cs.hOwner = hInstance; 157 cs.x = x; 158 cs.y = y; 159 cs.cx = nHeight; 160 cs.cy = nWidth; 161 cs.style = dwStyle; 162 cs.lParam = lParam; 163 164 return window->SendMessageA(WM_MDICREATE, 0, (LPARAM)&cs); 165 } 166 //****************************************************************************** 167 //****************************************************************************** 168 HWND WIN32API CreateMDIWindowW(LPCWSTR lpszClassName, LPCWSTR lpszWindowName, 169 DWORD dwStyle, int x, int y, int nWidth, 170 int nHeight, HWND hwndParent, 171 HINSTANCE hInstance, LPARAM lParam ) 172 { 173 HWND hwnd; 174 MDICREATESTRUCTW cs; 175 Win32Window *window; 176 177 window = Win32Window::GetWindowFromHandle(hwndParent); 178 if(!window) { 179 dprintf(("CreateMDIWindowW, window %x not found", hwndParent)); 180 return 0; 181 } 182 183 dprintf(("USER32: CreateMDIWindowW\n")); 184 cs.szClass = lpszClassName; 185 cs.szTitle = lpszWindowName; 186 cs.hOwner = hInstance; 187 cs.x = x; 188 cs.y = y; 189 cs.cx = nHeight; 190 cs.cy = nWidth; 191 cs.style = dwStyle; 192 cs.lParam = lParam; 193 194 return window->SendMessageW(WM_MDICREATE, 0, (LPARAM)&cs); 173 195 } 174 196 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.