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
Add Create method for types MONITORINFO and MONITORINFOEX #371
Comments
psulek
pushed a commit
to psulek/Vanara
that referenced
this issue
Jan 27, 2023
Thank you for submitting a PR. In many places in the project I have used the |
Sure, sounds good! |
psulek
pushed a commit
to psulek/Vanara
that referenced
this issue
Jan 28, 2023
dahall
pushed a commit
that referenced
this issue
Jan 29, 2023
* #371 Add Create method for types MONITORINFO and MONITORINFOEX * fixed CodeFactor issues * #371 Add Create method for types MONITORINFO and MONITORINFOEX * fixed CodeFactor issues * changed Create methods to Default property * fixed MONITORINFOEX.Create() with MONITORINFOEX.Default --------- Co-authored-by: Peter Šulek <peter.sulek@synotgames.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Type
MONITORINFO
andMONITORINFOEX
both have fieldcbSize
, which as described in docs must be set viasizeof()
before calling methodGetMonitorInfo()
(both overloads).This can be confusing for new users (especially new C#/dotnet coders) that calling
var info = new MONITORINFO();
is not enough, and required construct is:var info = new MONITORINFO{ cbSize = sizeof(MONITORINFO) };
Also there can be (depends on user code context) error like:
'MONITORINFO' does not have a predefined size, therefore sizeof can only be used in an unsafe context
.Describe the additions or enhancements you'd like
Create static method
Create()
for both typesMONITORINFO
andMONITORINFOEX
which will setcbSize
automatically for user.The text was updated successfully, but these errors were encountered: