Jump to content

How to add a UDF to Auto It?


 Share

Recommended Posts

  • Moderators

mikejp56,

The Adding UDFs to AutoIt and SciTE tutorial in the Wiki tells you how best to store and use downloaded UDFs. :graduated:

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

I didnt even know this was possible.

Is there any advantage to this over adding a udf at the bottom of your script or calling it from the working folder?

Link to comment
Share on other sites

  • Moderators

Chimaera,

Is there any advantage to this over adding a udf at the bottom of your script or calling it from the working folder?

Quite a lot in my opinion: :graduated:

adding a udf at the bottom of your script: You have a single #include line in each script rather then the entire UDF - saves a lot of space and makes the script easier to manipulate in SciTE.

calling it from the working folder: You have a single #include file that you can call with the same syntax as the standard #include files rather than many copies of the UDF spread all over the place.

In both cases updating the UDF would be a nightmare - with a single copy on the system updating is easy. And keeping your personal and dowmloaded UDFs in a user-defined folder outside the normal installation path means you are very unlikely to lose them. ;)

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

  • Moderators

mikejp56,

I thought the tutorial explained "step by step how to add a downloaded UDF to AutoIt" - that is why I wrote it! :graduated:

- 1. Create a folder, preferably not within the AutoIt3 folder structure.

- 2. Tell AutoIt about it - there are 2 ways to do this.

- 3. Put the UDFs into the folder.

- 4. [Optional] Create the CallTip and AutoComplete entries.

- 5. Use the UDFs exactly as you would a standard #include file.

What exactly is unclear? ;)

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

  • Moderators

mikejp56,

If you use the full SciTE4AutoIt3 package (and if you do not you should as it gives you lots of extra goodies to help you code - you can download it from here) then just open SciTEConfig from the <Tools> menu (you may need to have an *.au3 file open in SciTE) and put the new folder path in the "AutoIt3 Directory settings" input about 2/3 down the dialog. There is even a "Browse" button (the one with "...") to save your typing fingers. ;)

If you do not use the full SciTE4AutoIt3 package then open RegEdit and create a registry entry as explained in the Help file. As usual, take the normal precautions when amending with the registry.

Is that clear enough? :graduated:

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

  • Moderators

mikejp56,

I do not appreciate being trolled. ;)

The tell Auto It about it part, that is what I don't understand

I explain that and then I get:

I understand that, but I do not understand the parts about calltips and auto complete

What is so hard about creating 2 files - C:\Program Files\AutoIt3\SciTE\api\au3.user.calltips.api and C:\Program Files\AutoIt3\SciTE\Properties\au3.userudfs.properties - and adding a couple of lines to each of them? You can do this in NotePad - the format is explained in the tutorial! :graduated:

Go and give it try - it is not difficult! :)

M23

P.S. You will need to downlaod and install the full SciTE4AutoIt3 package to make the CallTips and AutoComplete work with those files. ;)

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

Hi Melba23,

Trust me, I am not trolling you; I do not even know what that means.

I have used Auto It in the past with the built in UDF's but I never downloaded and added 'external' UDFs before.

Sorry if I am a little thick.

mikejp56

Link to comment
Share on other sites

Hi Melba23,

Trust me, I am not trolling you; I do not even know what that means.

I have used Auto It in the past with the built in UDF's but I never downloaded and added 'external' UDFs before.

Sorry if I am a little thick.

mikejp56

I lol'd reading all of this, I used to have the same problem but I never asked these questions since there's an awesome guy named "Google" that has the answer to all these questions and more, you should consider talking to him about this, I'm sure he'll be more than glad to help you out, he's a pretty cool guy and everything.

Link to comment
Share on other sites

1- Look this

2- copy the code and paste it in scite and run the script

[font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting.

 

[font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color]

[font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font]

Link to comment
Share on other sites

Hi All,

Alright, after trying to add the WinAPIEx.au3 UDF to Auto It, I tried a very simple program:

#Include <WinAPIEx.au3>

$var= _WinAPI_GetLogicalDrives()

MsgBox(0, "Logical Drives", $var)

I get 20 errors having to do with WinAPIEx.au3.

How do I get this script to run?

mike

Link to comment
Share on other sites

you must put WinAPIEx.au3 in this path "C:\Program Files\AutoIt3\Include" to include it

user call tips just for calling UDFs in scite :graduated:

Edited by Command3r

[font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting.

 

[font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color]

[font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font]

Link to comment
Share on other sites

you must put WinAPIEx.au3 in this path "C:\Program Files\AutoIt3\Include" to include it

Command3r,

The whole point of Melba's wiki entry is to avoid putting custom UDF's in the standard UDF location. I have to say the wiki entry is pretty easy to understand if followed correctly.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • Moderators

mikejp56,

Have you got this sorted out yet? :D

If not, where are you in the process? If the answer is nowhere, be honest so we can get you sorted out. It really is not that difficult! :rip:

M23

P.S. And then we can prevent any more idiots butting in like the one above who suggests doing exactly what you should NOTdo. :oops:

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

Hi M23,

I downloaded the latest Scite4Auto it and installed it. To keep things simple, I put the WinAPIEx.au3 file in the include folder, C:\Program Files\Autoit3\Include.

I went to Scite-Tools-Scite Config and set the User Include Dir to C:\Program Files\Autoit3\Include.

I then run the following script sucessfully:

#include <date.au3>

;#include <WinAPIEx.au3>

MsgBox(0,"Today","Today's date is " & _Now())

Note that the #include <WinAPIEx.au3> statement is commented out.

When I take out semicolon, I get the following error messages:

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(30510,9) : ERROR: syntax error

Static $pProc

~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(823,32) : ERROR: __Ver(): undefined function.

Global Const $__WINVER = __Ver()

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(869,211) : ERROR: __Iif(): undefined function.

Global Const $tagPRINTDLG = 'align 2;dword_ptr Size;hwnd hOwner;ptr hDevMode;ptr hDevNames;hwnd hDC;dword Flags;ushort FromPage;ushort ToPage;ushort MinPage;ushort MaxPage;' & __Iif(@AutoItX64, 'uint', 'ushort')

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(1212,83) : ERROR: __TransparencyProc(): undefined function.

$Ret = DllCall('user32.dll', 'int', 'CallWindowProc', 'ptr', __TransparencyProc()

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(2788,22) : ERROR: __RGB(): undefined function.

Return __RGB($Ret[0])

~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(3596,74) : ERROR: __XORProc(): undefined function.

$Ret = DllCall('user32.dll', 'int', 'CallWindowProc', 'ptr', __XORProc()

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(3655,74) : ERROR: __ANDProc(): undefined function.

$Ret = DllCall('user32.dll', 'int', 'CallWindowProc', 'ptr', __ANDProc()

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(5265,42) : ERROR: __HeapReAlloc(): undefined function.

$pString = __HeapReAlloc($pString, $Size)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(5887,13) : ERROR: __Inc(): undefined function.

__Inc($Val)

~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(5997,52) : ERROR: __Hex(): undefined function.

$Val[$Val[0]] = __Hex($Val[$Val[0]], $aItem[1])

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(6077,32) : ERROR: OnAutoItExitRegister(): undefined function.

OnAutoItExitRegister('__Quit')

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(6097,34) : ERROR: OnAutoItExitUnregister(): undefined function.

OnAutoItExitUnregister('__Quit')

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(6099,9) : ERROR: __Quit(): undefined function.

__Quit()

~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(8030,41) : ERROR: __Binary(): undefined function.

Return SetError($Error, __Binary($__Ext)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(9285,21) : ERROR: __HeapFree(): undefined function.

__HeapFree($__Text)

~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(10462,43) : ERROR: _WinAPI_MakeQWord(): undefined function.

Return _WinAPI_MakeQWord($Ret[0], $Ret[2])

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(10527,28) : ERROR: __DLL(): undefined function.

If Not __DLL('connect.dll')

~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(17321,41) : ERROR: __HeapValidate(): undefined function.

Local $Result = __HeapValidate($pString)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(23179,32) : ERROR: __HeapAlloc(): undefined function.

$pBuffer = __HeapAlloc($Ret[5])

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPIEx.au3(29672,19) : ERROR: __MD5(): undefined function.

$Hash = __MD5($Hw)

~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Administrator\Desktop\junk\test1.au3 - 20 error(s), 0 warning(s)

This is where I am stuck.

Believe me, I am not being an asshole. I simply do not follow you.

Regards,

Mike

Link to comment
Share on other sites

Believe me, I am not being an asshole. I simply do not follow you.

Regards,

Mike

Congratulations!! You are the first person ever to break autoit!

I've never seen anyone have so much trouble with this, I think you are probably one of the mods trolling from another account.

Open WINAPIEx.au3 and run it and check if errors arise, if they do then re install the files because you might have a bad version.

Search the forum for the latest version.

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...