Changeset 2033 for trunk/src/user32/win32class.cpp
- Timestamp:
- Dec 9, 1999, 1:54:05 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32class.cpp
r1606 r2033 1 /* $Id: win32class.cpp,v 1. 6 1999-11-05 09:16:22sandervl Exp $ */1 /* $Id: win32class.cpp,v 1.7 1999-12-09 00:53:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 23 23 #include <win32class.h> 24 24 #include <win32wnd.h> 25 #include <win\winproc.h> 25 26 26 27 static fDestroyAll = FALSE; … … 29 30 //Win32WndClass methods: 30 31 //****************************************************************************** 31 Win32WndClass::Win32WndClass(WNDCLASSEXA *wndclass, BOOL isUnicode) : GenericObject(&wndclasses, OBJTYPE_CLASS)32 { 33 this->isUnicode = isUnicode;32 Win32WndClass::Win32WndClass(WNDCLASSEXA *wndclass, BOOL fUnicode) : GenericObject(&wndclasses, OBJTYPE_CLASS) 33 { 34 isUnicode = fUnicode; 34 35 processId = 0; 35 36 … … 59 60 AsciiToUnicode(classNameA, classNameW); 60 61 } 61 62 62 classAtom = 0; 63 //SvL: If a system control has already be registered, use that atom instead 63 64 // of creating a new one 64 65 66 67 65 if(wndclass->style & CS_GLOBALCLASS) { 66 classAtom = GlobalFindAtomA(classNameA); 67 } 68 if(!classAtom) classAtom = GlobalAddAtomA(classNameA); 68 69 } 69 70 else { … … 73 74 } 74 75 if(!(wndclass->style & CS_GLOBALCLASS)) { 75 76 processId = GetCurrentProcess(); 76 77 } 77 78 menuNameA = 0; … … 105 106 106 107 windowStyle = wndclass->style; 107 windowProc = wndclass->lpfnWndProc;108 WINPROC_SetProc((HWINDOWPROC *)&windowProc, wndclass->lpfnWndProc, (isUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_CLASS); 108 109 109 110 //User data class words/longs … … 126 127 { 127 128 if(classNameA) { 128 129 dprintf(("Win32WndClass dtor, destroy class %s\n", classNameA)); 129 130 } 130 131 131 132 //SvL: Don't delete global classes 132 133 if(classNameA && !(windowStyle & CS_GLOBALCLASS)) { 133 GlobalDeleteAtom(classAtom); 134 } 134 GlobalDeleteAtom(classAtom); 135 } 136 137 WINPROC_FreeProc(windowProc, WIN_PROC_CLASS); 135 138 136 139 if(userClassLong) free(userClassLong); … … 158 161 } 159 162 if(fUnicode) { 160 161 162 163 if(classNameW) 164 return (lstrcmpW(classNameW, (LPWSTR)classname) == 0); 165 return FALSE; 163 166 } 164 167 else { 165 166 167 168 if(classNameA) 169 return (strcmp(classNameA, classname) == 0); 170 return FALSE; 168 171 } 169 172 } … … 234 237 { 235 238 if(windowStyle & CS_GLOBALCLASS) 236 239 return TRUE; 237 240 238 241 return curProcessId = processId; … … 251 254 wndclass->lpszClassName = (classNameA) ? (LPCTSTR)classNameA : (LPCTSTR)classAtom; 252 255 wndclass->style = windowStyle; 253 wndclass->lpfnWndProc = windowProc;256 wndclass->lpfnWndProc = (WNDPROC)getClassLongA(GCL_WNDPROC, FALSE); 254 257 wndclass->hIconSm = hIconSm; 255 258 return(TRUE); … … 268 271 wndclass->lpszClassName = (classNameW) ? (LPCWSTR)classNameW : (LPCWSTR)classAtom; 269 272 wndclass->style = windowStyle; 270 wndclass->lpfnWndProc = windowProc;273 wndclass->lpfnWndProc = (WNDPROC)getClassLongA(GCL_WNDPROC, TRUE); 271 274 wndclass->hIconSm = hIconSm; 272 275 return(TRUE); … … 335 338 //****************************************************************************** 336 339 //****************************************************************************** 337 ULONG Win32WndClass::getClassLongA(int index, BOOL isUnicode)340 ULONG Win32WndClass::getClassLongA(int index, BOOL fUnicode) 338 341 { 339 342 switch(index) { … … 355 358 return windowStyle; 356 359 case GCL_WNDPROC: 357 return (ULONG) windowProc;360 return (ULONG) WINPROC_GetProc(windowProc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A); 358 361 case GCW_ATOM: //TODO: does this really happen in windows? 359 362 SetLastError(ERROR_INVALID_PARAMETER); … … 385 388 //TODO: What effects what immediately? 386 389 //****************************************************************************** 387 ULONG Win32WndClass::setClassLongA(int index, LONG lNewVal, BOOL isUnicode)390 ULONG Win32WndClass::setClassLongA(int index, LONG lNewVal, BOOL fUnicode) 388 391 { 389 392 ULONG rc; … … 423 426 break; 424 427 case GCL_WNDPROC: 425 rc = ( ULONG)windowProc;426 windowProc = (WNDPROC)lNewVal;428 rc = (LONG)WINPROC_GetProc(windowProc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A ); 429 WINPROC_SetProc((HWINDOWPROC *)&windowProc, (WNDPROC)lNewVal, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_CLASS ); 427 430 break; 428 431 case GCW_ATOM: //TODO: does this really happen in windows?
Note:
See TracChangeset
for help on using the changeset viewer.