Skip to content

Commit

Permalink
Update to window v0.51
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Aug 14, 2023
1 parent 2e2396e commit 6e0f9b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
46 changes: 28 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
rand = "0.8.5"

[dependencies.windows]
version = "0.48.0"
version = "0.51.0"
features = [
"Foundation_Collections",
"Foundation_Numerics",
Expand Down
6 changes: 3 additions & 3 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl Window {
REGISTER_WINDOW_CLASS.call_once(|| {
let class = WNDCLASSW {
hCursor: unsafe { LoadCursorW(None, IDC_ARROW).ok().unwrap() },
hInstance: instance,
hInstance: instance.into(),
lpszClassName: WINDOW_CLASS_NAME,
lpfnWndProc: Some(Self::wnd_proc),
..Default::default()
Expand All @@ -53,7 +53,7 @@ impl Window {
bottom: height as i32,
};
unsafe {
AdjustWindowRectEx(&mut rect, window_style, false, window_ex_style).ok()?;
AdjustWindowRectEx(&mut rect, window_style, false, window_ex_style)?;
}
(rect.right - rect.left, rect.bottom - rect.top)
};
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Window {
fn get_window_size(window_handle: HWND) -> Result<SizeInt32> {
unsafe {
let mut rect = RECT::default();
GetClientRect(window_handle, &mut rect).ok()?;
GetClientRect(window_handle, &mut rect)?;
let width = rect.right - rect.left;
let height = rect.bottom - rect.top;
Ok(SizeInt32 {
Expand Down

0 comments on commit 6e0f9b0

Please sign in to comment.