Closed JeremyKuhne closed 1 year ago
CsWin32 already supports this:
Just set "wideCharOnly": false
in the NativeMethods.json file. It will still default to giving you the W methods, but instead of suppressing the suffix, it will retain the suffix (in all cases), allowing you to specifically ask for the A suffixed methods.
Is your feature request related to a problem? Please describe. In some cases WinForms needs to access both the ASCII and the Unicode variants of APIs. This isn't currently possible afaik. One example of where this comes up with handling message pumping to/from Windows that are in ASCII mode.
Describe the solution you'd like Allow fully specifying A/W APIs when needed. I'm fine if this is behind a configuration switch.
Describe alternatives you've considered We can, and do, manually define the PInvokes in these cases. Would rather not though. :)
Additional context A bit by Raymond Chen on the topic: If the prototypes of DispatchMessageA and DispatchMessageW are identical, why have both?
775 is another case where we have to manually define things.