Closed ShayBox closed 1 year ago
Hi. In the windows crate, the HWND is just a wrapper around isize. The HWND is practically an IntPtr, therefore converting *mut c_void
to HWND
is just a cast. To convert it see: Getting a windows-rs HWND from winit?. Not all HWND implementations by different crates are the same. Ex.: in winapi
, an empty enum is used. Maybe if we supported HWND directly it would not be HWND but isize.
EDIT: Converting a HWND
to *mut c_void
should simply be:
use std::ffi::c_void;
let hwnd = HWND(100isize);
let void_ptr = hwnd.0 as *mut c_void;
Thank you :+1:
Why do you require a
*mut c_void
then convert it toHWND
internally, when every windows library directly gives youHWND
.https://github.com/Sinono3/souvlaki/blob/master/src/platform/windows/mod.rs#L53
How do you even convert
HWND
to*mut c_void
? None of the examples even show using the library with any windows crate.