Scope of Window ClassesLast reviewed: July 22, 1997Article ID: Q28353 |
3.00 3.10
WINDOWS
kbprgt
The information in this article applies to:
SUMMARYThis article discusses the scope of window classes created by the RegisterClass function and used by the CreateWindow function.
MORE INFORMATIONWhen an application calls the RegisterClass function, Windows determines if that application has already registered a class with the same name. If it has, registration fails because a module can register only one class under a given name. When an application calls the CreateWindow function to create a window of a specified class, Windows looks in the list of registered classes for a class with the specified class name registered by the calling module. If the class is not found, Windows looks in the classes list for the specified class name registered by any module. If the class name is not found, the call to CreateWindow fails. This implies that a module can create a window using any other module's class if and only if it has not registered a class with the same name. If a module registers a class with the same name as another module's class, the module can use only its own version. However, consider the following situation regarding the MyClass window class:
An application can reference a class defined by a dynamic-link library (DLL). Under versions of Windows earlier than 3.1, an application should not reference window classes registered by other applications. This restriction is caused by the expanded memory manager (EMM) provided by Windows real mode. Under certain conditions, the window procedure in the module that registers a class is not available while the application that created the window is running.
|
Additional reference words: 3.00 3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |