Page 1 of 1

Can Windows API or DLL functions be run ?

Posted: Thu May 02, 2013 1:51 pm
by robotask
Does robotask support DLL calls or using Windows API ?

Re: Can Windows API or DLL functions be run ?

Posted: Thu May 02, 2013 6:40 pm
by robotask
for illustration purpose only, here is a DLL call from Automate 9 using windows API function(s) from user32.dll

<AMVARIABLE NAME="a"></AMVARIABLE>
<AMEXECUTEDLLFUNCTION DLLFILEPATH="C:\Windows\SysWOW64\user32.dll" METHODNAME="MessageBox" RETURNTYPE="Void"><ARGUMENT ARGTYPE="Int32" ARGVALUE="0" /><ARGUMENT ARGTYPE="String" ARGVALUE="Hi" /><ARGUMENT ARGTYPE="String" ARGVALUE="Bye" /><ARGUMENT ARGTYPE="Int32" ARGVALUE="0" /></AMEXECUTEDLLFUNCTION>

Re: Can Windows API or DLL functions be run ?

Posted: Thu May 02, 2013 7:04 pm
by Oleg
You can use Basic script. See example below:

Code: Select all

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
  (ByVal hWnd As Long, ByVal lpOperation As String, _
  ByVal lpFile As String, ByVal lpParameters As String, _
  ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Declare  Function MyMsgBox Lib "User32.dll" Alias "MessageBox" _
   (ByVal hWnd As Integer, ByVal txt As String, ByVal caption As String, _
   ByVal typ As Integer ) As Integer

Sub Main

ShellExecute(0, "open", "notepad.exe", "", ".", 10)
MyMsgBox(0,"Notepad has been started", "Notification", 0)

End Sub
You can get basic Plugin for RoboTask here:
http://www.robotask.com/downloads/

Direct link:
http://www.robotask.com/downloads/BasicForRoboTask.exe