Skip to content

Commit 7d4a3ae

Browse files
authored
Update main.rs
1 parent 337446d commit 7d4a3ae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,12 @@ pub unsafe extern "system" fn window_procedure(
165165
return 0;
166166
}
167167
let ptr = (*createstruct).lpCreateParams as *mut WindowData;
168-
return set_window_userdata::<WindowData>(hwnd, ptr).is_ok() as LRESULT;
168+
if let Err(e) = set_window_userdata::<WindowData>(hwnd, ptr) {
169+
println!("Couldn't set the WindowData pointer: {}", e);
170+
return 0;
171+
}
172+
// This is required for the window title to be drawn!
173+
return DefWindowProcW(hwnd, msg, wparam, lparam);
169174
}
170175
WM_CREATE => println!("WM_CREATE"),
171176
WM_CLOSE => {

0 commit comments

Comments
 (0)