Deno Win32

Tags Checks License Sponsor

Fast and complete Win32 API bindings for Deno using FFI.

Example

import {
  MB_OKCANCEL,
  MessageBoxA,
} from "https://deno.land/x/win@0.1.1/api/UI/WindowsAndMessaging.ts";

const result = MessageBoxA(
  null,
  "Hello, world!",
  "Hello",
  MB_OKCANCEL,
); // 1 (OK) or 2 (Cancel)

More in examples/ such as demonstrating OpenGL API usage.

Usage

You need to pass --allow-ffi and --unstable flags in order to access the Win32 API.

deno run --allow-ffi --unstable <file>

Note: It is highly recommended to import only APIs you need. Do not import from mod.ts as it will import all sub modules which you might not even need. WinAPI is huge, so are the bindings.

Documentation

Check out the complete API reference here.

Contributing

Code is formatted using deno fmt and linted using deno lint. Please make sure to run these commands before committing.

License

Apache-2.0. Check LICENSE for more details.

Copyright 2022 © DjDeveloperr