Closed marethyu closed 1 year ago
NWG doesn't wrap this function, but you can call it yourself by adding winapi to your project.
# Cargo.toml
winapi = {version = "0.3", features = ["winuser"]}
use winapi::um::winuser::{AdjustWindowRectEx, RECT, WS_CAPTION};
fn adjust_window_rect() -> RECT {
unsafe {
let mut out: RECT = ::std::mem::zeroed();
AdjustWindowRectEx(&mut out, WS_CAPTION, 1, 0);
out
}
}
Thanks in order to make your code work, I had to change the imports to
use winapi::um::winuser::AdjustWindowRectEx;
use winapi::shared::windef::RECT;
because RECT is private.
I need to calculate the required size for window when menubar is added. C/C++ Win32 API provides this useful function called AdjustWindowRectEx. Does nwg have this such function? I can't find anything relevant in docs.