Changeset 1433 for trunk/src/user32/win32class.cpp
- Timestamp:
- Oct 25, 1999, 12:56:11 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32class.cpp
r1394 r1433 1 /* $Id: win32class.cpp,v 1. 2 1999-10-21 19:23:51sandervl Exp $ */1 /* $Id: win32class.cpp,v 1.3 1999-10-24 22:56:09 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 4 4 * 5 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl) 5 6 * 6 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl) 7 * 8 * TODO: Right now all class atoms are global. This must be changed. 9 * TODO: Global atoms of classes with CS_GLOBALCLASS flag are not deleted 10 * Must all be changed if we want to support global app classes 11 * that can be used by other apps. (low priority) 12 * 13 * Project Odin Software License can be found in LICENSE.TXT 7 14 * 8 15 */ … … 23 30 { 24 31 this->isUnicode = isUnicode; 32 processId = 0; 25 33 26 34 if(HIWORD(wndclass->lpszClassName)) { … … 49 57 AsciiToUnicode(classNameA, classNameW); 50 58 } 51 classAtom = GlobalAddAtomA(classNameA); 59 classAtom = 0; 60 //SvL: If a system control has already be registered, use that atom instead 61 // of creating a new one 62 if(wndclass->style & CS_GLOBALCLASS) { 63 classAtom = GlobalFindAtomA(classNameA); 64 } 65 if(!classAtom) classAtom = GlobalAddAtomA(classNameA); 52 66 } 53 67 else { … … 55 69 classNameW = NULL; 56 70 classAtom = (DWORD)wndclass->lpszClassName; 71 } 72 if(!(wndclass->style & CS_GLOBALCLASS)) { 73 processId = GetCurrentProcess(); 57 74 } 58 75 menuNameA = 0; … … 106 123 Win32WndClass::~Win32WndClass() 107 124 { 108 if (classNameA) GlobalDeleteAtom(classAtom); 125 if(classNameA && (windowStyle & CS_GLOBALCLASS)) { 126 GlobalDeleteAtom(classAtom); 127 } 128 109 129 if(userClassLong) free(userClassLong); 110 130 if(classNameA) free(classNameA); … … 174 194 wndclass = (Win32WndClass *)wndclass->GetNext(); 175 195 while(wndclass != NULL) { 176 if(wndclass->classAtom == (DWORD)id /* && wndclass->hInstance == hInstance*/) {196 if(wndclass->classAtom == (DWORD)id /* && wndclass->hInstance == hInstance*/) { 177 197 leaveMutex(OBJTYPE_CLASS); 178 198 return(wndclass); … … 185 205 dprintf(("Class %X (inst %X) not found!", id, hInstance)); 186 206 return(NULL); 207 } 208 //****************************************************************************** 209 //An app can only access another process' class if it's global 210 //(all system classes are global) 211 //NOTE: NOT USED NOW 212 //****************************************************************************** 213 BOOL Win32WndClass::isAppClass(ULONG curProcessId) 214 { 215 if(windowStyle & CS_GLOBALCLASS) 216 return TRUE; 217 218 return curProcessId = processId; 187 219 } 188 220 //****************************************************************************** … … 427 459 //****************************************************************************** 428 460 GenericObject *Win32WndClass::wndclasses = NULL; 429
Note:
See TracChangeset
for help on using the changeset viewer.