NativeWindow AssignHandle/ReleaseHandle should use Set/RemoveWindowSubclass
Open
enhancement
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 20h 23m
- Merged PRs (30d)
- 103
Description
`NativeWindow AssignHandle/ReleaseHandle` use `SetWindowLongPtr` to subclass windows. This is particularly problematic if multiple independent components subclass the same window, as described here:
https://blogs.msdn.microsoft.com/anandgeorge/2010/04/10/usage-of-nativewindow-assignhandlereleasehandle-when-unmanaged-code-is-involved/
Our Office add-in coexists with other .NET add-ins and frequently runs into this problem. To solve it, `NativeWindow` should use the `COMCTL32` `SetWindowSubclass`/`RemoveWindowSubclass` API.
Contributor guide
Assessment
This issue has not been assessed yet.