| Previous | Next |
| DWMERR_CATASTROPHIC_FAILURE | DCOMPOSITION_ERROR_SURFACE_BEING_RENDERED |
DCOMPOSITION_ERROR_WINDOW_ALREADY_COMPOSED
What Windows rejected: window already composed
The useful interpretation of DCOMPOSITION_ERROR_WINDOW_ALREADY_COMPOSED (0x88980800) starts at the dcomp boundary: the application attempted to create a second composition target for a window already associated with one. In practical terms, inspect DirectComposition target ownership for an HWND before changing application-wide graphics settings.
DirectComposition batches changes until Commit, while surface drawing has its own BeginDraw/EndDraw lifetime. Treat those two transactions separately in traces and cleanup.
Build a useful diagnostic record
| Capture item | Why it matters |
|---|---|
| What to capture | HWND, process and thread IDs, existing IDCompositionTarget lifetime, topmost flag and target creation stack |
| Current graph state | DirectComposition device, target, visual tree and surface update transaction |
| Supporting trace | BeginDraw/EndDraw or target-creation sequence, Commit result, HWND ownership and CheckDeviceState output |
| Object identity | DirectComposition target ownership for an HWND |
| Rejected condition | the application attempted to create a second composition target for a window already associated with one |
Separate state from capability
- Capture the failing state. Record HWND, process and thread IDs, existing IDCompositionTarget lifetime, topmost flag and target creation stack.
- Create one target successfully and issue a second CreateTargetForHwnd for the same window.
The comparison with DCOMPOSITION_ERROR_ACCESS_DENIED is especially useful: DCOMPOSITION_ERROR_ACCESS_DENIED is returned when the window belongs to another process.
Verify the repaired path
Keep one target owner per window and release or reuse it during visual-tree replacement.
- debug-layer, ETW or driver diagnostics no longer report the rejected DirectComposition target ownership for an HWND contract during the same scenario.
Implementation notes
Log BeginDraw/EndDraw or target-creation sequence, Commit result, HWND ownership and CheckDeviceState output.
Technical references
- Microsoft: DirectComposition error codes — background for the DirectComposition target ownership for an HWND.
- Microsoft: DirectComposition reference
- Microsoft: IDCompositionDevice::Commit
- Microsoft: IDCompositionDevice::CheckDeviceState
Looking for a different code? Search another status or error code.