Files
archived-cef-rs/examples/cefsimple/src/shared/simple_handler/win.rs
Bill Avery e66a73c60e feat(test): port tests/shared library from CEF
feat: unify bundle utilities under cef build-util feature

feat: reenable sandbox support in cefsimple

feat: add MainMenu.xib on mac

fix: bypass tryToTerminateApplication for Command+Q

fix: enable much smaller linux release builds
2026-01-01 15:34:55 -08:00

19 lines
627 B
Rust

use cef::*;
use std::iter;
use windows_sys::Win32::{Foundation::HWND, UI::WindowsAndMessaging::*};
fn window_from_browser(browser: Option<&mut Browser>) -> Option<HWND> {
let window = browser?.host()?.window_handle().0;
Some(window.cast())
}
pub fn platform_title_change(browser: Option<&mut Browser>, title: Option<&CefString>) {
let Some(window) = window_from_browser(browser) else {
return;
};
let title = title.map(CefString::to_string).unwrap_or_default();
let title: Vec<_> = title.encode_utf16().chain(iter::once(0)).collect();
unsafe { SetWindowTextW(window, title.as_ptr()) };
}