-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Scaling ErrorProvider for high dpi #8486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Adding following windows message handling in the NativeWinodow to support components that are not derived from Control. - WM.DPICHANGED_BEFOREPARENT - WM.DPICHANGED_AFTERPARENT - Replacing Windows Error Icon with Winforms specific and remove dependancy on Windows.
Test failure because you need to Update |
Thank you. It was not supposed to be removed. I was experimenting and forgot to add it back. |
Good to see unit test at work! |
src/System.Windows.Forms/src/System/Windows/Forms/ErrorProvider.ErrorWindow.cs
Show resolved
Hide resolved
{ | ||
case User32.WM.DPICHANGED_BEFOREPARENT: | ||
WmDpiChangedBeforeParent(ref m); | ||
m.ResultInternal = (LRESULT)0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Result is ignored by the system, I would delete all instances of us setting it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The m.ResultInternal
is automatically set to (LRESULT)0
when the message is created, so there is no need for explicit setting. However, we have used this pattern in other places where we override or define WndProc
.
Will have to revisit WndProc
overrides in this code base to clean it up. Would consider a separate PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
We regressed this issue here: #8486 by accidentally disposing Icons that may not be owned or created by us. In this scenario, It was default Icon that is getting disposed.
This change involves adding high DPI message handling to the
NativeWindow
class in order to support high DPI for components that are not derived fromControl
. As a result, theErrorProvider
,Timer
,NotifyIcon
, andToolTip
components will benefit from this change.Changes:
WM.DPICHANGED_BEFOREPARENT
andWM.DPICHANGED_AFTERPARENT
messages inNativeWindow
ErrorProvider
.Fixes #8264
Microsoft Reviewers: Open in CodeFlow