mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-27 02:56:33 +11:00
Ignore the "Class already exists" error in multiple-window application
This commit is contained in:
parent
6fd476783c
commit
de47861fe3
1 changed files with 8 additions and 2 deletions
|
@ -249,8 +249,14 @@ impl Window {
|
|||
};
|
||||
|
||||
if user32::RegisterClassW(&class) == 0 {
|
||||
println!("Unable to register class, error {}", kernel32::GetLastError() as u32);
|
||||
return None;
|
||||
let err_code = kernel32::GetLastError() as u32;
|
||||
|
||||
// ignore the "Class already exists" error for multiple windows
|
||||
if err_code != 1410
|
||||
{
|
||||
println!("Unable to register class, error {}", kernel32::GetLastError() as u32);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
let new_width = width * scale_factor as usize;
|
||||
|
|
Loading…
Add table
Reference in a new issue