Call AutoItX Directly (VB 2010)
#1
Posted 27 December 2011 - 03:07 AM
So is there a way to just use the functions of AutoItX? I don't want to have to make an installer either. I just wany my single .EXE file with all my AI functions.
Thanks!
#2
Posted 27 December 2011 - 10:25 AM
#3
Posted 27 December 2011 - 09:27 PM
#4
Posted 27 December 2011 - 11:29 PM
#5
Posted 17 May 2012 - 03:00 PM
#6
Posted 12 July 2012 - 08:31 PM
In the class where you want to use AutoIt functionality (C# code):
AutoItX3Lib.AutoItX3Class au3 = new AutoItX3Lib.AutoItX3Class();
au3.AutoItSetOption("WinTitleMatchMode", 2);
au3.WinWaitActive(windowName, "", maxTimeInSec)
...
#7
Posted 15 July 2012 - 07:25 PM
Just "add reference" to the AutoitX.dll and set Embed Interop Types" to FALSE (see properties tab in references). This worked ok for me.
In the class where you want to use AutoIt functionality (C# code):
AutoItX3Lib.AutoItX3Class au3 = new AutoItX3Lib.AutoItX3Class();
au3.AutoItSetOption("WinTitleMatchMode", 2);
au3.WinWaitActive(windowName, "", maxTimeInSec)
...
Do I have to register it on the host computer first and then do that? Because, when I try to add a reference without registering, I receive error, "A Reference To AutoItX3_X64.dll could not be added. Please make sure that the file is accessible..."
Please get back to me ASAP.
#8
Posted 19 July 2012 - 07:47 PM
#9
Posted 20 July 2012 - 07:29 AM
If you are using directly, the dll, you do not have to register it
In either case, it must be linked properly from within your IDE.
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)
#10
Posted 22 July 2012 - 06:40 PM
#11
Posted 10 August 2012 - 06:54 PM
Forgot to mention, but as JohnOne said, I am using the DLL directly from the lib folder in my solution.
Yes, but I don't see a "lib" folder and the only way to add a DLL to VS is to add it as a reference. In which case, I have to register it. I don't understand...
#12
Posted 10 August 2012 - 08:19 PM
#13
Posted 10 August 2012 - 08:34 PM
A simple way is using LoadLibrary and GetProcAddress.
Well, that sounds good. I'm familiar with API. Can I follow this guide?
http://www.omegajunior.net/code/vbnet_unmanaged.html
It seems like it should work, but I would like to make sure before I spend countless hours on something that won't work.
#14
Posted 11 August 2012 - 03:54 PM
typedef long (WINAPI *MouseMoveProc)(long nX, long nY, long nSpeed); int _tmain(int argc, _TCHAR* argv[]) { HMODULE hModule = LoadLibrary("AutoItX3.dll"); if (hModule == NULL) { MessageBox(NULL, "Error 1", "", MB_OK); return 0; } MouseMoveProc MouseMove = (MouseMoveProc)GetProcAddress(hModule, "AU3_MouseMove"); if (MouseMove == NULL) { MessageBox(NULL, "Error 2", "", MB_OK); return 0; } MouseMove(10, 10, 0); return 0; }
Edited by D4RKON3, 11 August 2012 - 03:55 PM.
#15
Posted 12 August 2012 - 02:20 AM
Thank you, again.
#16
Posted 26 September 2012 - 12:45 AM
I am trying to create an VB application that use mostly AutoIT commands & am unsure of how exactly to begin.
Any help you can offer would be much appreciated.
Thanks a ton!
#17
Posted 23 October 2012 - 11:13 AM
Automatic install dll file to system32 directory and registering dll to use.
You'll see dll lib add in the reference com. You must Import Class lip on the class form.
Example: VB.NET run calculator application.
Imports AutoItX3Lib Public Class Form1 Private oAutoItX As New AutoItX3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click oAutoItX.Run("calc.exe") End Sub End Class
Edited by Laymanball, 23 October 2012 - 11:44 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





