question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unifying an argument in the `ReleaseUiaProvider` method to `HWND`.

See original GitHub issue

Replace the type of the handle parameter from IntPtr to IHandle<HWND> in the Control.ReleaseUiaProvider method and its overrides.

    Suggestion - consider unifying argument in this method to `nint` in the next PR.

_Originally posted by @Tanya-Solyanik in https://github.com/dotnet/winforms/pull/7349#discussion_r1023472589_ 📓 - modified bug title and body per @elachlan suggestion

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Tanya-Solyanikcommented, Dec 5, 2022

Not sure about this, but in most cases, a provided value is IntPtr.Zero or HandleInternal (_window. Handle).

The HWND is passed in to disconnect child controls (when it’s not a Zero or the self) This is another area to clean up, for example by moving the disconnect method to children, or introducing a dedicated “releasechild” method.

0reactions
elachlancommented, Dec 5, 2022

I agree, the design can definitely be improved here to avoid exposing the IntPtr parameter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unifying an argument in the `ReleaseUiaProvider` method ...
Windows Forms is a .NET UI framework for building Windows desktop applications. - Unifying an argument in the `ReleaseUiaProvider` method to `HWND`.
Read more >
Unifying an argument in the `ReleaseUiaProvider` method ...
Windows Forms is a .NET UI framework for building Windows desktop applications. - Unifying an argument in the `ReleaseUiaProvider` method to `HWND`.
Read more >
Can I pass a HWND in a COM method?
I think that HWND is a pointer to a struct thats why you can't use it in the IDL. If you look at...
Read more >
HWND address changes when used for a parameter from ...
I was trying to make a function createscalingwindow that calls CreateWindowEx and writes the address's of the HWND used in CreateWindowEx to a ......
Read more >
SetWindowPos function (winuser.h) - Win32 apps
A window can be made a topmost window either by setting the hWndInsertAfter parameter to HWND_TOPMOST and ensuring that the SWP_NOZORDER flag ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found