- Timestamp:
- Jun 20, 1999, 6:47:39 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/defwndproc.cpp
r37 r134 1 /* $Id: defwndproc.cpp,v 1. 2 1999-06-06 12:25:49 cbratschiExp $ */1 /* $Id: defwndproc.cpp,v 1.3 1999-06-20 16:47:39 sandervl Exp $ */ 2 2 3 3 /* … … 44 44 return GetSysColorBrush(COLOR_BTNFACE); 45 45 46 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 47 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 48 return 0; 46 49 default: 47 50 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); … … 79 82 return GetSysColorBrush(COLOR_BTNFACE); 80 83 84 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 85 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 86 return 0; 87 81 88 default: 82 89 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); … … 113 120 return GetSysColorBrush(COLOR_BTNFACE); 114 121 122 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 123 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 124 return 0; 125 115 126 default: 116 127 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); … … 147 158 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 148 159 return GetSysColorBrush(COLOR_BTNFACE); 160 161 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 162 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 163 return 0; 149 164 150 165 default: … … 190 205 return GetSysColorBrush(COLOR_BTNFACE); 191 206 207 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 208 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame)); 209 return 0; 210 192 211 default: 193 212 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam); … … 233 252 return GetSysColorBrush(COLOR_BTNFACE); 234 253 254 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 255 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame)); 256 return 0; 257 235 258 default: 236 259 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam); … … 267 290 return GetSysColorBrush(COLOR_BTNFACE); 268 291 292 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 293 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 294 return 0; 295 269 296 default: 270 297 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); … … 302 329 return GetSysColorBrush(COLOR_BTNFACE); 303 330 331 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 332 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 333 return 0; 334 304 335 default: 305 336 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); -
trunk/src/user32/initterm.cpp
r120 r134 1 /* $Id: initterm.cpp,v 1. 3 1999-06-19 10:54:47sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.4 1999-06-20 16:47:39 sandervl Exp $ */ 2 2 3 3 /* … … 124 124 { 125 125 dprintf(("user32 exit\n")); 126 UnregisterSystemClasses(); 126 127 _ctordtorTerm(); 127 128 CRT_term(); -
trunk/src/user32/user32.cpp
r131 r134 1 /* $Id: user32.cpp,v 1. 8 1999-06-20 14:02:13sandervl Exp $ */1 /* $Id: user32.cpp,v 1.9 1999-06-20 16:47:39 sandervl Exp $ */ 2 2 3 3 /* … … 625 625 } 626 626 if(window) { 627 window->SetWindowHandle(hwnd); 628 } 629 //SvL: Taken from Wine 630 if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) ) 631 { 632 /* Notify the parent window only */ 633 SendMessageA(parent, WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, 0), (LPARAM)hwnd ); 627 window->SetWindowHandle(hwnd); 634 628 } 635 629 … … 955 949 LONG rc; 956 950 957 #ifdef DEBUG958 WriteLog("USER32: GetWindowLong %X %d\n", hwnd, nIndex);959 #endif960 951 if(nIndex == GWL_WNDPROC || nIndex == DWL_DLGPROC) { 961 Win32WindowProc *window = Win32WindowProc::FindProc(hwnd); 962 if(window && !(nIndex == DWL_DLGPROC && window->IsWindow() == TRUE)) { 963 return (LONG)window->GetWin32Callback(); 964 } 952 #ifdef DEBUG 953 WriteLog("USER32: GetWindowLong %X %d\n", hwnd, nIndex); 954 #endif 955 Win32WindowProc *window = Win32WindowProc::FindProc(hwnd); 956 if(window && !(nIndex == DWL_DLGPROC && window->IsWindow() == TRUE)) { 957 return (LONG)window->GetWin32Callback(); 958 } 965 959 } 966 960 rc = O32_GetWindowLong(hwnd, nIndex); 967 #ifdef DEBUG968 WriteLog("USER32: GetWindowLong returned %X\n", rc);969 #endif970 961 return(rc); 971 962 } … … 2639 2630 BOOL WIN32API PtInRect( const RECT * arg1, POINT arg2) 2640 2631 { 2641 #ifdef DEBUG 2632 #ifdef DEBUG1 2642 2633 WriteLog("USER32: PtInRect\n"); 2643 2634 #endif -
trunk/src/user32/wndclass.cpp
r131 r134 1 /* $Id: wndclass.cpp,v 1. 4 1999-06-20 14:02:13sandervl Exp $ */1 /* $Id: wndclass.cpp,v 1.5 1999-06-20 16:47:38 sandervl Exp $ */ 2 2 3 3 /* … … 43 43 WNDPROC_O32 ScrollbarHandler = 0; 44 44 WNDPROC_O32 StaticHandler = 0; 45 46 HWND hwndButton = 0; 47 HWND hwndListbox = 0; 48 HWND hwndEdit = 0; 49 HWND hwndCombobox = 0; 50 HWND hwndScrollbar = 0; 51 HWND hwndMdiClient = 0; 52 HWND hwndStatic = 0; 53 54 Win32WindowClass *ButtonClass = 0; 55 Win32WindowClass *ListboxClass = 0; 56 Win32WindowClass *EditClass = 0; 57 Win32WindowClass *ComboboxClass = 0; 58 Win32WindowClass *MdiClientClass = 0; 59 Win32WindowClass *ScrollbarClass = 0; 60 Win32WindowClass *StaticClass = 0; 45 61 //****************************************************************************** 46 62 //****************************************************************************** 47 63 LRESULT WIN32API ButtonCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 48 64 { 65 switch(Msg) 66 { 67 case WM_CREATE: 68 case WM_DESTROY: 69 case WM_LBUTTONDOWN: 70 case WM_MBUTTONDOWN: 71 case WM_RBUTTONDOWN: 72 NotifyParent(hwnd, Msg, wParam, lParam); 73 break; 74 } 49 75 return ButtonHandler(hwnd, Msg, wParam, lParam); 50 76 } … … 91 117 { 92 118 WNDCLASSA wndclass; 119 HWND hwnd; 93 120 94 121 if(O32_GetClassInfo(NULL, "BUTTON", &wndclass)) { 95 new Win32WindowClass(ButtonCallback, "BUTTON", hModule); 122 dprintf(("Create BUTTON System class")); 123 ButtonClass = new Win32WindowClass(ButtonCallback, "BUTTON", hModule); 96 124 ButtonHandler = (WNDPROC_O32)wndclass.lpfnWndProc; 125 hwndButton = O32_CreateWindow("BUTTON", "BUTTON", 0, 0, 0, 0, 0, 0, 0, 0, 0); 126 if(hwndButton == 0) { 127 dprintf(("RegisterSystemClasses failed!!")); 128 } 129 O32_SetClassLong(hwndButton, GCL_WNDPROC, (LONG)ButtonCallback); 97 130 } 98 131 if(O32_GetClassInfo(NULL, "LISTBOX", &wndclass)) { 99 new Win32WindowClass(ListboxCallback, "LISTBOX", hModule); 132 dprintf(("Create LISTBOX System class")); 133 ListboxClass = new Win32WindowClass(ListboxCallback, "LISTBOX", hModule); 100 134 ListboxHandler = (WNDPROC_O32)wndclass.lpfnWndProc; 135 hwndListbox = O32_CreateWindow("LISTBOX", "LISTBOX", 0, 0, 0, 0, 0, 0, 0, 0, 0); 136 if(hwndListbox == 0) { 137 dprintf(("RegisterSystemClasses failed!!")); 138 } 139 O32_SetClassLong(hwndListbox, GCL_WNDPROC, (LONG)ListboxCallback); 101 140 } 102 141 if(O32_GetClassInfo(NULL, "COMBOBOX", &wndclass)) { 103 new Win32WindowClass(ComboboxCallback, "COMBOBOX", hModule); 142 dprintf(("Create COMBOBOX System class")); 143 ComboboxClass = new Win32WindowClass(ComboboxCallback, "COMBOBOX", hModule); 104 144 ComboboxHandler = (WNDPROC_O32)wndclass.lpfnWndProc; 145 hwndCombobox = O32_CreateWindow("COMBOBOX", "COMBOBOX", 0, 0, 0, 0, 0, 0, 0, 0, 0); 146 if(hwndCombobox == 0) { 147 dprintf(("RegisterSystemClasses failed!!")); 148 } 149 O32_SetClassLong(hwndCombobox, GCL_WNDPROC, (LONG)ComboboxCallback); 105 150 } 106 151 if(O32_GetClassInfo(NULL, "EDIT", &wndclass)) { 107 new Win32WindowClass(EditCallback, "EDIT", hModule); 152 dprintf(("Create EDIT System class")); 153 EditClass = new Win32WindowClass(EditCallback, "EDIT", hModule); 108 154 EditHandler = (WNDPROC_O32)wndclass.lpfnWndProc; 155 hwndEdit = O32_CreateWindow("EDIT", "EDIT", 0, 0, 0, 0, 0, 0, 0, 0, 0); 156 if(hwndEdit == 0) { 157 dprintf(("RegisterSystemClasses failed!!")); 158 } 159 O32_SetClassLong(hwndEdit, GCL_WNDPROC, (LONG)EditCallback); 109 160 } 161 //TODO: This doens't work yet!! (need to create a normal window as parent) 110 162 if(O32_GetClassInfo(NULL, "MDICLIENT", &wndclass)) { 111 new Win32WindowClass(MdiClientCallback, "MDICLIENT", hModule); 163 dprintf(("Create MDICLIENT System class")); 164 MdiClientClass = new Win32WindowClass(MdiClientCallback, "MDICLIENT", hModule); 112 165 MdiClientHandler = (WNDPROC_O32)wndclass.lpfnWndProc; 166 hwndMdiClient = O32_CreateWindow("MDICLIENT", "MDICLIENT", WS_CHILD, 0, 0, 0, 0, hwndListbox, 0, 0, 0); 167 if(hwndMdiClient == 0) { 168 dprintf(("RegisterSystemClasses failed!!")); 169 } 170 O32_SetClassLong(hwndMdiClient, GCL_WNDPROC, (LONG)MdiClientCallback); 113 171 } 114 172 if(O32_GetClassInfo(NULL, "SCROLLBAR", &wndclass)) { 115 new Win32WindowClass(ScrollbarCallback, "SCROLLBAR", hModule); 173 dprintf(("Create SCROLLBAR System class")); 174 ScrollbarClass = new Win32WindowClass(ScrollbarCallback, "SCROLLBAR", hModule); 116 175 ScrollbarHandler = (WNDPROC_O32)wndclass.lpfnWndProc; 176 hwndScrollbar = O32_CreateWindow("SCROLLBAR", "SCROLLBAR", 0, 0, 0, 0, 0, 0, 0, 0, 0); 177 if(hwndScrollbar == 0) { 178 dprintf(("RegisterSystemClasses failed!!")); 179 } 180 O32_SetClassLong(hwndScrollbar, GCL_WNDPROC, (LONG)ScrollbarCallback); 117 181 } 118 182 if(O32_GetClassInfo(NULL, "STATIC", &wndclass)) { 119 new Win32WindowClass(StaticCallback, "STATIC", hModule); 183 dprintf(("Create STATIC System class")); 184 StaticClass = new Win32WindowClass(StaticCallback, "STATIC", hModule); 120 185 StaticHandler = (WNDPROC_O32)wndclass.lpfnWndProc; 186 hwndStatic = O32_CreateWindow("STATIC", "STATIC", 0, 0, 0, 0, 0, 0, 0, 0, 0); 187 if(hwndStatic == 0) { 188 dprintf(("RegisterSystemClasses failed!!")); 189 } 190 O32_SetClassLong(hwndStatic, GCL_WNDPROC, (LONG)StaticCallback); 121 191 } 122 192 //TODO: More standard classes in win95/NT4? 193 } 194 //****************************************************************************** 195 //****************************************************************************** 196 void UnregisterSystemClasses() 197 { 198 dprintf(("KERNEL32: UnregisterSystemClasses")); 199 if(hwndButton) O32_DestroyWindow(hwndButton); 200 if(hwndListbox) O32_DestroyWindow(hwndListbox); 201 if(hwndCombobox) O32_DestroyWindow(hwndCombobox); 202 if(hwndMdiClient) O32_DestroyWindow(hwndMdiClient); 203 if(hwndEdit) O32_DestroyWindow(hwndEdit); 204 if(hwndScrollbar) O32_DestroyWindow(hwndScrollbar); 205 if(hwndStatic) O32_DestroyWindow(hwndStatic); 206 if(ButtonClass) delete ButtonClass; 207 if(ListboxClass) delete ListboxClass; 208 if(EditClass) delete EditClass; 209 if(ComboboxClass) delete ComboboxClass; 210 if(MdiClientClass) delete MdiClientClass; 211 if(ScrollbarClass) delete ScrollbarClass; 212 if(StaticClass) delete StaticClass; 213 ButtonClass = NULL; 214 EditClass = NULL; 215 ListboxClass = NULL; 216 ComboboxClass = NULL; 217 MdiClientClass = NULL; 218 ScrollbarClass = NULL; 219 StaticClass = NULL; 123 220 } 124 221 //****************************************************************************** … … 218 315 //These are not supported by Open32 219 316 wc.style &= ~(CS_PARENTDC | CS_CLASSDC); 220 221 //SvL: 18-7-'98 Breaks apps (solitaire, rasmol..) 222 #if 0 223 /* @@@PH 98/06/21 experimental fix for WInhlp32 */ 224 #ifndef CS_SYNCPAINT 225 #define CS_SYNCPAINT 0x02000000L 226 #endif 227 228 wc.style |= CS_SYNCPAINT; 229 #endif 230 317 231 318 wc.lpfnWndProc = (WNDPROC)Win32WindowClass::GetOS2ClassCallback(); 232 319 … … 708 795 char szClass[128]; 709 796 Win32WindowClass *wclass; 797 LRESULT rc; 798 DWORD dwStyle, dwExStyle; 799 HWND parentHwnd; 800 Win32WindowProc *window; 710 801 711 802 #ifdef DEBUG … … 720 811 wclass = Win32WindowClass::FindClass(szClass); 721 812 if(wclass) { 722 //SvL: Correct Open32 key mapping bug 723 if(Msg == WM_KEYDOWN || Msg == WM_KEYUP || Msg == WM_CHAR) { 724 // dprintf(("WM_KEYDOWN %X %08X\n", wParam, lParam)); 725 lParam = MapOEMToRealKey(wParam, lParam); 726 } 727 728 if(Msg == WM_CREATE) {//Open32 isn't sending WM_NCCREATE messages!! 813 switch(Msg) 814 { 815 case WM_CREATE://Open32 isn't sending WM_NCCREATE messages!! 816 window = Win32WindowProc::FindProc(hwnd, GetCurrentThreadId()); 817 if(window) { 818 dprintf(("OS2ToWinCallback (class): New window object!")); 819 window->SetWindowHandle(hwnd); 820 } 821 729 822 if(wclass->GetWinCallback()(hwnd, WM_NCCREATE, 0, lParam) == 0) { 730 823 dprintf(("WM_NCCREATE returned FALSE\n")); 731 824 return(-1); //don't create window 732 825 } 733 } 734 if(Msg == WM_ACTIVATE && LOWORD(wParam) != WA_INACTIVE) 735 {//SvL: Bugfix, Open32 is NOT sending this to the window (messes up Solitaire) 736 HDC hdc = GetDC(hwnd); 737 738 wclass->GetWinCallback()(hwnd, WM_ERASEBKGND, hdc, 0); 739 ReleaseDC(hwnd, hdc); 740 } 826 //Send WM_CREATE message before notifying parent 827 rc = wclass->GetWinCallback()(hwnd, Msg, wParam, lParam); 828 829 NotifyParent(hwnd, WM_CREATE, wParam, lParam); 830 return(rc); 831 832 case WM_DESTROY: //nofity parent 833 case WM_LBUTTONDOWN: 834 case WM_MBUTTONDOWN: 835 case WM_RBUTTONDOWN: 836 NotifyParent(hwnd, Msg, wParam, lParam); 837 break; 838 839 case WM_KEYDOWN: 840 case WM_KEYUP: 841 case WM_CHAR: //SvL: Correct Open32 key mapping bug 842 lParam = MapOEMToRealKey(wParam, lParam); 843 break; 844 case WM_ACTIVATE: 845 if(LOWORD(wParam) != WA_INACTIVE) 846 {//SvL: Bugfix, Open32 is NOT sending this to the window (messes up Solitaire) 847 HDC hdc = GetDC(hwnd); 848 849 wclass->GetWinCallback()(hwnd, WM_ERASEBKGND, hdc, 0); 850 ReleaseDC(hwnd, hdc); 851 } 852 break; 853 } 741 854 return wclass->GetWinCallback()(hwnd, Msg, wParam, lParam); 742 855 } -
trunk/src/user32/wndproc.cpp
r131 r134 1 /* $Id: wndproc.cpp,v 1. 5 1999-06-20 14:02:13sandervl Exp $ */1 /* $Id: wndproc.cpp,v 1.6 1999-06-20 16:47:39 sandervl Exp $ */ 2 2 3 3 /* … … 28 28 #endif 29 29 30 31 void NotifyParent(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 32 { 33 DWORD dwStyle, dwExStyle; 34 HWND hwndParent = GetParent(hwnd);; 35 36 while(hwndParent) { 37 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 38 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 39 //SvL: Taken from Wine 40 if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) ) 41 { 42 hwndParent = GetParent(hwnd); 43 dprintf(("%s Send WM_PARENTNOTIFY from child %x to parent %x", GetMsgText(Msg), hwnd, hwndParent)); 44 /* Notify the parent window only */ 45 Win32WindowProc *parentwnd = Win32WindowProc::FindProc(hwndParent); 46 if(parentwnd) { 47 if(Msg == WM_CREATE || Msg == WM_DESTROY) { 48 //Todo: Set IdChild!! 49 parentwnd->GetWin32Callback()(hwndParent, WM_PARENTNOTIFY, MAKEWPARAM(Msg, 0), (LPARAM)hwnd ); 50 } 51 else parentwnd->GetWin32Callback()(hwndParent, WM_PARENTNOTIFY, MAKEWPARAM(Msg, 0), lParam ); 52 } 53 } 54 if(hwnd == hwndParent) { 55 break; 56 } 57 hwnd = hwndParent; 58 } 59 } 30 60 //****************************************************************************** 31 61 //****************************************************************************** … … 67 97 { 68 98 WNDCLASSA wc; 69 70 assert(GetClassInfoA(hinst, lpszClassName, &wc) == TRUE); 99 BOOL rc; 100 101 rc = GetClassInfoA(hinst, lpszClassName, &wc); 102 assert(rc == TRUE); 103 71 104 // pCallback = Win32WindowClass::GetClassCallback(hinst, (LPSTR)wc.lpszClassName); 72 105 pCallback = Win32WindowClass::GetClassCallback((LPSTR)wc.lpszClassName); … … 152 185 } 153 186 dprintf(("Win32WindowProc::FindProc, can't find window %X!\n", hwnd)); 187 return(NULL); 188 } 189 //****************************************************************************** 190 //Find newly created window 191 //****************************************************************************** 192 Win32WindowProc *Win32WindowProc::FindProc(HWND hwnd, DWORD threadid) 193 { 194 Win32WindowProc *window = Win32WindowProc::windows; 195 196 while(window != NULL) { 197 if(window->hwnd == 0 && window->threadid == threadid) { 198 return(window); 199 } 200 window = window->next; 201 } 202 dprintf(("Win32WindowProc::FindProc, can't find window %X %d!\n", hwnd, threadid)); 154 203 return(NULL); 155 204 } … … 225 274 LRESULT EXPENTRY_O32 WndCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 226 275 { 227 Win32WindowProc *curwnd = Win32WindowProc::windows;276 Win32WindowProc *curwnd; 228 277 LRESULT rc; 229 278 … … 231 280 return(0); 232 281 } 233 while(curwnd != NULL) { 234 if(curwnd->hwnd == hwnd) { 235 //SvL: Correct Open32 key mapping bug 236 if(Msg == WM_KEYDOWN || Msg == WM_KEYUP || Msg == WM_CHAR) { 237 // dprintf(("WM_KEYDOWN %X %08X\n", wParam, lParam)); 238 lParam = MapOEMToRealKey(wParam, lParam); 282 283 curwnd = Win32WindowProc::FindProc(hwnd); 284 if(!curwnd) { 285 curwnd = Win32WindowProc::FindProc(0, GetCurrentThreadId()); 286 if(curwnd) curwnd->SetWindowHandle(hwnd); 287 } 288 if(curwnd != NULL) { 289 #ifdef DEBUG 290 WriteLog("***************Message %s for window/dialog %X\n", GetMsgText(Msg), hwnd); 291 #endif 292 switch(Msg) 293 { 294 case WM_KEYDOWN: 295 case WM_KEYUP: 296 case WM_CHAR: 297 //SvL: Correct Open32 key mapping bug 298 lParam = MapOEMToRealKey(wParam, lParam); 299 break; 300 case WM_CREATE: //Open32 isn't sending WM_NCCREATE messages!! 301 if(curwnd->pCallback(hwnd, WM_NCCREATE, 0, lParam) == 0) { 302 dprintf(("WM_NCCREATE returned FALSE\n")); 303 return(-1); //don't create window 239 304 } 240 #ifdef DEBUG 241 WriteLog("***************Message %s for window/dialog %X\n", GetMsgText(Msg), hwnd); 242 #endif 243 // if(Msg == WM_CREATE || Msg == WM_INITDIALOG) {//Open32 isn't sending WM_NCCREATE messages!! 244 if(Msg == WM_CREATE) {//Open32 isn't sending WM_NCCREATE messages!! 245 #ifdef DEBUG1 246 WriteLog("WM_NCCREATE\n"); 247 #endif 248 if(curwnd->pCallback(hwnd, WM_NCCREATE, 0, lParam) == 0) { 249 dprintf(("WM_NCCREATE returned FALSE\n")); 250 return(-1); //don't create window 251 } 305 306 NotifyParent(hwnd, WM_CREATE, wParam, lParam); 252 307 //TODO 253 308 #if 0 254 if(curwnd->pCallback(hwnd, WM_NCCALCSIZE, 0, lParam) == 0) { 255 #ifdef DEBUG1 256 WriteLog("WM_NCCREATE returned FALSE\n"); 257 #endif 258 return(-1); //don't create window 259 } 260 #endif 261 #ifdef DEBUG1 262 WriteLog("WM_NCCREATE, continue window creation\n"); 263 #endif 264 } 265 #if 1 266 if(Msg == WM_ACTIVATE && LOWORD(wParam) != WA_INACTIVE) 267 {//SvL: Bugfix, Open32 is NOT sending this to the window (messes up Solitaire) 268 HDC hdc = GetDC(hwnd); 269 270 curwnd->pCallback(hwnd, WM_ERASEBKGND, hdc, 0); 271 ReleaseDC(hwnd, hdc); 309 if(curwnd->pCallback(hwnd, WM_NCCALCSIZE, 0, lParam) == 0) { 310 return(-1); //don't create window 272 311 } 273 312 #endif 274 rc = curwnd->pCallback(hwnd, Msg, wParam, lParam); 275 #ifdef DEBUG1 276 WriteLog("***************Message processed rc = %d\n", rc); 277 #endif 278 if(Msg == WM_NCDESTROY) { 279 dprintf(("WM_NCDESTROY received for window/dialog %X\n", curwnd->hwnd)); 280 Win32WindowSubProc::DeleteSubWindow(hwnd); //if present 281 delete curwnd; 282 } 283 return rc; 313 break; 314 315 case WM_LBUTTONDOWN: 316 case WM_MBUTTONDOWN: 317 case WM_RBUTTONDOWN: 318 case WM_DESTROY: //nofity parent 319 NotifyParent(hwnd, Msg, wParam, lParam); 320 break; 321 322 case WM_ACTIVATE: 323 if(LOWORD(wParam) != WA_INACTIVE) 324 {//SvL: Bugfix, Open32 is NOT sending this to the window (messes up Solitaire) 325 HDC hdc = GetDC(hwnd); 326 327 curwnd->pCallback(hwnd, WM_ERASEBKGND, hdc, 0); 328 ReleaseDC(hwnd, hdc); 329 } 330 break; 331 } 332 rc = curwnd->pCallback(hwnd, Msg, wParam, lParam); 333 if(Msg == WM_NCDESTROY) { 334 dprintf(("WM_NCDESTROY received for window/dialog %X\n", curwnd->hwnd)); 335 Win32WindowSubProc::DeleteSubWindow(hwnd); //if present 336 delete curwnd; 284 337 } 285 curwnd = curwnd->next; 286 } 287 //Message for window/dialog that's just been created 288 //TODO: This should be thread safe, right? 289 DWORD threadid = (DWORD)GetCurrentThreadId(); 290 curwnd = (Win32WindowProc *)Win32WindowProc::windows; 291 while(curwnd != NULL) { 292 if(curwnd->hwnd == 0 && curwnd->threadid == threadid) { 293 #ifdef DEBUG1 294 WriteLog("***************First message %s for window/dialog %X\n", GetMsgText(Msg), hwnd); 295 #endif 296 curwnd->SetWindowHandle(hwnd); 297 // if(Msg == WM_CREATE || Msg == WM_INITDIALOG) {//Open32 isn't sending WM_NCCREATE messages!! 298 if(Msg == WM_CREATE) {//Open32 isn't sending WM_NCCREATE messages!! 299 #ifdef DEBUG1 300 WriteLog("WM_NCCREATE\n"); 301 #endif 302 if(curwnd->pCallback(hwnd, WM_NCCREATE, 0, lParam) == 0) { 303 dprintf(("WM_NCCREATE returned FALSE\n")); 304 return(-1); //don't create window 305 } 306 #ifdef DEBUG1 307 WriteLog("WM_NCCREATE, continue window creation\n"); 308 #endif 309 } 310 rc = curwnd->pCallback(hwnd, Msg, wParam, lParam); 311 if(Msg == WM_NCDESTROY) { 312 dprintf(("WM_NCDESTROY received for window/dialog %X\n", curwnd->hwnd)); 313 Win32WindowSubProc::DeleteSubWindow(hwnd); //if present 314 delete curwnd; 315 } 316 return rc; 317 } 318 curwnd = curwnd->next; 319 } 320 #ifdef DEBUG1 321 WriteLog("Dialog control??\n"); 322 #endif 338 return rc; 339 } 340 323 341 //Could be a dialog control using a registered class, so check this: 324 342 char szClass[128];
Note:
See TracChangeset
for help on using the changeset viewer.