[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Calling arbitrary functions in Windows DLLs from Lua
- From: "Habib" <habib@...>
- Date: Thu, 6 Dec 2007 19:27:14 +0600
I need to module to let my Lua scripts call arbitrary functions in Windows
DLLs. Before I roll my own, has anyone written one already?
Use the dllimport package from here
http://luaforge.net/projects/jaslatrix/
Example:
require"dllimport"
MessageBox = dllimport("USER32","MessageBoxA","i=PPPI")
x = MessageBox(nil, _VERSION, "Hello", 2);
butid = {"OK","CANCEL","ABORT","RETRY","IGNORE","YES","NO"}
MessageBox(nil, "You Clicked " .. butid[x] , "Hello", 0);
Guess that was what you need.
-habib.