lua-users home
lua-l archive

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

On 12/16/2007, "Habib" <> wrote:
>Anyone can give me an idea how I can call win32 API from within LUA?

At LuaForge, you can find LuaSys (, and Win32 API Wrappers ( that
each cover portions of the API.

The Kepler project ( has a bunch
of network and web-related bits under its umbrella. My LuaService
( covers writing a service in otherwise nearly pure Lua, and I'm sure there are other fine projects
that are slipping my mind.

>Plus, what might be the best method to build a Win32 GUI
>framework for busingess applications?

I have used IUP along with CD for this kind of thing. If you need
to handle graphics in a general way as well, look into IM. All
three of these libraries have strong Lua bindings, and work well
together. I have built several GUI utilities out of little more
than those three and a small DLL of application-specific functions.


I rolled my own framework application so that it could have IUP
and CD properly initialized outside of the Lua script, and so
that the exe could carry its own icon and version resource and
generally act like a Windows application without too much fuss.
After one minor gaffe where I sent the customer an update but
forgot a DLL, I even automated the use of DEPENDS.EXE to validate
that my shipment didn't load any DLLs that weren't expected.

All in all, a custom serial protocol debug and analysis tool took
about 1500 lines of C and 1500 lines of Lua, along with IUP and CD.
As importantly, it took about 1/4 the time I had budgeted to write
something to do that task, and ended up more capable than I would
have made a pure MFC application.

After the dust settles from getting LuaService out of alpha, I
intend to make that framework available at LuaForge in case it is
useful to others.