-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Convert the rest of System.Drawing printing to CsWin32 #10598
Conversation
This moves the rest of System.Drawing.Printing to CsWin32. - Move now-shared API to Core assembly - Update calls to PInvokeCore for said calls - Add HdcHandle for HDCs that we have to keep in fields - Move printing DeviceContext usages to scopes - Use new printer dialog to get default printer names - Remove ScreenDC and use scope
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.
Maybe you can also remove LogicalDpi
from DpiHelper.cs
and OneHundredPercentLogicalDpi
from ScaleHelper.cs
and make use of PInvoke.USER_DEFAULT_SCREEN_DPI
instead?
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.
Thanks for pointing that out. I'll look at adding it.
// Here, we'll check to see if we are in a terminal services session... | ||
(((User32.GetSystemMetrics(NativeMethods.SM_REMOTESESSION) & 0x00000001) != 0) && (error == 0))) | ||
// Here, we'll check to see if we are in a terminal services session. | ||
(((PInvokeCore.GetSystemMetrics(SYSTEM_METRICS_INDEX.SM_REMOTESESSION) & 0x00000001) != 0) && (error == 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.
Is the 0x00000001 = SYSTEM_METRICS_INDEX.SM_REMOTESESSION
? Maybe we can use that to be clear here.
@lonitra I can address your feedback in a subsequent PR as I have a few in progress. :) |
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.
This moves the rest of System.Drawing.Printing to CsWin32.
Microsoft Reviewers: Open in CodeFlow