Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Using AutoItX in Visual C++ and Dev-C++


  • Please log in to reply
3 replies to this topic

#1 miguel9614

miguel9614

    Seeker

  • Active Members
  • 5 posts

Posted 22 December 2007 - 02:55 PM

I've been meaning to post this guide for a while, but was busy and just got around to it. I thought I'd post this because I had trouble figure out how to do it when I first tried. Hope you find it useful =]

Visual C++
1. start a new project2. go to your Autoit directory (usually C:\Program Files\AutoIt\ )
3. go to the AutoItX/StandardDLL/VC6/Example folder within your Autoit directory
4. copy the following files to your project directory: AutoIt3.h AutoItX3.lib AutoItX3.dll main.cpp
5. in visual studio, go to Project->Add To Project->Files
6. change the "Files of type" dropdown to "all files"
7. Select: AutoIt3.h AutoItX3.lib and main.cpp and add them to the project
8. Your project should now compile and run. the example opens notepad and sends some text to it.

NOTE: you may need to change "APIENTRY WinMain(....)" in main.cpp to "main()" depending on the type of project you madeNow you can use AutoIt commands in your C++ program. Look at the example main.cpp file for an idea of how to use AutoIt functions. Also, look in the AutoIt3.h file for all the functions and how they are to be used.


Dev C++


1. start a new project
2. go to your Autoit directory (usually C:\Program Files\AutoIt\ )
3. go to the AutoItX/StandardDLL/DevC folder within your Autoit directory
4. copy the following files to your project directory: AutoIt3.h libautoitx3.a AutoItX3.dll main.cpp
5. in Dev-C++, go to Project->Add to project
6. Add the following files to the project: main.cpp AutoIt3.h

NOTE: You may need to remove the "main.cpp" file that Dev-C++ automatically adds before adding the autoit example. just go to Project->Remove from project or right click on the file on the left hand side and click "remove". If it asks you to save click no.

7. Now go to Project->Project Options and click on the Parameters tab
8. Click the button that says "Add library or object"
9. Select the libautoitx3.a file
10. the program should now compile and run. the example opens notepad and sends some text to it.

Now you can use AutoIt commands in your C++ program. Look at the example main.cpp file for an idea of how to use AutoIt functions. Also, look in the AutoIt3.h file for all the functions and how they are to be used.


Using AutoIt Commands


I decided to add a small section on actually using the commands, incase anyone has trouble figuring it out from the example file.

Basically all commands start as
AU3_

So in AutoIt the command is
Sleep(1000)


And using the dll it would be
AU3_Sleep(1000);


As I said before, all the functions are in the AutoIt3.h file. Look there to see how to use them.







#2 Oldschool

Oldschool

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 254 posts

Posted 29 December 2007 - 08:06 PM

Cool, I've been looking for something like that. Thx!

#3 GeoX

GeoX

    Seeker

  • Active Members
  • 7 posts

Posted 23 May 2012 - 02:58 PM

Hey thanks for the thread i was looking for something like this, but i got a problem.
I can't find AutoIt3.h libautoitx3.a AutoItX3.dll files in Autoit folder what should i do ?

Edited by GeoX, 23 May 2012 - 02:58 PM.


#4 driveddrived

driveddrived

    Seeker

  • Normal Members
  • 2 posts

Posted 01 April 2014 - 02:36 PM

I can`t find too. Do you can upload?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users