pub(crate) fn create_message_window() -> Result<ControlHandle, NwgError> {
    use winapi::um::winuser::HWND_MESSAGE;
    use winapi::um::winuser::CreateWindowExW;
    use winapi::um::libloaderapi::GetModuleHandleW;


    let class_name = to_utf16("NativeWindowsGuiWindow");
    let window_title = vec![0];

    unsafe {
        let hmod = GetModuleHandleW(ptr::null_mut());
        if hmod.is_null() { return Err(NwgError::initialization("GetModuleHandleW failed")); }
        
        let handle = CreateWindowExW (
            0,
            class_name.as_ptr(),
            window_title.as_ptr(),
            0,
            0, 0,
            0, 0,
            HWND_MESSAGE,
            ptr::null_mut(),
            hmod,
            ptr::null_mut()
        );

        if handle.is_null() {
            Err(NwgError::initialization("Message only window creation failed"))
        } else {
            Ok(ControlHandle::Hwnd(handle))
        }
    }
}
/// Create a message only window. Used with the `MessageWindow` control
Create a message only window. Used with the `MessageWindow` control
Create a message only window . Used with the ` MessageWindow ` control
pub(crate) fn create_message_window() -> Result<ControlHandle, NwgError> {
    use winapi::um::winuser::HWND_MESSAGE;
    use winapi::um::winuser::CreateWindowExW;
    use winapi::um::libloaderapi::GetModuleHandleW;
    let class_name = to_utf16("NativeWindowsGuiWindow");
    let window_title = vec![0];
    unsafe {
        let hmod = GetModuleHandleW(ptr::null_mut());
        if hmod.is_null() { return Err(NwgError::initialization("GetModuleHandleW failed")); }
        let handle = CreateWindowExW (
            0,
            class_name.as_ptr(),
            window_title.as_ptr(),
            0,
            0, 0,
            0, 0,
            HWND_MESSAGE,
            ptr::null_mut(),
            hmod,
            ptr::null_mut()
        );
        if handle.is_null() {
            Err(NwgError::initialization("Message only window creation failed"))
        } else {
            Ok(ControlHandle::Hwnd(handle))
        }
    }
}
pub ( crate ) fn create_message_window ( ) -> Result < ControlHandle , NwgError > { use winapi :: um :: winuser :: HWND_MESSAGE ; use winapi :: um :: winuser :: CreateWindowExW ; use winapi :: um :: libloaderapi :: GetModuleHandleW ; let class_name = to_utf16 ( " " ) ; let window_title = vec ! [ 0 ] ; unsafe { let hmod = GetModuleHandleW ( ptr :: null_mut ( ) ) ; if hmod . is_null ( ) { return Err ( NwgError :: initialization ( " " ) ) ; } let handle = CreateWindowExW ( 0 , class_name . as_ptr ( ) , window_title . as_ptr ( ) , 0 , 0 , 0 , 0 , 0 , HWND_MESSAGE , ptr :: null_mut ( ) , hmod , ptr :: null_mut ( ) ) ; if handle . is_null ( ) { Err ( NwgError :: initialization ( " " ) ) } else { Ok ( ControlHandle :: Hwnd ( handle ) ) } } }
Create a message only window.
Create a message only window .