lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 13/06/2011 11.16, steve donovan wrote:
Hi all,

This is the second beta release of winapi:  basic Windows bindings for Lua.


Hooray!!! :-D

The major change is that (mostly) the library works with widechar
unicode internally, and allows you to specify the encoding up front.
By default it is CP_ACP, but you can set it explicitly to UTF-8.
Running this in SciTE puts a little bit of Greek in the caption:

     local W = require 'winapi'
     W.set_encoding(W.CP_UTF8)
     win = W.foreground_window()
     win:set_text 'ελληνική'

There is a 'get_disk_network_name' function for finding out the UNC
name mapped to a particular drive.

As suggested, P:get_process_name(true) will give the full path of a
process; the default is just to give the exe name.

Excellent!


show_message is now generalized like so:

winapi.show_message("Message","stuff\nand nonsense","yes-no","warning")

Another change is that there is an explicit Thread object returned
from functions like winapi.timer, which supports suspend, resume and
kill methods.

Precompiled binary for Lua for Windows is at [1]; source zipball is at
[2]. Docs are at [3] and [4].

(Still only 25K !)

Ok, this is almost magic! Now if there were an equally powerful library for *NIX systems (with the same low footprint) plus a lightweight abstraction layer, then we could have a nice little cross-platform automation tool (at ~100kB + Lua) :-)


steve d.

[1] http://stevedonovan.github.com/files/winapi-1.1.zip
[2] http://stevedonovan.github.com/files/winapi-1.1-lfw.zip
[3] http://stevedonovan.github.com/winapi/
[4] http://stevedonovan.github.com/winapi/api.html




-- Lorenzo