Ignore:
Timestamp:
Oct 25, 1999, 12:56:11 AM (26 years ago)
Author:
sandervl
Message:

class changes

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:51 sandervl Exp $ */
     1/* $Id: win32class.cpp,v 1.3 1999-10-24 22:56:09 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Managment Code for OS/2
    44 *
     5 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
    56 *
    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
    714 *
    815 */
     
    2330{
    2431  this->isUnicode = isUnicode;
     32  processId = 0;
    2533
    2634  if(HIWORD(wndclass->lpszClassName)) {
     
    4957                AsciiToUnicode(classNameA, classNameW);
    5058        }
    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);
    5266  }
    5367  else {
     
    5569        classNameW      = NULL;
    5670        classAtom       = (DWORD)wndclass->lpszClassName;
     71  }
     72  if(!(wndclass->style & CS_GLOBALCLASS)) {
     73        processId = GetCurrentProcess();
    5774  }
    5875  menuNameA = 0;
     
    106123Win32WndClass::~Win32WndClass()
    107124{
    108   if (classNameA) GlobalDeleteAtom(classAtom);
     125  if(classNameA && (windowStyle & CS_GLOBALCLASS)) {
     126        GlobalDeleteAtom(classAtom);
     127  }
     128
    109129  if(userClassLong)     free(userClassLong);
    110130  if(classNameA)        free(classNameA);
     
    174194                wndclass = (Win32WndClass *)wndclass->GetNext();
    175195                while(wndclass != NULL) {
    176                         if(wndclass->classAtom == (DWORD)id/* && wndclass->hInstance == hInstance*/) {
     196                        if(wndclass->classAtom == (DWORD)id /* && wndclass->hInstance == hInstance*/) {
    177197                                leaveMutex(OBJTYPE_CLASS);
    178198                                return(wndclass);
     
    185205  dprintf(("Class %X (inst %X) not found!", id, hInstance));
    186206  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//******************************************************************************
     213BOOL Win32WndClass::isAppClass(ULONG curProcessId)
     214{
     215  if(windowStyle & CS_GLOBALCLASS)
     216        return TRUE;
     217
     218  return curProcessId = processId;
    187219}
    188220//******************************************************************************
     
    427459//******************************************************************************
    428460GenericObject *Win32WndClass::wndclasses = NULL;
    429 
Note: See TracChangeset for help on using the changeset viewer.