refactor resolution, mid commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-05-17 23:19:20 +08:00
parent 154b86d2a5
commit a603e046e3
9 changed files with 196 additions and 55 deletions

View File

@@ -1888,6 +1888,10 @@ pub fn change_resolution(name: &str, width: usize, height: usize) -> ResultType<
if FALSE == EnumDisplaySettingsW(NULL as _, ENUM_CURRENT_SETTINGS, &mut dm) {
bail!("EnumDisplaySettingsW failed, errno={}", GetLastError());
}
// to-do: check if need change
println!("REMOVE ME ========================== dm ({},{}) to ({},{})", dm.dmPelsWidth, dm.dmPelsHeight, width, height);
let wname = wide_string(name);
let len = if wname.len() <= dm.dmDeviceName.len() {
wname.len()