finds.dev← search

// the find

stevedonovan/winapi

★ 211 · C · NOASSERTION · updated Sep 2021

Minimal but useful Lua bindings to the Windows API

A Lua binding to a practical slice of the Win32 API: process creation, window enumeration and control, the registry, directory watching, named pipes and events. It suits Lua developers writing small Windows utilities or GUI helpers in SciTE, IUP or wxLua, not anyone building a general Windows automation framework.

execute captures command output without flashing a console window, which is the real pain point for GUI Lua apps, and spawn_process with read_async gives a non-blocking alternative. wait_for_processes can wait on processes and a console handle together with a timeout, so one loop can handle user input and periodic work. Encoding is explicit: set_encoding picks the Lua-side code page, and the library works in UTF-16 internally rather than pretending Lua strings carry an encoding. The build is a set of plain batch files for MSVC and gcc with no external dependencies.

The last push was September 2021, and the examples target Lua 5.1 and Python 2.6. Nothing in the README says it has been tested on Lua 5.4 or current Windows builds, so expect to do the compatibility work yourself. Callbacks are serialised, so only one runs at a time and each one blocks Lua; a slow handler freezes the whole program. File:read returns whatever is available with no buffering, so line parsing is left to the caller. Several links are placeholders ('?') for wxLua, IUP and LuaFileSystem, which suggests the docs were not fully maintained.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →