mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-27 02:56:33 +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
1 changed files with 5 additions and 2 deletions
|
@ -249,8 +249,11 @@ impl Window {
|
||||||
};
|
};
|
||||||
|
|
||||||
if user32::RegisterClassW(&class) == 0 {
|
if user32::RegisterClassW(&class) == 0 {
|
||||||
println!("Unable to register class, error {}", kernel32::GetLastError() as u32);
|
// ignore the "Class already exists" error for multiple windows
|
||||||
return None;
|
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;
|
let new_width = width * scale_factor as usize;
|
||||||
|
|
Loading…
Add table
Reference in a new issue