#winapi #window #api #create #ui #windows #costless

llwlib

A costless windows api wrapper to create windows

5 releases

0.1.4 Sep 2, 2024
0.1.3 Sep 1, 2024
0.1.2 Aug 30, 2024
0.1.1 Aug 30, 2024
0.1.0 Aug 30, 2024

#101 in Windows APIs

Download history 362/week @ 2024-08-27 78/week @ 2024-09-03 11/week @ 2024-09-10 9/week @ 2024-09-17 23/week @ 2024-09-24 4/week @ 2024-10-01 2/week @ 2024-10-08 1/week @ 2024-10-15

187 downloads per month

MIT license

9KB
129 lines

llwlib - A costless windows api wrapper to create windows

To create a window:

use llwlib::{Window, WindowProperties, WindowStyles};
use windows_sys::Win32::UI::WindowsAndMessaging::*;
use windows_sys::Win32::Foundation::*;

fn main() {
    Window::new(
        WindowProperties {
            style: WindowStyles { ..Default::default() },
            position: (CW_USEDEFAULT, CW_USEDEFAULT),
            classname: "class_name".into(),
            title: "Title".into(),
            size: (1200, 700)
        },
        wnd_proc,
        None,
        false,
        ()
    );
}

unsafe fn wnd_proc(hwnd: HWND, msg: u32, wp: WPARAM, lp: LPARAM, _: isize) -> LRESULT {
    DefWindowProcW(hwnd, msg, wp, lp)
}

Dependencies

~12–19MB
~241K SLoC