-
Notifications
You must be signed in to change notification settings - Fork 998
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
Migrate TaskDialogIndirect to CsWin32 #9900
Conversation
@JeremyKuhne any suggestions on the BOOL.ToString() clash? Should we rename our implementation, or should we fix it upstream in CsWin32? |
@elachlan I'd just remove ours and have everything do |
@AArnott could you please bump the CsWin32 Win32Metadata SDK version? |
@elachlan I have a local change where I started the work to update the metadata, but some breaking changes in the metadata made it more challenging than usual, so I set it aside. I'll pick it back up and see what I can do. |
Metadata update coming: microsoft/CsWin32#1063 |
Thank you! |
af12fdd
to
6adaebc
Compare
@lonitra can you please have a look? |
src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/ToolInfoWrapper.cs
Show resolved
Hide resolved
I will take a look this week |
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.
Great work here! My main concern here is making the .Anonymous more readable
....Windows.Forms.Primitives/tests/UnitTests/Interop/ComCtl32/TASKDIALOGCONFIGIconUnionTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TaskDialog.cs
Outdated
Show resolved
Hide resolved
IntPtr wParam, | ||
IntPtr lParam, | ||
IntPtr lpRefData) => | ||
uint msg, |
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.
Any reason we didn't keep this as TASKDIALOG_NOTIFICATIONS
?
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.
To match the pfcallback
signature of the TASKDIALOGCONFIG
struct. Which changed when we switched to using the cswin32 generated struct. See line 1330.
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.
It might make sense to update win32metadata based on the doc.
https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nc-commctrl-pftaskdialogcallback
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.
Based on docs that does seem to make sense. Could you open an issue there and perhaps also add a comment here to update this when that issue is resolved and cswin32 has consumed the fix? I think we'd probably get an error anyways once we update cswin32 version that has that fix, but it doesn't hurt.
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.
Issue raised at: microsoft/win32metadata#1733
I am unsure if it will be accepted. But I think we are now allowing enums to group the constants and then adding an attribute to point to the enum for cswin32 to consume. This is instead of using the enum directly, to avoid issues.
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.
Ok, we managed to get the issue resolved and now I guess we wait for a cswin32 update?
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.
Pinged for a cswin32 update to consume latest metadata. Will circle back to this to review changes soon
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.
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.
Oops 🤦♀️ v57 is not released yet so we would need to wait on that.. Once that is released we can follow steps in cswin32 readme to use newer metadata to avoid waiting for cswin32 to consume. Alternatively if we'd rather not wait we can leave as is and create tracking issue to bump and update this code when v57 is released.
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.
Tracking issue is good:
#10348
src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/ToolInfoWrapper.cs
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/ToolInfoWrapper.cs
Outdated
Show resolved
Hide resolved
6b7d44c
to
ebb5cbc
Compare
src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/TASKDIALOGCONFIG.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/TVINSERTSTRUCTW.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/tests/UnitTests/Interop/ComCtl32/TASKDIALOGCONFIGTests.cs
Outdated
Show resolved
Hide resolved
....Windows.Forms.Primitives/tests/UnitTests/Interop/ComCtl32/TASKDIALOGCONFIGIconUnionTests.cs
Outdated
Show resolved
Hide resolved
51a6d8e
to
2627884
Compare
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.
👍
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.
@elachlan - seem like https://github.com/dotnet/winforms/pull/9900/files#r1374857146 is not addressed, are we waiting on something to implement it?
src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Controls/ToolInfoWrapper.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialogButton.cs
Outdated
Show resolved
Hide resolved
....Windows.Forms.Primitives/tests/UnitTests/Interop/ComCtl32/TASKDIALOGCONFIGIconUnionTests.cs
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Dialogs/TaskDialog/TaskDialogButton.cs
Outdated
Show resolved
Hide resolved
Thank you for pushing through with the reviews! |
Related: #9825
We are waiting on some Win32MetaData changes to bubble into CsWin32 before I can complete this.
Currently blocked by microsoft/CsWin32#1020 which added
BOOL.ToString
clashing with our implementation but returning the hex value as a string instead of True/False.Microsoft Reviewers: Open in CodeFlow