Jump to content

Editing 'internal' AutoIT functions


Recommended Posts

I am talking about the functions that I cannot find in the include files. Like DllOpen, PixelSearch, FileRead, etc. so I can make create my own edited functions based on those.

But where is the source of those internal functions?

Edited by Hawk
Link to comment
Share on other sites

  • Moderators

Hawk,

AutoIt is closed source so the short answer is "you cannot". :oops:

The longer answer is that that you can download the source of a very old version of AutoIt from here but with the caveat that the current source looks very little like it given the amount of development that has taken place (the last source available is for v3.1.0). :bye:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Melba23 is right that you can't see the actual thing... BUT: As a general rule, the AutoIt functions use the standard winapi methods...

As a result, with a good knowledge of the winapi, you can work out what functions they were using.

  • DllOpen uses LoadLibraryEx (or just LoadLibrary, or possibly GetModuleHandle if it's already loaded). Similarly DllCall uses GetProcAddress.
  • PixelSearch I'm not sure about, I've never had to look at that sort of stuff, but there are people who have written libraries in C(++). They will use similar (maybe faster?) methods to do the same thing.
  • FileRead will use the normal CreateFile then ReadFile and finally CloseHandle.
So as you can see, there is no magic in the AutoIt source code. It does what you'd expect it to. All it does is make it a bit more simple and safe for us. Look at a few of the msdn pages for the functions above, and you could spend 10 minutes deciding what flags you need (particularly things like CreateFile). Having programmed on windows for years I would still not be able to write you winapi programs without msdn handy.
Link to comment
Share on other sites

@Mat: Of course we could write all our functions using the WinAPI (I've written in it too for quite some time), but seeing how easy it is in AutoIT and how well everything works (especially because most things you need, are already written, unlike in other languages). So taking something that works good and just changing it to your needs will lead to better results than trying to mime it from scratch.

But the answer of M23 astounded me. That's sad, I hope I will not need to change basic functions that often...

Link to comment
Share on other sites

  • Moderators

Hawk,

the answer of M23 astounded me

Why did it astound you? Would you expect MS to make its source available to you because you wanted to amend a particular function in Word to be more to your liking? :oops:

As AutoIt has been ripped off in the past, the Devs are rightly keen to protect their work from similar behaviour in the future. Personally I do not blame them one little bit. :bye:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

You wanting the AutoIt source to slightly modify a few functions is overkill. As I've already said, you could rewrite similar things in 20 lines of C. Or 20 lines of AutoIt for that matter. In the AutoIt source code those functions will be a lot longer, and include a lot of stuff for dealing with AutoIt variants etc... So you'd have to learn all that stuff first. You are better off writing a few small AutoIt functions which add a layer on top of the existing functions.

Link to comment
Share on other sites

I didn't think from the beginning that such security is a matter to the devs, because AutoIT is freeware.

@M23: It astounded me because I have changed already a number of functions and apparantly all of them must have been UDFs without me noticing :oops:

Link to comment
Share on other sites

  • Moderators

Hawk,

I didn't think from the beginning that such security is a matter to the devs, because AutoIT is freeware

And we are very lucky that it is - but that does not mean that the intellectual effort behind it should also be freely available. As I explained above, the AutoIt source has been ripped off before - which is why it is no longer available. :oops:

And if you modify some of the UDFs, be careful to read the headers carefully. Certain members only post their code here under license, as is their right, so you need to make sure you respect the conditions. It normally only means adding suitable credit if you use it. :bye:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hmm, I am talking about the UDFs added in AutoIT (listed in the helpfile under "User Defined Functions Reference"), like array or GUI management. Is it necessary for these?

No you were not, you were talking about "DllOpen, PixelSearch, FileRead" it says so in the first post.

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

Is it necessary for these?

As a general rule, in the header there will be an Author...: part and a Modified...: part. You should always leave the original author in tact, and add your name to the modified list. If you are using someone elses code then it's always nice to credit them.

In the standard UDF's, there are no additional rules, they are a part of AutoIt. Some user-submitted UDFs do have additional terms though. Some take it more seriously than others.

Link to comment
Share on other sites

No you were not, you were talking about "DllOpen, PixelSearch, FileRead" it says so in the first post.

->

@M23: It astounded me because I have changed already a number of functions and apparantly all of them must have been UDFs without me noticing :oops:

"I am talking about..." was related to that post. Please read all posts before writing such a comment.

@Mat: Will do! Thanks.

Edited by Hawk
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...