DLL.CallFunction

string DLL.CallFunction ( 

string Filename,

string FunctionName,

string Parameters = "",

number ReturnType = 0,

number CallConvention = 0 )

Example 1

DLLResult = DLL.CallFunction("winmm.dll", "mciSendStringA", "\"Set CDAudio Door Open\",0,0,0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);

Calls the mciSendStringA function in the Windows winmm.dll file to send a "Set CD Audio Door Open" command to the MCI driver (along with two parameters, both 0).  This causes the CD-ROM drive tray to open (i.e. it ejects the CD).

Example 2

DLL.CallFunction ( _SystemFolder .. "\\User32.dll", "SetCursorPos", "0,0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);

Calls the SetCursorPos function in the "Windows\System32\User32.dll" file to move the mouse cursor to the upper left corner of the screen (i.e. to coordinates "0,0"). Since no variable is provided to store the return value, if the DLL function returns anything it will just be ignored.

See also:  Related Actions