Skip to content

Is it possible to get hwnd handle of the WindowHandle object ? #6

Answered by rkarp
deflexor asked this question in Q&A
Discussion options

You must be logged in to vote

I did add a method into_raw_handle for this, which will give you a pointer. winapi models these handles as *mut HWND__, even though in this case it's just a isize under the hood. To get that here, you can just do something like window_handle.into_raw_handle().as_ptr() as isize.

Not very pretty, the new windows library makes the underlying type much more obvious, see: https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Foundation/struct.HWND.html

I may complete the switch to this new library at some point, and then the API in winapi-easy may change as well, especially into_raw_handle. It's all experimental still.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by deflexor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4 on December 25, 2022 15:37.