| Previous | Next |
| ERROR_CURRENT_DOMAIN_NOT_ALLOWED | ERROR_INVALID_MENU_HANDLE |
ERROR_INVALID_WINDOW_HANDLE
The HWND does not identify a live window
An HWND is an opaque window-manager handle. This status is about the identity and lifetime of that GUI object, not about the window title, class name, or whether the window is currently visible.
Window handles can become stale after destruction, and code that caches a handle across asynchronous work can race the thread that owns the window. A numeric value that once represented a window is not a persistent object ID. Cross-process discovery also needs a fresh handle from an API such as window enumeration or lookup rather than a serialized old value.
What to check
- Record the API that produced the
HWNDand the API that rejected it. - Check whether the owner thread destroyed or recreated the window before the failing call.
- Treat a reused handle value as opaque; do not infer object identity from the number.
- If the target is external, reacquire the handle immediately before the operation and account for the target process exiting.
This differs from ERROR_WINDOW_OF_OTHER_THREAD: the latter can describe a valid window whose thread ownership makes the requested operation invalid.
References
Looking for a different code? Search another status or error code.