mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
Implemented a HINSTANCE getter function for Windows (#1213)
* Expose HINSTANCE now using a getter function * Missing changes * remove unused import * Required changes for the PR * Rust fmt * Use GetWindowLong * Use GetWindowLong
This commit is contained in:
@@ -14,7 +14,7 @@ use std::{
|
||||
use winapi::{
|
||||
ctypes::c_int,
|
||||
shared::{
|
||||
minwindef::{DWORD, LPARAM, UINT, WORD, WPARAM},
|
||||
minwindef::{DWORD, HINSTANCE, LPARAM, UINT, WORD, WPARAM},
|
||||
windef::{HWND, POINT, RECT},
|
||||
},
|
||||
um::{
|
||||
@@ -358,6 +358,11 @@ impl Window {
|
||||
self.window.0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn hinstance(&self) -> HINSTANCE {
|
||||
unsafe { winuser::GetWindowLongW(self.hwnd(), winuser::GWL_HINSTANCE) as *mut _ }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn raw_window_handle(&self) -> RawWindowHandle {
|
||||
let handle = WindowsHandle {
|
||||
|
||||
Reference in New Issue
Block a user