mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 11:31:32 +11:00
Merge pull request #6 from kondrak/windows-rs
Ignore the "Class already exists" error in multiple-window application
This commit is contained in:
commit
22cd61aabc
|
@ -249,8 +249,11 @@ impl Window {
|
|||
};
|
||||
|
||||
if user32::RegisterClassW(&class) == 0 {
|
||||
println!("Unable to register class, error {}", kernel32::GetLastError() as u32);
|
||||
return None;
|
||||
// ignore the "Class already exists" error for multiple windows
|
||||
if kernel32::GetLastError() as u32 != 1410 {
|
||||
println!("Unable to register class, error {}", kernel32::GetLastError() as u32);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
let new_width = width * scale_factor as usize;
|
||||
|
|
Loading…
Reference in a new issue