Added in 1.1.9:
alien.core and alien.struct are now built into StrokesPlus!
With this functionality, you can directly call external DLLs, be they Windows DLLs like USer32.dll or some other DLL.
Note that alien.core and alien.struct are ALREADY preloaded into the Lua environment, so if you include:
require "alien"
..in your Lua script (as many sample scripts on the Internet do), you will receive an error, unless the alien DLLs are somewhere in the path, but I'm not so sure they would play well together...so that's at your own risk.
Note that making direct calls can cause S+/the Lua engine to crash hard if you screw something up in the script or defining the call(s), so again, this is a use at your own risk disclaimer. I would recommend installing Lua for Windows and testing scripts in there if you're having problems. I'm not a Lua expert, I'm about as novice as possible, I just know this functionality needed to be in StrokesPlus and I've been determined to shoehorn it in any way I could!
Example Lua Script to directly call user32.dll to display a message box (not via the bound acMessageBox(), this is directly calling it):
local alien = alien.core local mb = alien.load("user32.dll") local messagebox = mb.MessageBoxA messagebox:types{ ret = 'long', abi = 'stdcall', 'long', 'pointer', 'string', 'long' } test = "test" messagebox(0, test, "test2", 0)
|