diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 8873048..786954d 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -9,4 +9,4 @@ image = "0.10.4" ash = { path = "../ash" } [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3.4", features = ["windef", "winuser"] } +winapi = { version = "0.3.4", features = ["windef", "libloaderapi"] } diff --git a/examples/src/lib.rs b/examples/src/lib.rs index f60dae7..0209cb2 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -118,11 +118,11 @@ unsafe fn create_surface( window: &winit::Window, ) -> Result { use winapi::shared::windef::HWND; - use winapi::um::winuser::GetWindow; + use winapi::um::libloaderapi::GetModuleHandleW; use winit::os::windows::WindowExt; let hwnd = window.get_hwnd() as HWND; - let hinstance = GetWindow(hwnd, 0) as *const c_void; + let hinstance = GetModuleHandleW(ptr::null()) as *const c_void; let win32_create_info = vk::Win32SurfaceCreateInfoKHR { s_type: vk::StructureType::WIN32_SURFACE_CREATE_INFO_KHR, p_next: ptr::null(),