msgbox 0.3.0

Simple, cross-platform message box GUI library. All it does is to show a message box modal with a OK button, which runs synchronously. All the other jobs stop until the user responds. It runs fine with OpenGL windows already open. It supports multi-platform, and maintains separate dependencies per platform, thus light-weight. - Synchronous Message Modal - Multi-platform (Linux GTK3+, Windows and OSX) - Light-weight
Documentation
use icon::IconType;

pub fn create(title: &str, content: &str, icon_type: IconType) {
    use std::iter::once;
    use std::ptr::null_mut;
    use winapi::um::winuser::{
        MessageBoxW, MB_ICONERROR, MB_ICONINFORMATION, MB_OK, MB_SYSTEMMODAL,
    };

    let lp_text: Vec<u16> = content.encode_utf16().chain(once(0)).collect();
    let lp_caption: Vec<u16> = title.encode_utf16().chain(once(0)).collect();

    let window_type = match icon_type {
        IconType::Error => MB_OK | MB_ICONERROR | MB_SYSTEMMODAL,
        IconType::Info => MB_OK | MB_ICONINFORMATION | MB_SYSTEMMODAL,
        IconType::None => MB_OK | MB_SYSTEMMODAL,
    };

    unsafe {
        MessageBoxW(
            null_mut(),
            lp_text.as_ptr(),
            lp_caption.as_ptr(),
            window_type,
        );
    }
}