Use null for PeekMessageW on Windows

This commit is contained in:
Daniel Collin 2020-07-09 11:48:22 +02:00
parent d0d3ffcf7b
commit cb0ceee910

View file

@ -763,11 +763,11 @@ impl Window {
} }
} }
fn message_loop(&self, window: windef::HWND) { fn message_loop(&self, _window: windef::HWND) {
unsafe { unsafe {
let mut msg = mem::zeroed(); let mut msg = mem::zeroed();
while winuser::PeekMessageW(&mut msg, window, 0, 0, winuser::PM_REMOVE) != 0 { while winuser::PeekMessageW(&mut msg, std::ptr::null_mut(), 0, 0, winuser::PM_REMOVE) != 0 {
// Make this code a bit nicer // Make this code a bit nicer
if self.accel_table == ptr::null_mut() { if self.accel_table == ptr::null_mut() {
winuser::TranslateMessage(&mut msg); winuser::TranslateMessage(&mut msg);