AC130 Posted December 27, 2011 Share Posted December 27, 2011 Is it possible to call AutoItX dll directly into my application? I plan on having my program on multiple computers, and I don't want to have to register it for every computer. 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! Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 27, 2011 Share Posted December 27, 2011 You will need to include the dll file. You don't have to register it if you call it like a dll instead of a COM object. Link to comment Share on other sites More sharing options...
AC130 Posted December 27, 2011 Author Share Posted December 27, 2011 Do you know how to do it in VB? Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 27, 2011 Share Posted December 27, 2011 No. I haven't touched VB in a very long time. Link to comment Share on other sites More sharing options...
Laymanball Posted May 17, 2012 Share Posted May 17, 2012 AutoItX3.dll math with vb.net. you try. My Sample Script Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html Link to comment Share on other sites More sharing options...
WimH Posted July 12, 2012 Share Posted July 12, 2012 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) ... Link to comment Share on other sites More sharing options...
AC130 Posted July 15, 2012 Author Share Posted July 15, 2012 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. Thanks! Link to comment Share on other sites More sharing options...
WimH Posted July 19, 2012 Share Posted July 19, 2012 I did not need to register on the host computer (XP). I did not test on 64bit however, only on Win7 32 and on XP. Both worked without any problems (Win 7 pc has however AutoIt editor installed) Link to comment Share on other sites More sharing options...
JohnOne Posted July 20, 2012 Share Posted July 20, 2012 I you are using the COM method, you will need to register it. 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. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
WimH Posted July 22, 2012 Share Posted July 22, 2012 Forgot to mention, but as JohnOne said, I am using the DLL directly from the lib folder in my solution. Link to comment Share on other sites More sharing options...
AC130 Posted August 10, 2012 Author Share Posted August 10, 2012 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... Link to comment Share on other sites More sharing options...
FaridAgl Posted August 10, 2012 Share Posted August 10, 2012 A simple way is using LoadLibrary and GetProcAddress. http://faridaghili.ir Link to comment Share on other sites More sharing options...
AC130 Posted August 10, 2012 Author Share Posted August 10, 2012 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.htmlIt seems like it should work, but I would like to make sure before I spend countless hours on something that won't work. Link to comment Share on other sites More sharing options...
FaridAgl Posted August 11, 2012 Share Posted August 11, 2012 (edited) Well, I didn't touched VB at all and I'm not familiar with its syntax, but a working example of this in C++ should be like this: 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 August 11, 2012 by D4RKON3 http://faridaghili.ir Link to comment Share on other sites More sharing options...
AC130 Posted August 12, 2012 Author Share Posted August 12, 2012 Thank you. It looks promising. I've already found all the API for VB.NET and am trying to load the functions now. I'll post back with my results. Thank you, again. Link to comment Share on other sites More sharing options...
texasranger Posted September 26, 2012 Share Posted September 26, 2012 AC130, did you resolve this with the API for VB.NET as you mention in your last post? In other words, are you now able to call AutoIT commands directly in your Visual Basic solution? If so, do you mind sharing this? I am basically in the exact situation you were in when you started this discussion. However, I am fairly new to this & need a lot of guidance right now. 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! Link to comment Share on other sites More sharing options...
Laymanball Posted October 23, 2012 Share Posted October 23, 2012 (edited) Dowload: AutoItX3Dll Auto Register AutoRegisterAutoItX3Dll: Click hereAutomatic 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 October 23, 2012 by Laymanball My Sample Script Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now