#winapi #windowing #opinionated #window #windows

win64

An opinionated modernization of the Win32 windowing library

1 unstable release

0.0.1 Aug 10, 2024

#101 in #windowing

40 downloads per month

MIT/Apache

36KB
877 lines

win64

An opinionated modernization of the Win32 windowing library for Rust

use win64::prelude::*;

fn main() {
  Window::new(
    &WindowClass::new(&WindowClassDescriptor::default()),
    &WindowDescriptor::default()
      .with_title("Test")
      .with_size(Some((800, 500))),
    UserData::new(),
  )
  .unwrap();

  MessagePump::wait().run();
}

struct UserData;

impl WindowProcedure for UserData {
  fn on_message(&mut self, window: Window, message: Message) -> ProcedureResult {
    if let win32::WM_DESTROY = message.id() {
      window.quit()
    }

    self.default_window_procedure(window, message)
  }
}

Dependencies

~128MB
~2M SLoC