| Previous | Next |
| ERROR_HOTKEY_ALREADY_REGISTERED | ERROR_CLASS_DOES_NOT_EXIST |
ERROR_CLASS_ALREADY_EXISTS
The window class is already registered
Window-class registration installs a template containing the window procedure, class styles, extra bytes, icons, cursor, background brush, menu name, and module instance information. Registering twice is not the same as creating two windows from one class.
This status commonly reveals duplicate initialization or two modules choosing the same class name. Before treating the existing registration as harmless, compare the intended class contract: especially the window procedure and the module instance that owns the registration.
What to check
- Make class registration idempotent at one well-defined process/module initialization point.
- Use a stable, application-specific class name rather than a generic name likely to collide.
- If adopting an existing class, query its attributes and verify they match the expected procedure and instance.
- Pair DLL registration with explicit unregistration when appropriate.
Creating more windows from an existing class is normal. The error concerns a duplicate class-registration attempt, not duplicate window instances.
References
Looking for a different code? Search another status or error code.