Checkout retrowin32 for something similar but written in Rust and not specifically targeting the web: https://github.com/evmar/retrowin32