[release/8.0] Fix WM_DESTROY message handling in ActiveX control #12658
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BackPort PR #12564 And #12648 To 8.0
Fixes #12551
Customer Impact
Parent container control is not sending WM_DESTROY message to the child control while disposing the ActiveX child controls. ActixeX child expects a WM_DESTORY message, but the message handler is never called.
Regression
Yes. Due to Move from IntPtr to nint to avoid runtime casting errors. (#5791) · dotnet/winforms@834d0a0, We accidentally removed caching of a window handle before destroying it, once the handle was destroyed, we were not able to forward message to its winproc.
Testing
Manual testing with the user-provided project
Risk
Low - The change reverts logic to .NET7 state, no workaround is possible