Documentation | Help File | Scripter Studio | Calling dll functions | Basic syntax
FUNCTION LIB "libName.dll" ALIAS external_function_name calling_convention function_name( arguments ) AS result_type
For example, the following declaration:
FUNCTION LIB "CustomLib.dll" MyFunction( arg AS Integer ) AS Integer
imports a function called MyFunction from CustomLib.dll. Default calling convention, if not specified, is stdcall. Scripter Studio also allows to declare a different calling convention (stdcall, register, pascal, cdecl or safecall) and to use a different name for DLL function, like the following declaration:
FUNCTION MessageBox LIB "User32.dll" ALIAS "MessageBoxA" stdcall ( hwnd AS pointer, text AS String, caption AS String, msgtype AS Integer ) AS Integer
The above function imports function MessageBoxA from User32.dll (Windows API library), and names it MessageBox for usage in script.
Declaration above can be used for functions and procedures (routines without result value).