Changeset 392 for trunk/src/user32/new/defwndproc.cpp
- Timestamp:
- Jul 25, 1999, 5:51:57 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/defwndproc.cpp
r391 r392 1 /* $Id: defwndproc.cpp,v 1. 3 1999-07-25 09:19:21sandervl Exp $ */1 /* $Id: defwndproc.cpp,v 1.4 1999-07-25 15:51:55 sandervl Exp $ */ 2 2 3 3 /* … … 12 12 #include "user32.h" 13 13 #include "syscolor.h" 14 #include "win32wnd.h" 14 15 15 16 #ifdef DEBUG … … 21 22 LRESULT WIN32API DefWindowProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 22 23 { 23 #ifdef DEBUG 24 //// WriteLog("DEFWNDPROC "); 25 //// WriteLog("*DWP*"); 26 #endif 27 switch(Msg) 28 { 29 case WM_SETREDRAW: //Open32 does not set the visible flag 30 if(wParam) 31 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 32 else SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE); 33 34 return 0; //TODO 35 36 case WM_NCCREATE: 37 return(TRUE); 38 39 case WM_CTLCOLORMSGBOX: 40 case WM_CTLCOLOREDIT: 41 case WM_CTLCOLORLISTBOX: 42 case WM_CTLCOLORBTN: 43 case WM_CTLCOLORDLG: 44 case WM_CTLCOLORSTATIC: 45 case WM_CTLCOLORSCROLLBAR: 46 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 47 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 48 return GetSysColorBrush(COLOR_BTNFACE); 49 50 case WM_PARENTNOTIFY: 51 return 0; 52 53 case WM_MOUSEACTIVATE: 54 { 55 DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 56 DWORD dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 57 dprintf(("DefWndProc: WM_MOUSEACTIVATE for %x Msg %s", hwnd, GetMsgText(HIWORD(lParam)))); 58 if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) ) 59 { 60 LRESULT rc = SendMessageA(GetParent(hwnd), WM_MOUSEACTIVATE, wParam, lParam ); 61 if(rc) return rc; 62 } 63 return (LOWORD(lParam) == HTCAPTION) ? MA_NOACTIVATE : MA_ACTIVATE; 64 } 65 case WM_SETCURSOR: 66 { 67 DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 68 DWORD dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 69 dprintf(("DefWndProc: WM_SETCURSOR for %x Msg %s", hwnd, GetMsgText(HIWORD(lParam)))); 70 if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) ) 71 { 72 LRESULT rc = SendMessageA(GetParent(hwnd), WM_SETCURSOR, wParam, lParam); 73 if(rc) return rc; 74 } 75 return 1; 76 } 77 case WM_MOUSEMOVE: 78 return 0; 79 80 case WM_ERASEBKGND: 81 case WM_ICONERASEBKGND: 82 return 0; 83 84 case WM_NCLBUTTONDOWN: 85 case WM_NCLBUTTONUP: 86 case WM_NCLBUTTONDBLCLK: 87 case WM_NCRBUTTONUP: 88 case WM_NCRBUTTONDOWN: 89 case WM_NCRBUTTONDBLCLK: 90 case WM_NCMBUTTONDOWN: 91 case WM_NCMBUTTONUP: 92 case WM_NCMBUTTONDBLCLK: 93 return 0; //TODO: Send WM_SYSCOMMAND if required 94 95 case WM_NCHITTEST: //TODO: 96 return 0; 97 98 default: 99 return 1; 24 Win32Window *window; 25 26 window = Win32Window::GetWindowFromHandle(hwnd); 27 if(!window) { 28 dprintf(("DefWindowProcA, window %x not found", hwnd)); 29 return 0; 30 } 31 return window->DefWindowProcA(Msg, wParam, lParam); 32 } 33 //****************************************************************************** 34 //****************************************************************************** 35 LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 36 { 37 Win32Window *window; 38 39 window = Win32Window::GetWindowFromHandle(hwnd); 40 if(!window) { 41 dprintf(("DefWindowProcW, window %x not found", hwnd)); 42 return 0; 43 } 44 return window->DefWindowProcW(Msg, wParam, lParam); 45 } 46 //****************************************************************************** 47 //****************************************************************************** 48 LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 49 { 50 #ifdef DEBUG 51 //// WriteLog("*DDP*"); 52 #endif 53 switch(Msg) { 54 case WM_SETREDRAW: //Open32 does not set the visible flag 55 if(wParam) 56 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 57 else 58 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE); 59 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 60 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 61 return(TRUE); 62 case WM_CTLCOLORMSGBOX: 63 case WM_CTLCOLOREDIT: 64 case WM_CTLCOLORLISTBOX: 65 case WM_CTLCOLORBTN: 66 case WM_CTLCOLORDLG: 67 case WM_CTLCOLORSTATIC: 68 case WM_CTLCOLORSCROLLBAR: 69 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 70 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 71 return GetSysColorBrush(COLOR_BTNFACE); 72 73 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 74 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 75 return 0; 76 77 default: 78 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 100 79 } 101 80 } … … 103 82 //NOTE: Unicode msg translation! 104 83 //****************************************************************************** 105 LRESULT WIN32API Def WindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)106 { 107 #ifdef DEBUG 108 //// WriteLog("*D WPW*");109 #endif 110 switch(Msg) { 111 case WM_SETREDRAW: //Open32 does not set the visible flag 112 if(wParam) 113 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 114 else 115 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE); 116 return O32_Def WindowProc(hwnd, Msg, wParam, lParam);117 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 118 return(TRUE); 119 case WM_CTLCOLORMSGBOX: 120 case WM_CTLCOLOREDIT: 121 case WM_CTLCOLORLISTBOX: 122 case WM_CTLCOLORBTN: 123 case WM_CTLCOLORDLG: 124 case WM_CTLCOLORSTATIC: 125 case WM_CTLCOLORSCROLLBAR: 126 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 127 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 128 return GetSysColorBrush(COLOR_BTNFACE); 129 130 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 131 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 132 return 0; 133 134 default: 135 return O32_Def WindowProc(hwnd, Msg, wParam, lParam);136 } 137 } 138 //****************************************************************************** 139 //****************************************************************************** 140 LRESULT WIN32API Def DlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)141 { 142 #ifdef DEBUG 143 //// WriteLog("*D DP*");144 #endif 145 switch(Msg) { 146 case WM_SETREDRAW: //Open32 does not set the visible flag 147 if(wParam) 148 SetWindowLongA (hwnd , GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);149 else 150 SetWindowLongA (hwnd , GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);151 return O32_Def DlgProc(hwnd, Msg, wParam, lParam);152 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 153 return(TRUE); 154 case WM_CTLCOLORMSGBOX: 155 case WM_CTLCOLOREDIT: 156 case WM_CTLCOLORLISTBOX: 157 case WM_CTLCOLORBTN: 158 case WM_CTLCOLORDLG: 159 case WM_CTLCOLORSTATIC: 160 case WM_CTLCOLORSCROLLBAR: 161 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 162 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 163 return GetSysColorBrush(COLOR_BTNFACE); 164 165 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 166 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd ));167 return 0; 168 169 default: 170 return O32_Def DlgProc(hwnd, Msg, wParam, lParam);84 LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 85 { 86 #ifdef DEBUG 87 //// WriteLog("*DDPW*"); 88 #endif 89 switch(Msg) { 90 case WM_SETREDRAW: //Open32 does not set the visible flag 91 if(wParam) 92 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 93 else 94 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE); 95 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 96 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 97 return(TRUE); 98 case WM_CTLCOLORMSGBOX: 99 case WM_CTLCOLOREDIT: 100 case WM_CTLCOLORLISTBOX: 101 case WM_CTLCOLORBTN: 102 case WM_CTLCOLORDLG: 103 case WM_CTLCOLORSTATIC: 104 case WM_CTLCOLORSCROLLBAR: 105 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 106 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 107 return GetSysColorBrush(COLOR_BTNFACE); 108 109 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 110 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 111 return 0; 112 113 default: 114 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 115 } 116 } 117 //****************************************************************************** 118 //****************************************************************************** 119 LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam) 120 { 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); 171 150 } 172 151 } … … 174 153 //NOTE: Unicode msg translation! 175 154 //****************************************************************************** 176 LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 177 { 178 #ifdef DEBUG 179 //// WriteLog("*DDPW*"); 180 #endif 181 switch(Msg) { 182 case WM_SETREDRAW: //Open32 does not set the visible flag 183 if(wParam) 184 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 185 else 186 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE); 187 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 188 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 189 return(TRUE); 190 case WM_CTLCOLORMSGBOX: 191 case WM_CTLCOLOREDIT: 192 case WM_CTLCOLORLISTBOX: 193 case WM_CTLCOLORBTN: 194 case WM_CTLCOLORDLG: 195 case WM_CTLCOLORSTATIC: 196 case WM_CTLCOLORSCROLLBAR: 197 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 198 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 199 return GetSysColorBrush(COLOR_BTNFACE); 200 201 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 202 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 203 return 0; 204 205 default: 206 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 207 } 208 } 209 //****************************************************************************** 210 //****************************************************************************** 211 LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam) 212 { 213 #ifdef DEBUG 214 //// WriteLog("*DFP*"); 155 LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam) 156 { 157 #ifdef DEBUG 158 //// WriteLog("*DFPW*"); 215 159 #endif 216 160 switch(Msg) { … … 243 187 } 244 188 //****************************************************************************** 189 //****************************************************************************** 190 LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 191 { 192 #ifdef DEBUG 193 //// WriteLog("*DMP*"); 194 #endif 195 switch(Msg) { 196 case WM_SETREDRAW: //Open32 does not set the visible flag 197 if(wParam) 198 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 199 else 200 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 //****************************************************************************** 245 224 //NOTE: Unicode msg translation! 246 225 //****************************************************************************** 247 LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)248 {249 #ifdef DEBUG250 //// WriteLog("*DFPW*");251 #endif252 switch(Msg) {253 case WM_SETREDRAW: //Open32 does not set the visible flag254 if(wParam)255 SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);256 else257 SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);258 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);259 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)260 return(TRUE);261 case WM_CTLCOLORMSGBOX:262 case WM_CTLCOLOREDIT:263 case WM_CTLCOLORLISTBOX:264 case WM_CTLCOLORBTN:265 case WM_CTLCOLORDLG:266 case WM_CTLCOLORSTATIC:267 case WM_CTLCOLORSCROLLBAR:268 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));269 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));270 return GetSysColorBrush(COLOR_BTNFACE);271 272 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!273 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));274 return 0;275 276 default:277 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);278 }279 }280 //******************************************************************************281 //******************************************************************************282 LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)283 {284 #ifdef DEBUG285 //// WriteLog("*DMP*");286 #endif287 switch(Msg) {288 case WM_SETREDRAW: //Open32 does not set the visible flag289 if(wParam)290 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);291 else292 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);293 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);294 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)295 return(TRUE);296 case WM_CTLCOLORMSGBOX:297 case WM_CTLCOLOREDIT:298 case WM_CTLCOLORLISTBOX:299 case WM_CTLCOLORBTN:300 case WM_CTLCOLORDLG:301 case WM_CTLCOLORSTATIC:302 case WM_CTLCOLORSCROLLBAR:303 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));304 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));305 return GetSysColorBrush(COLOR_BTNFACE);306 307 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!308 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));309 return 0;310 311 default:312 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);313 }314 }315 //******************************************************************************316 //NOTE: Unicode msg translation!317 //******************************************************************************318 226 LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 319 227 {
Note:
See TracChangeset
for help on using the changeset viewer.