AutoIt

v3.3.6.1

©1999-2010 Jonathan Bennett & AutoIt Team

AutoIt v3 Homepage

AutoIt Documentation

  • Introduction
  • License
  • Installation Directory
  • Frequently Asked Questions (FAQ)
  • Credits
  • History / ChangeLog
  • History of AutoIt and Developers

Using AutoIt

  • Running Scripts
  • AutoIt on Windows Vista
  • Command Line Parameters
  • Script Editors
  • Compiling Scripts
  • AutoIt Window Info Tool (AU3Info)
  • Window Titles and Text (Basic)
  • Window Titles and Text (Advanced)
  • Controls
  • Unicode Support
  • Intended Use
  • Notes for AutoIt v2 Users
  • Running under Windows 64-bit Edition

Tutorials

  • My First Script (Hello World)
  • Simple Notepad Automation
  • WinZip Installation
  • String Regular expression

Language Reference

  • Datatypes
  • Variables
  • Macros
  • Operators
  • Conditional Statements
  • Loop Statements
  • Functions
  • Comments

GUI Reference

  • GUI Concepts
  • GUI MessageLoop Mode
  • GUI OnEvent Mode

Keyword Reference

  • Keyword Reference

Macro Reference

  • Macro Reference

Function Reference

  • Function Reference

Appendix

  • AutoIt3 limits/defaults
  • ASCII Characters
  • CLSIDs of Special Folders
  • GUI Control Styles
  • Splash... Fonts
  • @OSLang Values
  • Send Key List
  • Windows Message Codes


AutoIt

v3.3.6.1

©1999-2010 Jonathan Bennett & AutoIt Team

AutoIt v3 Homepage

Introduction

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!

AutoIt was initially designed for PC "roll out" situations to reliably automate and configure thousands of PCs. Over time it has become a powerful language that supports complex expressions, user functions, loops and everything else that veteran scripters would expect.

Features:

  • Easy to learn BASIC-like syntax
  • Simulate keystrokes and mouse movements
  • Manipulate windows and processes
  • Interact with all standard windows controls
  • Scripts can be compiled into standalone executables
  • Create Graphical User Interfaces (GUIs)
  • COM support
  • Regular expressions
  • Directly call external DLL and Windows API functions
  • Scriptable RunAs functions
  • Detailed helpfile and large community-based support forums
  • Compatible with Windows 95 / 98 / ME / NT4 / 2000 / XP / 2003 / Vista / 2008
  • Unicode and x64 support
  • Digitally signed for peace of mind
  • Works with Windows Vista's User Account Control (UAC)

AutoIt has been designed to be as small as possible and stand-alone with no external .dll files or registry entries required making it safe to use on Servers. Scripts can be compiled into stand-alone executables with Aut2Exe.

Also supplied is a combined COM and DLL version of AutoIt called AutoItX that allows you to add the unique features of AutoIt to your own favourite scripting or programming languages!

Best of all, AutoIt continues to be FREE - but if you want to support the time, money and effort spent on the project and web hosting then you may donate at the AutoIt homepage.

Features in Detail

Basic-like Syntax and Rich Function Set

AutoIt has a BASIC-like syntax which means that most people who have ever written a script or used a high-level language should be able to pick it up easily.

Although it started life as a simple automation tool, AutoIt now has functions and features that allow it to be used as a general purpose scripting language (with awesome automation as well of course!). Language features include:

  • The usual high-level elements for functions, loops and expression parsing
  • A staggering amount of string handling functions and a Perl compatible regular expression engine (using the PCRE library).
  • COM support
  • Call Win32 and third-party DLL APIs

Built-in Editor with Syntax Highlighting

AutoIt comes with a customised "lite" version of SciTe that makes editing scripts easy. Users can also download a complete version of SciTe that includes additional tools to make things even easier.

Standalone and Small

AutoIt is a very small and standalone application with no reliance on massive runtimes like .NET or VB. All you need to run AutoIt scripts are the main AutoIt executable (AutoIt3.exe) and the script. Scripts can also be encoded into standalone executables with the built-in script compiler Aut2Exe.

International and 64-bit Support

AutoIt is fully Unicode aware and also includes x64 versions of all the main components! How many other free scripting languages can you say that about?

Key and Mouse Simulation

Much time has been spent optimizing the keystroke and mouse simulation functions to be as accurate as possible on all versions of Windows. All the mouse and keyboard routines are highly configurable both in terms of simulation "speed" and functionality.

Window Management

You can expect to move, hide, show, resize, activate, close and pretty much do what you want with windows. Windows can be referenced by title, text on the window, size, position, class and even internal Win32 API handles.

Controls

Directly get information on and interact with edit boxes, check boxes, list boxes, combos, buttons, status bars without the risk of keystrokes getting lost. Even work with controls in windows that aren't active!

Graphical User Interfaces (GUIs)

AutoIt v3 will also allow you to create some complex GUIs - just like those below!

GUI Example 1 GUI Example 2

And much, much more...


License

Software License

AutoIt

Author : Jonathan Bennett and the AutoIt Team
WWW : http://www.autoitscript.com/autoit3/
Email : support at autoitscript dot com
________________________________________________________

END-USER LICENSE AGREEMENT FOR THIS SOFTWARE

This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and the mentioned author of this Software for the software product identified above, which includes computer software and may include associated media, printed materials, and "online" or electronic documentation ("SOFTWARE PRODUCT"). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, do not install or use the SOFTWARE PRODUCT.

SOFTWARE PRODUCT LICENSE

The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.

The definition of SOFTWARE PRODUCT does not includes any files generated by the SOFTWARE PRODUCT, such as compiled script files in the form of standalone executables.

1. GRANT OF LICENSE

This EULA grants you the following rights:

Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.

Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of the SOFTWARE PRODUCT either in whole or in part; each copy should include all copyright and trademark notices, and shall be accompanied by a copy of this EULA. Copies of the SOFTWARE PRODUCT may be distributed as a standalone product or included with your own product.

Commercial Use. You may use the SOFTWARE PRODUCT for commercial purposes. You may sell for profit and freely distribute scripts and/or compiled scripts that were created with the SOFTWARE PRODUCT.

Reverse engineering. You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.

2. COPYRIGHT

All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by the Author of this Software. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material.

MISCELLANEOUS

If you acquired this product in the United Kingdom, this EULA is governed by the laws of the United Kingdom. If this product was acquired outside the United Kingdom, then local law may apply.

Should you have any questions concerning this EULA, or if you desire to contact the author of this Software for any reason, please contact him/her at the email address mentioned at the top of this EULA.

LIMITED WARRANTY

1. NO WARRANTIES

The Author of this Software expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.

2. NO LIABILITY FOR DAMAGES

In no event shall the author of this Software be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if the Author of this Software has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.

[END OF LICENSE]


Install Directory Structure

The AutoIt installer creates a directory structure (usually located in \Program Files\AutoIt3) summarized in the following table. The installer also creates Start Menu shortcuts, but no other files are added or modified.

Files and Directories |  | Description
(Top-level files)
AutoIt3.exe |  | The AutoIt main program and only file required to run scripts!
AutoIt3_x64.exe |  | The x64 version of AutoIt (if installed).
AU3Info.exe |  | The AutoIt Window Info Tool.
AU3Info_x64.exe |  | The x64 version of Au3Info (if installed).
AU3Check.exe |  | The AutoIt syntax checker.
AutoIt.chm |  | This help file which use AutoIt3.chm and UDFs3.chm
Uninstall.exe |  | The AutoIt uninstaller.
AutoIt v3 Website.url |  | A shortcut to http://www.autoitscript.com/autoit3/
Aut2Exe
 | Icons\ | Contains icons used for the .au3 filetype icon in Explorer.
 | Aut2Exe.exe | The script compiler.
 | Aut2Exe_x64.exe | The x64 version of Aut2Exe (if installed).
 | AutoItSC.bin | Executable stub for compiled scripts.
 | AutoItSC_x64.bin | x64 executable stub for compiled scripts.
 | UPX.exe | The UPX compressor (shinks the size of exe files).
Examples
 | GUI\ | Contains examples of GUIs written in AutoIt.
 | Helpfile\ | Contains scripts used in many of the help file examples.
Extras
 | AutoUpdateIt\ | Contains a script for easily retrieving the latest version of AutoIt3.
 | Editors\ | Contains syntax coloring definitions for some popular text editors.
 | Exe2Aut\ | Contains utils for converting compiled scripts back in to source code.
 | SQLite\ | Contains SQLite command line executable and an help file.
 | v2_to_v3_Converter\ | Contains a tool for converting v2.64 script to AutoIt v3 syntax.
Icons
 | Contains icons used for the .au3 filetype icon in Explorer.
Include
 | Contains standard include files (pre-written user functions). See the Library Functions)
AutoItX
 | Contains a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface.
SciTe
 | Contains a light version of SciTe which allows syntax coloring.

It should be repeated that to run AutoIt scripts, the only required file is AutoIt3.exe. If you compile a script into an executable then a user does not require AutoIt to be installed to run that compiled executable.

(exception: Under Windows NT 4 the file PSAPI.dll needs to be in the path or AutoIt directory for the Process...() related functions to work)

Registry Keys

The AutoIt installer creates registry keys under HKEY_LOCAL_MACHINE\Software\AutoIt v3 and HKEY_CURRENT_USER\Software\AutoIt v3. The keys are NOT used/created when AutoIt utilities are run on machines that lack a full AutoIt installation--AutoIt is "clean" to run on servers, etc.

The table below shows the default (or typical) registry keys. The keys in italic are not created by the installer itself but by the first execution of the corresponding utility:
HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\
AutoIt
 | (Default) | REG_SZ | (value not set)
 | InstallDir | REG_SZ | C:\Program Files\AutoIt3
 | Version | REG_SZ | Version Number
HKEY_CURRENT_USER\Software\AutoIt v3\
Aut2Exe
 | (Default) | REG_SZ | (value not set)
 | AllowDecompile | REG_DWORD | 0x1
 | LastCompression | REG_DWORD | 0x2
 | LastExeDir | REG_SZ | My Documents
 | LastIcon | REG_SZ |
 | LastIconDir | REG_SZ | C:\Program Files\AutoIt3\Aut2Exe\Icons
 | LastScriptDir | REG_SZ | My Documents
AutoUpdateIt
 | (Default) | REG_SZ | (value not set)
 | DoneOption | REG_SZ | Notify
 | DownloadDir | REG_SZ | C:\Downloads\ForExample\
Exe2Aut
 | (Default) | REG_SZ | (value not set)
 | LastExeDir | REG_SZ | C:\ForExample\
 | LastScriptDir | REG_SZ |
AU3Info
 | Default | REG_SZ | (value not set)
 | AlwaysOnTop | REG_DWORD | 0x1
 | ColorMode | REG_DWORD | 0x1
 | CoordMode | REG_DWORD | 0x1
 | HighlightColor | REG_DWORD | 0x0
 | HighlightControls | REG_DWORD | 0x1
 | Magnify | REG_DWORD | 0x0
 | WinH | REG_DWORD | 0x01c2
 | WinW | REG_DWORD | 0x012c
 | WinX | REG_DWORD | 0x0064
 | WinY | REG_DWORD | 0x0064


AutoIt

Frequently Asked Questions (FAQ)

This section gives some of the more frequently asked questions from the forum. If you can't find the answer you seek here then the forum should be your first port of call.

Questions

1. Why doesn't my old AutoIt v2.64 script run in v3?

2. Isn't v3 much more difficult than previous versions?

3. How can I convert my v2.64 scripts to v3?

4. Where is the "goto" command?

5. How can I run a DOS program from within AutoIt?

6. Why can I only use Run() to execute .exe and .com files? What about .msi / .txt and others?

7. Why do I get errors when I try and use double quotes (") ?

8. What do the window "title" and "text" parameters mean?

9. Why can't I print a variable using "My var is $variable"?

10. When I use Send() to send a variable odd things happen?

11. What is the difference between the return value and @error?

12. How can I exit my script with a hot-key?

13. How can I use a custom icon when compiling my scripts?

14. How can I make sure only one copy of my script is run?

15. What are the current technical limits of AutoIt v3?

16. I get a missing picture symbol in the Help file under the Examples.

1. Why doesn't my old AutoIt v2.64 script run in v3?

v3 has a different language structure to v2.64.

Previous versions of AutoIt were fine for what they were designed for - writing simple scripts to help with software installations. Over time people began using it for general and complicated scripting tasks. The old syntax and structure made this possible but very very difficult and cumbersome. The decision was made to make AutoIt more suitable for general automation tasks and to achieve that a more standard and basic-like language was made. This also means that if you already know a scripting language you will pick AutoIt v3 up easily.

Back To Top

2. Isn't v3 much more difficult than previous versions?

No. In fact in many instances it's much easier than previous versions as you don't have to try and force the language to do something it was never designed to do. It also uses a familiar BASIC-like language, and BASIC is known for being...well...basic :)

The vast majority of old AutoIt scripts were focused around software installation and clicking "Next" a lot in dialog boxes. Most of these scripts can be converted to v3 simply by adding a couple of brackets here and there. Here is an example of such a script in v2 and v3 (simulating a software installation with a few dialogs that have a N ext button and a F inish button)

; v2.64 Script
WinWaitActive, Welcome, Welcome to the XSoft installation
Send, !n
WinWaitActive, Choose Destination, Please choose the
Send, !n
WinWaitActive, Ready to install, Click Next to install
Send, !n
WinWaitActive, Installation Complete, Click Finish to exit
Send, !f
WinWaitClose, Installation Complete

; v3 Script
WinWaitActive("Welcome", "Welcome to the XSoft installation")
Send("!n")
WinWaitActive("Choose Destination", "Please choose the")
Send("!n")
WinWaitActive("Ready to install", "Click Next to install")
Send("!n")
WinWaitActive("Installation Complete", "Click Finish to exit")
Send("!f")
WinWaitClose("Installation Complete")

Now, that wasn't so bad! :) As all "strings" are enclosed in quotes you no longer have to wrestle with problems caused by leading and trailing spaces in text. There is also fantastic support for many text editors so that when you are writing v3 scripts you can have syntax highlighting which makes everything much easier.

Back To Top

3. How can I convert my v2.64 scripts to v3?

The first thing you should ask yourself is "Do I need to convert my script?". v2.64 will continue to be downloadable and supported so don't update all your scripts just for the sake of it - well not unless you want to :)

There is a section in the Help file that shows how the commands in v2 and v3 are related - click here to see the page.

One of the AutoIt v3 authors has written a utility to automatically convert v2 scripts to v3. Conversion is pretty good unless your code is a rats-nest of gotos :) You can find the converter in the "Extras" directory (Start \ AutoIt v3 \ Extras - or look in the directory that you installed AutoIt v3).

Back To Top

4. Where is the "goto" command?

Gone. It's evil. No, you can't ask why - it just is. It's like that lump of rock they find in the microwave at the end of the film Time Bandits :)

AutoIt v3 features most of the common "loops" in use today and with these Goto is no longer required. Look up While, Do, For, ExitLoop, ContinueLoop and Functions for the modern way of doing things :) And while you are looking at help file sections check out these on loops, conditional statements and functions. I promise you, once you have got the hang of such things you will be able to script in virtually any other language within a couple of minutes.

Just to get you started, the most basic use of Goto in version 2.64 was an infinite loop like:

:mylabel
...do something...
...and something else...
goto, mylabel

A simple v3 version of that is a While loop that is always "true".

While 1 = 1
...do something...
...do something else...
Wend

Back To Top

5. How can I run a DOS program from within AutoIt?

If you wanted to run something like a DOS "Dir" command then you must run it though the command interpreter (command.com or cmd.exe depending on your OS). The @Comspec macro contains the correct location of this file. You should use the RunWait() function as it waits for the DOS program to finish before continuing with the next line of the script. Here is an example of running the DOS Dir command on the C: drive: (effectively running the command command.com /c Dir C:\ )

RunWait(@COMSPEC & " /c Dir C:\")

Back To Top

6. Why can I only use Run() to execute .exe files? What about .msi / .txt and others?

Only a few file extensions are usually "runable" - these are .exe, .bat, .com, .pif. Other file types like .txt and .msi are actually executed with another program. When you double click on a "myfile.msi" file what actually happens in the background is that "msiexec.exe myfile.msi" is executed. So to run a .msi file from AutoIt you would do:

RunWait("msiexec myfile.msi")

Or, run the command "start" which will automatically work out how to execute the file for you:

RunWait(@COMSPEC & " /c Start myfile.msi")

Or, use the ShellExecuteWait function which will automatically work out how to execute the file for you:

ShellExecuteWait("myfile.msi")

Back To Top

7. Why do I get errors when I try and use double quotes (") ?

If you want to use double-quotes inside a string then you must "double them up". So for every one quote you want you should use two. For example if you wanted to set a variable to the string: A word in "this" sentence has quotes around it! You would do:

$var = "A word in ""this"" sentence has quotes around it!"

or use single quotes instead:

$var = 'A word in "this" sentence has quotes around it!'

Back To Top

8. What do the window "title" and "text" parameters mean?

There is a detailed description here.

Back To Top

9. Why can't I print a variable using "My var is $variable"?

If you have a variable called $msg and you want to print in inside a MsgBox then this will NOT work:

MsgBox(0, "Example", "My variable is $msg")

It will actually print My variable is $msg . What you need to do is tell AutoIt to join the string and the variable together using the & operator:

MsgBox(0, "Example", "My variable is " & $msg)

Advanced: If you have many variables to add into a string then you may find the StringFormat() function useful. For example, if I wanted to insert $var1 to $var5 into a string then it may be easier to do:

$msg = StringFormat("Var1 is %s, Var2 is %s, Var3 is %s, Var4 is %s, Var5 is %s", $var1, $var2, $var3, $var4, $var5)
MsgBox(0, "Example", $msg)

Back To Top

10. When I use Send() to send a variable odd things happen?

If you are sending the contents of a variable then be mindful that if it contains special send characters like ! ^ + {SPACE} then these will be translated into special keystrokes - rarely what is wanted. To overcome this use the RAW mode of Send() that does not translate special keys:

Send($myvar, 1)

Back To Top

11. What is the difference between the return value and @error?

Generally a return value is used to indicate the success of a function. But, if a function is already returning something ( like WinGetText() ) then we need to have a way of working out if the function was successful, so we set @error instead.

Back To Top

12. How can I exit my script with a hot-key?

Ah, an easy one. If you want to make your script exit when you press a certain key combination then use the HotKeySet() function to make a user function run when the desired key is pressed. This user function should just contain the Exit keyword.

Here some code that will cause the script to exit when CTRL+ALT+x is pressed:

HotKeySet("^!x", "MyExit")
...
...
; Rest of Script
...
...
Func MyExit()
Exit
EndFunc

Back To Top

13. How can I use a custom icon when compiling my scripts?

You need to run the full compiler program (rather than just right-clicking a script and selecting compile). This page describes the compiler in detail.

Back To Top

14. How can I make sure only one copy of my script is run?

Use the _Singleton() function. See the User Defined Functions documentation for more information on _Singleton() and how to use it.

Back To Top

15. What are the current technical limits of AutoIt v3?

Here are details of the current technical limits of AutoIt. Please note that some of the limits are theoretical and you may run into performance or memory related problems before you reach the actual limit.

Maximum length of a single script line: 4,095
Maximum string length: 2,147,483,647 characters

Number range (floating point): 1.7E–308 to 1.7E+308 with 15-digit precision
Number range (integers): 64-bit signed integer
Hexadecimal numbers: 32-bit signed integer (0x80000000 to 0x7FFFFFFF)

Arrays: A maximum of 64 dimensions and/or a total of 16 million elements
Maximum depth of recursive function calls: 5100 levels

Maximum number of variables in use at one time: No limit
Maximum number of user defined functions: No limit

Maximum number of GUI windows: No limit
Maximum number of GUI controls: 65532

Back To Top

16. I get a missing picture symbol in the Help file under the Examples.

This should be the Open button that enable you to open the Examples in the Help file.
This issue is that the hhctrl.ocx isn't properly registered or corrupted.
Try registering it by doing "regsvr32 hhctrl.ocx" from the command prompt or check if the file is still valid.

Back To Top


Using AutoIt

  • Running Scripts
  • AutoIt on Windows Vista
  • Command Line Parameters
  • Script Editors
  • Compiling Scripts
  • AutoIt Window Info Tool (AU3Info)
  • Window Titles and Text (Basic)
  • Window Titles and Text (Advanced)
  • Controls
  • Unicode Support
  • Intended Use
  • Notes for AutoIt v2 Users
  • Running under Windows 64-bit Edition


Running Scripts

When you start AutoIt you will be asked to open a script file. A script file is a simple text file containing AutoIt keywords and functions that tell AutoIt what you want it to do. Script files are created in a simple text editor such as notepad.exe or a much better alternative.

Although AutoIt v3 scripts are just plain-text files they are usually given the file extension .au3 to help tell the difference between a script and a text file. If you used the full installer to install AutoIt you can execute an AutoIt script simply by double-clicking it. There are also various options to open, edit, or compile a script if you right-click on the .au3 file.

Here is an example script. Notice that ; is used for comments (much like REM in DOS batch files):

; This is my first script
MsgBox(0, "My First Script!", "Hello World!")

More complicated scripts may use functions, which are usually placed at the end of a script. Here is a similar script using functions:

; This is my second script (with functions)
MsgBox(0, "My second script!", "Hello from the main script!")
TestFunc()

Func TestFunc()
MsgBox(0, "My Second Script!", "Hello from the functions!")
EndFunc

Command Line Parameters

The special array $CmdLine is initialized with the command line parameters passed in to your AutoIt script. Note the scriptname is not classed as a parameter; get this information with @ScriptName instead. A parameter that contains spaces must be surrounded by "double quotes". Compiled scripts accept command line parameters in the same way.

$CmdLine[0] is number of parameters
$CmdLine[1] is param 1 (after the script name)
$CmdLine[2] is param 2 etc
...
$CmdLine[$CmdLine[0]] is one way to get the last parameter...

So if your script is run like this:

AutoIt3.exe myscript.au3 param1 "this is another param"

$CmdLine[0] equals... 2

$CmdLine[1] equals... param1

$CmdLine[2] equals... this is another param

@ScriptName equals... myscript.au3

In addition to $CmdLine there is a variable called $CmdLineRaw that contains the entire command line unsplit, so for the above example:

$CmdLineRaw equals... myscript.au3 param1 "this is another param"

If the script was compiled it would have been run like this:

myscript.exe param1 "this is another param"

$CmdLineRaw equals... param1 "this is another param"

Note that $CmdLineRaw just return the parameters.

Note : only 63 parameters can be return by $CmdLine[...], but $CmdLineRaw will always returns the entire command line.

AutoIt specific command Line Switches

Form1: AutoIt3.exe [/ErrorStdOut] [/AutoIt3ExecuteScript] file [params ...]
Execute an AutoIt3 Script File

/ErrorStdOut Allows to redirect fatal error to StdOut which can be captured by an application as Scite editor. This switch can be used with a compiled script.

To execute a standard AutoIt Script File 'myscript.au3', use the command:
'AutoIt3.exe myscript.au3'

Form2: Compiled.exe [/ErrorStdOut] [params ...]
Execute an compiled AutoIt3 Script File produced with Aut2Exe.

Form3: Compiled.exe [/ErrorStdOut] [/AutoIt3ExecuteScript file] [params ...]
Execute another script file from a compiled AutoIt3 Script File. Then you don't need to fileinstall another copy of AutoIT3.exe in your compiled file.

Form4: AutoIt3.exe [/ErrorStdOut] /AutoIt3ExecuteLine "command line"
Execute one line of code.

To execute a single line of code, use the command:
Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Hello World!'', ''Hi!'')"')

The tray icon will not be displayed when using /AutoIt3ExecuteLine

NOTE: Correct usage of single- and double- quotation marks is important, even double single.

Form3 and Form4 can be disabled for compiled script when using #NoAutoIt3Execute.


AutoIt on Windows Vista

Windows Vista brings new security features to restrict the running of files that require administrative rights. Even administrator users will be prompted every time an executable runs which will perform some administrative operation (such as writing to the registry key HKEY_LOCAL_MACHINE or writing to the C:\Windows directory). This is called User Account Control (UAC).

By default AutoIt scripts run with standard user permissions but AutoIt has been coded to allow the script writer the option to "tag" a script in order to tell AutoIt if it needs to run with full admin rights or not.

To force a script to attempt to run itself with administrative rights add the #requireadmin directive at the top of your script as follows:

; This script requires full Administrative rights
#requireadmin

MsgBox(0, "Info", "This script has admin rights! ")

When the script runs AutoIt will check if it already has full admin rights and if not it will cause the operating system to prompt the user for permission as shown in "UAC Prompts". If permission is not given by the user the script will terminate.

UAC Prompts

The prompts that Vista will show when launching a program with administrative rights are shown below. The type of prompt displayed will depend on if the user is a "standard user" or an "adminstrator user" (remember even administrators need to get elevated permissions to perform admin operations). Note: The prompts shown are for the digitally signed version of AutoIt - all release versions are signed but beta versions may not be and will give a warning as shown in "Compiled Scripts" below.

Standard User Prompt

A standard user must select a user name and enter a password in order to continue and run the script with elevated rights.

Administrator User Prompt

As the user is already an administrator and just requires elevation the user needs only to click on continue - no password is needed.

Compiled Scripts

Compiled scripts (and possibly beta versions of AutoIt) are not digitally signed and will give a more serious looking warning as shown:

The user must click on Allow to continue (or enter a password if they are a standard user).

If you have your own Authenticode signature you may sign your compiled scripts yourself.

Important: Whether AutoIt or a compiled script is signed or not, you should only run scripts from sources you trust!

Even signed code can be malicious!


Scripts Editors

Script Editors

AutoIt scripts are simple text files that you can edit with any text editor. However there are many free or shareware editors that are much better for writing scripts and many feature syntax highlighting so that AutoIt keywords and functions stand out making scripting much easier and less prone to mistakes.

The current editor used by the majority of AutoIt users is SciTe, the AutoIt development team has created a custom version of SciTe with full syntax highlighting that also integrates various third-party AutoIt tools (like syntax checking and script tidying). A "lite" version of the SciTE editor comes with the AutoIt installation package. The full AutoIt version of SciTe that comes with all to tools can be downloaded seperately at http://www.autoitscript.com/autoit3/scite/

Some other recommended editors are:

  • TextPad
  • Crimson Editor (free)
  • Source Edit (free)
  • UltraEdit

AutoIt comes supplied with some pre-written syntax files for many editors and they can be found in the Extra installation directory (there is a link under Start Menu / AutoIt v3 / Extra).


Compiling Scripts with Aut2Exe

It is possible to take your .au3 script and compile it into a standalone executable; this executable can be used without the need for AutoIt to be installed and without the need to have AutoIt3.exe on the machine. In addition, the compiled script is compressed and encrypted and there is the option to bind additional files (also compressed/encrypted) to the exe using the FileInstall function. Also, any #include files will also be compiled into the script so they are not required at run-time.

Caution: the script to be compiled must be free of syntax error as the compilation will not check the syntax.

Aut2Exe can be used in three ways:

Method 1 - Start Menu

Only available if full install performed.

1. Open the Start Menu and browse to the AutoIt v3 group.

2. Click Script Compiler \ Convert .au3 to .exe

3. The main Aut2Exe interface should appear.

4. Use the Browse buttons to select your input (.au3) and output (.exe) files.

5. If you like you can change the icon of the resulting .exe - just browse to the icon you want (some example icons are supplied in Program Files\AutoIt3\Aut2Exe\Icons).

6. The only other option you might wish to change is the compression level (especially if using FileInstall to add extra files). Use the Compression menu to set this. As with all compression routines the better the compression you select the slower it will be. However, no matter what compression level you select the decompression speed (when the .exe is run) is the same.

7. Click on Convert to compile the script.

Note: scripts can be compile with .a3x extension. They should be run with AutoIt.exe filename.a3x. The .a3x contains the script itself with all referred #include plus the FileInstall files. This format allow to distribute smaller files as they don't include the AutoIt3.exe in each compile script. You still need to have it accessible on the target machine but just AutoIt3.exe.

Method 2 - Right Click

Only available if full install performed.

1. In Explorer browse to the .au3 file that you wish to compile.

2. Right-click the file to access the pop-up menu.

3. The file will be silently compiled with the same filename - just with a .exe extension.

When compiling in this way, Aut2Exe uses current icon/compression settings (from the last time Aut2Exe was run manually as in method 1).

Method 3 - The Command Line

The Aut2Exe.exe program can be run from the command line as follows:

Aut2exe.exe /in <infile.au3> [/out <outfile.exe>] [/icon <iconfile.ico>] [/comp 0-4] [/nopack] [x64] [/bin <binfile.bin>]

Where

Switch | Usage | Default value
/in | <infile.au3> Specifies the path and file name of the script to be compiled. | None. The file must be specified
/out | <outfile.exe> Specifies the path and name of the compiled file. <outfile.a3x> Specifies the path and file name when creating an *.a3x file. | The input filename with a .exe extension
/icon | <iconfile.ico> Specifies the path and file name of the icon to use for the compiled file. | The AutoIt icon
/comp | Specifies the compression level to be used when encoding the script (This is NOT related to UPX). It must be a number between 0 (none) and 4 (maximum). | 2
/nopack | Specifies that the file should not be compressed with UPX after compilation. | pack
/pack | Specifies that the file should be compressed with UPX after compilation. | pack
/x64 | Specifies that the script should be compiled for use on systems with x64 (64-bit) architecture. | see notes
/x86 | Specifies that the script should be compiled for use on systems with x86 (32-bit) architecture. | see notes
/console | Specifies that the script should be compiled as a Console application. | Windows application (/gui)
/gui | Specifies that the script should be compiled as a Windows application. | Windows application (/gui)
/bin | <binfile.bin> Specifies the path and file name of the bin file to be use to compile the file. | searched in Aut2exe folder

Command Line Examples

/in c:\myscript.au3 /out c:\myapp.exe /icon c:\myicon.ico /x64

Will result in the creation of c:\myapp.exe with normal compression which will use the specified icon and be compiled for use on x64 system architecture.

/in c:\myscript.au3

will result in the creation of a unicode c:\myscript.exe with normal compression which will use the default AutoIt icon for use on win_32 systems.

Command Line Notes

Long filenames should be enclosed in double-quotes like "C:\Program Files\Test\test.au3".

With the exception of /in all switches are optional.

By default, the 32-bit compiler produces a 32-bit binary and the 64-bit compiler produces a 64-bit binary. Use the /x86 and /x64 parameters to explicitly specify the output.

The /pass and /nodecompile switches are redundant as of version 3.2.8.1. They will be ignored if used and have been removed from this list.

The /ansi and /unicode switches are redundant as of version 3.3.0.0.

Technical Details

The compiled script and additional files added with FileInstall are compressed with my own (Jon) compression scheme.


AutoIt Window Info Tool

AutoIt Window Information Tool

AutoIt v3 comes with a standalone tool called the AutoIt Window Info Tool (Program Files\AutoIt3\AU3Info.exe). AU3Info allows you to get information from a specified window that can be used to effectively automate it. Information that can be obtained includes:

  • Window titles
  • Text on the window (visible and hidden)
  • Window size and position
  • Contents of the status bar
  • Position of the mouse pointer
  • Colour of the pixels underneath the mouse pointer
  • Details of the Control underneath the mouse pointer

To use AU3Info just run it (from the command line or Start menu). AU3Info will remain the top most window at all times so that you can read it. Once active move to the window you are interested in and activate it - the contents of AU3Info will change to show the information that is available. With the help of AU3Info you should be automating in no time!

When AU3Info is running you may want to copy text directly from it using CTRL-C and then paste it into your script to avoid spelling/case errors. For the tabs that have information in a list view (like the control information shown below) just double-click on an entry to copy it to the clipboard. This can be difficult when you want to capture pixel/mouse information as it keeps changing! To help with this you can "freeze" the output of AU3Info by pressing CTRL-ALT-F. Press the keys again to "unfreeze".

Here is an example of AU3Info in use with the Windows "WordPad" editor:


Window Titles and Text (Basic)

When automating, most windows can be uniquely identified by their title or a combination of their title & text. And by using AutoIt Window Info Tool (or even by sight) this information is easy to obtain. The titles of most windows are fairly obvious, for example Untitled - Notepad is the title of the notepad.exe editor and in many cases this is enough to automate.

Note: If a blank string "" is given for both title and text then the currently Active window will be used (this is not true in some of the more advanced WinTitleMatchModes)!

Window titles and text are case sensitive. You must match the case and punctuation exactly. To avoid problems select the title/text in the Window Info Tool and use ctrl-c to copy it and then paste it directly into your script.
You can force match in lower case using advanced modes.

Most of AutoIt's window functions have space for a title and text entry, here is the WinWaitActive function. This function pauses execution of the script until the specified window appears and is active.

WinWaitActive ( "title", ["text"], [timeout] )

title is the only required parameter for this function, both the text and timeout are optional. In some functions the text parameter is not optional, if you do not wish to specify any text then just use "" (a blank string). A blank string, or nothing at all, in the text tells AutoIt that any text is valid.

To use the above function with any notepad window both these methods will work:

WinWaitActive("Untitled - Notepad")

and

WinWaitActive("Untitled - Notepad", "")

If the same notepad window had "This is a line of text" typed into the window, the Window Info Tool would show:

Note that the Window Info Tool has seen the title and text of the notepad window. Whatever the Window Info Tool can see is what AutoIt can see. Now we have enough information to identify this exact window even if there are lots of other notepad windows open. In this case we use:

WinWaitActive("Untitled - Notepad", "This is some text!")

Window Text

The window text consists of all the text that AutoIt can "see". This will usually be things like the contents of edit controls (as above with "This is a line of text") but will also include other text like:

  • Button text like &Yes, &No, &Next (the & indicates an underlined letter)
  • Dialog text like "Are you sure you wish to continue?"
  • Control text
  • Misc text - sometimes you don't know what it is :)

The important thing is that you can use the text along with the title to uniquely identify a window to work with.

When you specify the text parameter in a window function it is treated as a substring. So for the example above if you used the text "is some " you would get a match.

What has been described is the default mode that AutoIt operates in, there are a number of more advanced modes to use when things are not as simple as this.

Note: Hidden window can be matched by "title" only if "text" is empty ("").


Window Titles and Text (Advanced)

AutoIt operates in one of three "Window matching" modes. The modes are set with the AutoItSetOption function using the WinTitleMatchMode option.

Mode 1 (default)

Matches partial titles from the start.

In this mode the a window titled Untitled - Notepad would be matched by "Untitled - Notepad", "Untitled", "Un", etc.

e.g.

WinWait("Untitled")

Mode 2

Matches any substring in the title.

In this mode a window titled Untitled - Notepad would be matched by "Untitled - Notepad", "Untitled", "Notepad", "pad", etc.

e.g.

WinWait("Notepad")

Mode 3

Exact title match.

In this mode a window titled Untitled - Notepad would only be matched by "Untitled - Notepad"

Mode 4 (Kept for backward compatibility)

Advanced mode

Must be replaced with Advanced Window Descriptions which does not need any mode to be set.

Mode -1 to -3

Force lower case match according to other type of match.

Advanced Window Descriptions

A special description can be used as the window title parameter. This description can be used to identify a window by the following properties:

  • TITLE - Window title
  • CLASS - The internal window classname
  • REGEXPTITLE - Window title using a regular expression (if the regular expression is wrong @error will be set to 2)
  • REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2)
  • LAST - Last window used in a previous AutoIt command
  • ACTIVE - Currently active window
  • X \ Y \ W \ H - The position and size of a window
  • INSTANCE - The 1-based instance when all given properties match

One or more properties are used in the title parameter of a window command in the format:

[PROPERTY1:Value1; PROPERTY2:Value2]

Note : if a Value must contain a ";" it must be doubled.

e.g. Wait a window of classname "Notepad"

WinWaitActive("[CLASS:Notepad]", "")

e.g. Close the currently active window

WinClose("[ACTIVE]", "")

e.g. Wait for the 2nd instance of a window with title "My Window" and classname "My Class"

WinWaitActive("[TITLE:My Window; CLASS:My Class; INSTANCE:2]", "")

e.g. List windows matching a classname defined by a regular expression

WinList("[REGEXPCLASS:#\d+]")

Window Handles / HWNDs

The variant datatype in AutoIt natively supports window handles (HWNDs). A window handle is a special value that windows assigns to a window each time it is created. When you have a handle you may use it in place of the title parameter in any of the function calls that use the title/text convention. The advantage of using window handles is that if you have multiple copies of an application open - which have the same title/text - you can uniquely identify them when using handles. When you use a window handle for the title parameter then the text parameter is completely ignored.

Various functions such as WinGetHandle, WinList and GUICreate return these handles. It is important to note that a window handle is not classed as a number or string - it is its own special type.

Note: Window handles will work no matter what WinTitleMatchMode is currently in use.

Example

$handle = WinGetHandle("Untitled - Notepad", "")
WinClose($handle)


Controls

One of the best new features with AutoIt v3 is the ability to work directly with certain types of Window Controls. Almost everything you see on a window is a control of some kind: buttons, listboxes, edit fields, static text are all controls. In fact Notepad is just one big "Edit" control! Because AutoIt works directly with a control they provide a more reliable way to automate than just sending keystrokes.

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

Using the AutoIt Window Info Tool you can move your mouse around the window you are interested in and you will be given information of the control that is currently under your mouse.

A special description can be used as the controlID parameter used in most of the Control...() functions . This description can be used to identify a control by the following properties:

  • ID - The internal control ID. The Control ID is the internal numeric identifier that windows gives to each control. It is generally the best method of identifying controls. In addition to the AutoIt Window Info Tool, other applications such as screenreaders for the blind and Microsoft tools/APIs may allow you to get this Control ID
  • TEXT - The text on a control, for example "&Next" on a button
  • CLASS - The internal control classname such as "Edit" or "Button"
  • CLASSNN - The ClassnameNN value as used in previous versions of AutoIt, such as "Edit1"
  • NAME - The internal .NET Framework WinForms name (if available)
  • REGEXPCLASS - Control classname using a regular expression
  • X \ Y \ W \ H - The position and size of a control.
  • INSTANCE - The 1-based instance when all given properties match.

One or more properties are used in the controlID parameter of a control command in the format:

[PROPERTY1:Value1; PROPERTY2:Value2]

Note: If this special format is not used then the parameter is taken to be a control ID (if numeric) or the ClassnameNN/text of the control (if a string). Although the special format is more longwinded than these methods it is much less ambiguous.

If a Value must contain a ";" it must be doubled.

e.g. Send text to the 1st Edit control in the Notepad window

ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", "This is some text")

or

ControlSend("Untitled - Notepad", "", "[CLASSNN:Edit1]", "This is some text")

or

ControlSend("Untitled - Notepad", "", "Edit1", "This is some text")

e.g. Click on control ID 254 in "My Window"

ControlClick("My Window", "", "[ID:254]")

or

ControlClick("My Window", "", 254)

e.g. Set the text of the .NET Winforms "textBoxFolder" control to "C:\Some\Folder"

ControlSetText("My Window", "", "[NAME:textBoxFolder]", "C:\Some\Folder")

e.g. Click the 2nd instance of a "Button" control containing the text "Finish"

ControlClick("My Window", "", "[CLASS:Button; TEXT:Finish; INSTANCE:2]")

Control Handle (HWND)

Using the ControlGetHandle function you can determine the Handle or HWND of a control. A handle is the unique identifier that Windows gives controls. The handle changes each time the control is created. This method of accessing controls is generally only designed for users who are familiar with working with handles.

Look under the contents for Function Reference \ Window Management \ Controls for a list of the functions that work with controls.


Unicode Support

From version 3.2.4.0 AutoIt is supplied as a Unicode program. The Unicode versions will allow our international friends to finally use AutoIt with extended characters and scripts!

Note: the Unicode version of AutoIt (AutoIt3.exe) and scripts compiled in Unicode mode will only run on Windows NT/2000/XP/2003/Vista and later machines. To allow scripts to run on Windows 9x scripts you must use an older version of AutoIt. The last version compatible with Windows 9x was 3.2.12.x.

AutoIt will read script files in ANSI or UTF16 (big or little endian) / UTF8 formats with a valid BOM. In addition, functions such as FileReadLine will automatically read text from ANSI and UTF16/UTF8 text files providing a valid BOM is found. UTF8 files with or without a BOM are also supported.

Output functions such as FileWriteLine can use ANSI, UTF16 and UTF8 formats - but the file must be opened in the desired mode using the desired FileOpen flags otherwise the default ANSI mode is used.

The supported file formats for text files and scripts and their notation in popular editors are shown in this table:

AutoIt Notation | Notepad | Notepad++ | SciTe (AutoIt Default Editor)
ANSI | ANSI | ANSI | 8 bit / Code Page Property
UTF16 Little Endian | Unicode | UCS-2 Little Endian | UCS-2 Little Endian
UTF16 Big Endian | Unicode big endian | UCS-2 Big Endian | UCS-2 Big Endian
UTF8 with BOM | UTF-8 | UTF-8 | UTF-8 with BOM
UTF8 without BOM | Not supported | UTF-8 without BOM | UTF-8

The recommended script format is UTF-8. ANSI formats are not recommended for languages other than English as they can cause problems when run on machines with different locales.

Current Limitations

There are a few parts of AutoIt that don't yet have full Unicode support. These are:

  • Send and ControlSend - Instead, Use ControlSetText or the Clipboard functions.
  • Console operations are converted to ANSI.

These limits will be addressed in future versions if possible.


Intended Use

AutoIt is a 'growing' scripting language. It started as an add-on tool to automate basic tasks in GUI's of other programs.
These tasks (like sending a keystroke or clicking a button) are still the core components of an AutoIt script. However with the recent GUI additions, you can now incorporate your own graphical interface using native AutoIt script commands.
The new COM (Object) functionality fills the gap with WSH languages, such as VBScript/JScript.

With this combination of GUI Automation, GUI Interfaces and COM support, AutoIt offers you a powerful scripting tool that is able to compete with fully-fledged scripting languages like WSH or KiXStart).


Help for AutoIt v2 users

Notes for users familiar with AutoIt 2.64

Apart from the concept of windows and keystrokes, AutoIt v3 is quite different to v2.64 and previous versions of AutoIt. v2.64 will continue to be available for download and there are few reasons why users should try and convert existing scripts (if it ain't broke, etc.). However v3 has lots of great new features to make GUI automation easier than ever before, as well as being a much better general purpose scripting language.

When start to use v3 the following should help to make things a little easier. There is also a v2.64 to v3 script converter available in the "Extra" directory which is located in the installation directory.

- Backslashes are no longer a special character. However, quotation marks are a new issue....
For example, Run('C:\Windows\Notepad.exe "C:\Some File.txt" ')

- Command-Line Syntax:
There is only script mode, i.e., AutoIt.exe <filename of script file>

- Conventions:
<cmd>, <parameter1> [,<parameter2>] has been replaced with Cmd(parm1 [,parm2])

- Goto does not exist due to the support of loops and user-defined functions.

- AutoItv3 supports variables like most programming languages: $myVar = "Example of assignment"

- Scripts have the extension .au3 instead of .aut

If you wish to re-write version 2.64 scripts as version 3, the following table may help you:

Version 2.64 function | Version 3 equivalent
AdlibOn | AdlibRegister
BlockInput | BlockInput
Break | Break
DetectHiddenText | AutoItSetOption("WinDetectHiddenText",...)
Exit | Exit
EnvAdd | [see + operator]
EnvDiv | [see / operator]
EnvMult | [see * operator]
EnvSub | [see - operator]
FileAppend | [FileOpen(...,2) followed by FileWriteLine]
FileCopy | FileCopy
FileCreateDir | DirCreate
FileDelete | FileDelete or FileRecycle
FileInstall | FileInstall
FileReadLine | FileReadLine
FileRemoveDir | DirRemove
FileSelectFile | FileOpenDialog or FileSaveDialog
Gosub | [see Func...EndFunc]
Return | [see Func...EndFunc]
Goto | [not needed]
HideAutoItDebug | --
HideAutoItWin | AutoItSetOption("TrayIconHide",...)
IfInString | If StringInStr(...) Then
IfNotInString | If Not StringInStr(...) Then
IfWinExist | If WinExists(...) Then
IfWinNotExist | If Not WinExists(...) Then
IfWinActive | If WinActive(...) Then
IfWinNotActive | If Not WinActive(...) Then
IfEqual | [see = and == operators]
IfNotEqual | [see <> operator]
IfGreater | [see > operator]
IfGreaterOrEqual | [see >= operator]
IfLess | [see < operator]
IfLessOrEqual | [see <= operator]
IfExist | FileExists
IfNotExist | If Not FileExists(...) Then
IfMsgBox | [see MsgBox(...) and Select...Case...EndSelect]
IniRead | IniRead
IniWrite | IniWrite
IniDelete | IniDelete
InputBox | InputBox
LeftClick | MouseClick("left",...)
RightClick | MouseClick("right",...)
LeftClickDrag | MouseClickDrag("left",...)
RightClickDrag | MouseClickDrag("right",...)
MouseGetPos | MouseGetPos
MouseMove | MouseMove
MsgBox | MsgBox
Random | Random
RegRead | RegRead
RegWrite | RegWrite
RegDelete | RegDelete
Repeat | [see For...Next]
EndRepeat | [see For...Next]
Run | Run
RunWait | RunWait
Send | Send
SetCapslockState | AutoItSetOption("SendCapslockMode",0) + Send ("{CAPSLOCK}")
SetEnv | EnvSet
SetBatchLines | --
SetKeyDelay | AutoItSetOption("SendKeyDelay",...)
SetStoreCapslockMode | AutoItSetOption("SendCapslockMode",...)
SetTitleMatchMode | AutoItSetOption("WinTitleMatchMode",...)
SetWinDelay | AutoItSetOption("WinWaitDelay",...)
Shutdown | Shutdown
Sleep | Sleep
SplashTextOn | SplashTextOn and others
SplashTextOff | SplashOff
StringCaseSense | [see individual functions]
StringLeft | StringLeft
StringRight | StringRight
StringMid | StringMid
StringLen | StringLen
StringReplace | StringReplace
StringTrimLeft | StringTrimLeft
StringTrimRight | StringTrimRight
StringGetPos | StringInStr
WinGetActiveStats | [see WinGetPos, WinGetTitle, WinGetText]
WinGetActiveTitle | WinGetTitle("")
WinKill | WinKill
WinWait | WinWait
WinWaitClose | WinWaitClose
WinWaitActive | WinWaitActive
WinWaitNotActive | WinWaitNotActive
WinHide | WinSetState(..., @SW_HIDE)
WinShow | WinSetState(..., @SW_SHOW)
WinRestore | WinSetState(...,@SW_RESTORE)
WinMinimize | WinSetState(...,@SW_MINIMIZE)
WinMaximize | WinSetState(...,@SW_MAXIMIZE)
WinActivate | WinActivate
WinClose | WinClose
WinMove | WinMove
WinSetTitle | WinSetTitle
WinMinimizeAll | WinMinimizeAll
WinMinimizeAllUndo | WinMinimizeAllUndo
#Include | #Include
%CLIPBOARD% | [see ClipGet and ClipPut]
A_OSTYPE | @OSType
A_OSVERSION | @OSVersion
A_SCRIPTNAME | @ScriptName
A_SCRIPTDIR | @ScriptDir
A_SCRIPTFULLPATH | @ScriptFullPath
A_WORKINGDIR | @WorkingDir
A_NUMBATCHLINES | --
A_SEC | @SEC
A_MIN | @MIN
A_HOUR | @HOUR
A_MDAY | @MDAY
A_MON | @MON
A_YEAR | @YEAR
A_WDAY | @WDAY
A_YDAY | @YDAY


Running under Windows 64-bit Edition

AutoIt has traditionally been a 32-bit application. With the 3.2.10.0 release native x64 versions of some components have been added, including:

  • AutoIt (AutoIt3_x64.exe)
  • Aut2Exe (Aut2Exe_x64.exe)
  • Au3Info (Au3Info_x64.exe)
  • AutoItX (AutoItX3_x64.dll)

During installation, if found to be running on x64 you will be given the choice to install and configure the x64 versions. These versions are fully x64 compatible, however, some scripts that use DllCall/DllStruct with custom structures may use values that break 64-bit compatibility (such as using 32-bit integers for pointers). This includes some of the UDFs supplied with AutoIt as they have not all been tested under x64.

You can run the x86 version of AutoIt by right-clicking a script and selecting "Run Script (x86)".

If you suspect that a script is not working correctly under x64 but it works under x86 then please report a bug.

To see if you are running under a 64-Bit Edition of Windows use @OSArch macro. To see if you are using the 32 or 64-bit version of AutoIt use @AutoItX64.

Running the 32-bit version of AutoIt on a x64 System

For Files, Windows has a special redirection mechanism for some system directories :

Directories | 32-bit Value | 64-Bit Value
@SystemDir | @WindowsDir & "\SYSWOW64" | @WindowsDir & "\System32"
@ProgramFilesDir | {SystemDrive} & "\Program Files (x86)" | {SystemDrive} & "\Program Files"

It is possible to access the 64-bit version of those directories by disabling the redirection mechanism.

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

Some more information can be found at MSDN.

For registry, use HKCR64 or HKLM64 to bypass the redirection mechanism see Registry Functions documentation.


Tutorials

  • My First Script (Hello World)
  • Simple Notepad Automation
  • WinZip Installation
  • String Regular expression


Tutorial - HelloWorld

This tutorial explains the basics of creating an AutoIt script and running it. The tutorial assumes that you have already fully installed AutoIt v3 using the supplied installer.

First open a folder where you wish to create the script. Right-click in the folder and select New / AutoIt v3 Script.

A new file will be created, immediately allowing you to rename it to something more appropriate. Change 'New AutoIt v3 Script' to 'helloworld', leaving the '.au3' in the name intact if it is visible.

Now we have created the script file we want to edit it to make it do something useful. Right-click on helloworld.au3 and select Edit Script.

The SciTE editor will open and you will see something like this:

The code you see is simply some comments that you can use to organise your scripts. The lines that start with a semi-colon ; and are treated as comments (ignored). ; is similar to the REM statement in a DOS batch file.

Now we want to tell AutoIt to display a message box - this is done with the MsgBox function.

At the bottom of the file type the following:

MsgBox(0, "Tutorial", "Hello World!")

All functions take parameters, MsgBox takes three - a flag, a title and a message. The flag is a number that changes the way MsgBox displays - we will use 0 for now. The title and message are both string parameters - when using strings in AutoIt surround the text in double or single quotes. "This is some text" or 'This is some text' - both will work fine.

Now save the script and close the editor. You've just written your very first AutoIt script! To run the script simply double-click the helloworld.au3 file (you may also right-click the file and select Run Script) .

You should see this:

Now, let's look at the flag parameter for the MsgBox function again. From the manual page we can see various values listed which change the way MsgBox displays. The value of 0 simply shows a simple message box with an OK button. A value of 64 displays the message box with an information icon.

Edit the script again and change the 0 to 64 so you have:

MsgBox(64, "Tutorial", "Hello World!")

Run the script and you will see:

Experiment with the various flag values to see what kind of results you can get. Remember, if you want to use more than one flag value then simply add the required values together.


Tutorial - Notepad

This tutorial explains how to automate the opening of Notepad, automatically type some text and then close Notepad. It is assumed that you are already familiar with creating and running AutoIt scripts as shown in the HelloWorld tutorial.

First create an empty script called npad.au3 and then edit the file (using Notepad or SciTe as you prefer).

The first thing we need to know is the name of the Notepad executable. It is notepad.exe - you can get this information by looking at the properties of the Notepad shortcut icon in the Start Menu. To execute Notepad we use the AutoIt Run function. This function simply launches a given executable and then continues.

Type in the first line of script as:

Run("notepad.exe")

Run the script - if all goes well then a new instance of Notepad should open.

When automating applications AutoIt can check for window title so that it knows which window it should work with. With Notepad the window title is obviously Untitled - Notepad. AutoIt is case-sensitive when using window titles so you must get the title exactly right - the best way to do this is to use the AutoIt Window Information Tool. Run the Information Tool from Start Menu \ AutoIt v3 \ AutoIt Window Info.

With the Info Tool open click on the newly opened Notepad window to activate it; the Info Tool will give you information about it. The information we are interested in is the window title.

Highlight the title in the AutoIt Info Tool window and press CTRL-C to copy it to the clipboard - we can then paste the title into our script without fear of misspelling it.

After Running a copy of Notepad we need to wait for it to appear and become active before we send any keystrokes. We can wait for a window using the WinWaitActive function. Most window-related functions in AutoIt take a window title as a parameter.

Enter the following as the second line in the script (use CTRL-V or Edit\Paste to paste our window title from the clipboard).

WinWaitActive("Untitled - Notepad")

After we are sure the Notepad window is visible we want to type in some text. This is done with the Send function.

Add this line to our script.

Send("This is some text.")

The entire script will now look like this:

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("This is some text.")

Close the copy of Notepad that we previously opened (you will need to do this every time you run the script otherwise you will end up with lots of copies running!). Run the script.

You should see Notepad open, and then some text will magically appear!

Next we want to close notepad, we can do this with the WinClose function.

WinClose("Untitled - Notepad")

When Notepad tries to close you will get a message asking you to save the changes. Use the Window Info Tool to get details of the dialog that has popped up so that we can respond to it :)

So, we add a line to wait for this dialog to become active (we will also use the window text to make the function more reliable and to distinguish this new window from the original Notepad window):

WinWaitActive("Notepad", "Do you want to save")

Next we want to automatically press Alt-N to select the No/Don't save button (Underlined letters in windows usually indicate that you can use the ALT key and that letter as a keyboard shortcut). In the Send function to send an ALT key we use ! .

Send("!n")

Our complete script now looks like this:

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("This is some text.")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "Do you want to save")
Send("!n")

Run the script and you will see Notepad open, some text appear, then close! You should be able to use the techniques learned in this tutorial to automate many other applications.


Tutorial - WinZip

This tutorial explains how to automate the installation of WinZip 9 SR-1. It is assumed that you are already familiar with creating and running AutoIt scripts and the use of the AutoIt Window Information Tool to read window titles and text, as shown in the HelloWorld and Notepad tutorials.

The WinZip installation consists of approximately 10 dialog boxes that you must click buttons (usually Next) to continue. We are going to write a script that simply waits for these dialog boxes to appear and then clicks the appropriate buttons. As usual with these types of installations the window title of each dialog is the same (WinZip Setup) so we must use window text to tell the difference between windows. Screenshots of each dialog will be provided and you can click on the picture to see the Information Tool output for that dialog.

First create a directory that we will use for the WinZip installer and our script file. Copy the WinZip installer to this directory and create a blank script called winzipinstall.au3.

We will now run through the installation manually and write the script as we go. The script lines to automate each dialog will be shown after each picture (remember to click on the picture to see the AutoIt Window Information Tool output). You can also look at the completed script for reference.

The first script line is easy, we want to run the winzip90.exe installer. So the first line is:

Run("winzip90.exe")

The first dialog will pop-up:

We need to wait for this window to popup and become active, and then we need to send the keystroke ALT-s to click the Setup button. The resulting script lines are:

WinWaitActive("WinZip® 9.0 SR-1 Setup", "&Setup")
Send("!s")

(Remember to click on the picture to see the AutoIt Window Information Tool output, this is especially important as the title contains the special (R) character which would be difficult to type).

The installation location dialog will appear next:

We need to wait for this screen to be active and then click ENTER to accept the install location. The script lines are:

WinWaitActive("WinZip Setup", "into the following folder")
Send("{ENTER}")

The WinZip Features dialog will appear next:

Notice that this window has exactly the same title as the first of WinZip Setup - in fact all the dialogs in the setup have this title! In order to tell the difference between these windows we must also use the window text - on each screen try to pick the most unique text you can. In this case I've chosen WinZip features include. After the window has appeared we will want to press ALT-n:

WinWaitActive("WinZip Setup", "WinZip features include")
Send("!n")

The License dialog will appear next:

Wait for the window to appear and then press ALT-y to accept the agreement:

WinWaitActive("License Agreement")
Send("!y")

Setup continues in a similar fashion for a few dialogs. The picture of each dialog is shown along with the script lines needed to automate it.

WinWaitActive("WinZip Setup", "Quick Start Guide")
Send("!n")

WinWaitActive("WinZip Setup", "switch between the two interfaces")
Send("!c")
Send("!n")

WinWaitActive("WinZip Setup", "&Express setup (recommended)")
Send("!e")
Send("!n")

WinWaitActive("WinZip Setup", "WinZip needs to associate itself with your archives")
Send("!n")

This is the final dialog of the setup. Notice that the Finish button doesn't have a keyboard shortcut - luckily it is the default button on this dialog so we can just press ENTER to select it. If this were not the case then we would have to TAB between controls or better yet use the ControlClick function.

WinWaitActive("WinZip Setup", "Thank you for installing this evaluation version")
Send("{ENTER}")

After installation WinZip will automatically start:

We simply wait for the main WinZip window to appear and then close it with the WinClose function.

WinWaitActive("WinZip (Evaluation Version)")
WinClose("WinZip (Evaluation Version)")

Here is the completed script - note that I have commented each dialog separately which makes it easier to follow and to change in the future (the next version of WinZip may be slightly different).

And that's it! Run the winzipinstaller.au3 script and watch as WinZip is installed in just a few seconds! The techniques used in this tutorial can be used to automate the installation of most programs.

As an exercise for the reader, try and redo the script but instead of using the Send function (which sends keys to the active window) to click on buttons try and use ControlClick instead which can be much more reliable. You will need to read up on Controls to do this.


Tutorial - Regular Expression

Here's a smallish guide on unravelling the seeming mysteries of StringRegExp().

StringRegExp( "test", "pattern" [, flag ] )

"test" = The string to search through for matches.
"pattern" = A string consisting of certain key characters that let the function know PRECISELY what you want to match. No ifs, ands, or buts.. it's a match or it isn't.
flag[optional] = Tells the function if you just want to know if the "pattern" is found, or if you want it to return the first match, or if you want it to return all the matches in the "test" string.

The Very Basics

As you may have figured out, the "pattern" string is the only difficult part of calling a StringRegExp() (forthwith: SRE). I find it best to think of patterns as telling the function to match a string character by character. There are different ways to find a certain character: If you want to match the string "test", that should be simple enough. You want to tell SRE to first search the string for a "t". If it finds one, then it assumes it has a match, and the rest of the pattern is used to try to prove that what it's found is not a match. So, if the next character is an "e", it could still be a match. Let's say the next letter is an "x". SRE knows immediately that it hasn't found a match because the third character you tell it to look for is an "s".

Example 1

MsgBox(0, "SRE Example 1 Result", StringRegExp("text", 'test'))

In this example, the message box should read "0", which means the pattern "test" was not found in the test string "text". I know this seems pretty simple, but now you know why it wasn't found.

The next way of specifying a pattern is by using a set ("[ ... ]"). You can equate a set to the logic function "OR". Let's use the previous Example. We want to find either the string "test" or the string "text". So, the way I start looking for a pattern is to think like SRE would think: The first character I want to match is "t", then the letter "e", this is the same for both strings we want to match. Now we want to match "s" OR "x", so we can use a set as a substitute: "[sx]" means match an "s" or an "x". Then the last letter is a "t" again.

Example 2

MsgBox(0, "SRE Example 2 Result", StringRegExp("text", 'te[sx]t'))
MsgBox(0, "SRE Example 2 Result", StringRegExp("test", 'te[sx]t'))

These should both provide the result "1", because the pattern should match both "test" and "text".

You can also specify how many times to match each character by using "{number of matches}" or you can specify a range by using "{min, max}". The first example below is redundant, but shows what I mean:

Example 3

MsgBox(0, "SRE Example 3 Result", StringRegExp("text", 't{1}e{1}[sx]{1}t{1}'))
MsgBox(0, "SRE Example 3 Result", StringRegExp("aaaabbbbcccc", 'b{4}'))

The Not-So Basics

Right now you're probably thinking "Isn't this just a glorified StringInStr() function?". Well, using a "flag" value of 0, most of the time you're right. But SRE is much more powerful than that. As you use SRE's more and more, you'll find you might know less and less about the type of pattern you are looking for. There are ways to be less and less specific about each character you wish to specify in the pattern. Take, for example, a line from the chat log of a game: "Gnarly Monster hits you for 18 damage." You want to find out how much damage Gnarly Monster hit you for. Well, you can't use StringInStr() because you aren't looking for "18", you're looking for "????", where ? could be any digit.

Here's how I would assemble this pattern. Look at what you do and do not know about what you want to find:
1) You know that it will ALWAYS contain nothing but digits.
2) You know that it will SOMETIMES be 2 characters long.
2a) You know from playing the game that the maximum damage a monster can do is 999.
2b) You know that the minimum damage a monster can do is 0.
3) You know that it will ALWAYS be between 1 and 3 characters long.
4) You know that there are no other digits in the test string.

At this point, I'd like to introduce the FLAG value of "1" and the grouping characters "()". The flag value of "1" means that SRE will not only match your pattern, but also return an array, with each element of the array consisting of a captured "group" of characters. So without veering off course too much, take this example:

Example 4

$asResult = StringRegExp("This is a test example", '(test)', 1)
If @error == 0 Then
MsgBox(0, "SRE Example 4 Result", $asResult[0])
EndIf
$asResult = StringRegExp("This is a test example", '(te)(st)', 1)
If @error == 0 Then
MsgBox(0, "SRE Example 4 Result", $asResult[0] & "," & $asResult[1])
EndIf

So, first the pattern must match somewhere in the test string. If it does, then SRE is told to "capture" any groups ("()") and store them in the return array. You can use multiple captures, as demonstrated by the second piece of code in Example 4.

Ok, back to the Gnarly Monster. Now that we know how to "capture" text, let's construct our pattern: Since you know what you're looking for is digits, there are 3 ways to specify "match any digit": "[:digit:]", "[0-9]", and "\d". The first is probably the easiest to understand. There are a few classes (digit, alnum, space, etc. Check the helpfile for a full list) you can use to specify sets of characters, one of them being digit. "[0-9]" just specifies a range of all the digits 0 through 9. "\d" is just a special character that means the same as the first two. There is no difference between the three, and with all SRE's there are usually at least a couple ways to construct any pattern.

So, first we know we want to capture the digits, so indicate that with the opening parentheses "(". Next, we know we want to capture between 1 and 3 characters, all consisting of digits, so our pattern now looks like "([0-9]{1,3}". And finally close it off with the closing parentheses to indicate the end of our group: "([0-9]{1,3})". Let's try it:

Example 5

$asResult = StringRegExp("Gnarly Monster hits you for 18 damage.", _
'([0-9]{1,3})', 1)
If @error == 0 Then
MsgBox(0, "SRE Example 5 Result", $asResult[0])
EndIf

There you go, the message box correctly displays "18".

Next we need to cover non-capturing groups. The way you indicate these groups is by opening the group with "(?:" instead of just "(". Let's say your log says "You deflect 36 of Gnarly Monster's 279 damage." Now if you run Example 5's SRE on this, you'll come up with "36" instead of "279". Now what I like to do here is just determine what's different between the numbers. One that jumps out at me is that the second number is always followed by a space and then the word "damage". We could just modify our previous pattern to be "([0-9]{1,3} damage)", but what if our script is just looking for the amount of damage, without " damage" tacked onto the end of the number? Here's where you can use a non-capturing group to accomplish this.

Example 6

$asResult = StringRegExp("You deflect 36 of Gnarly Monster's 279 damage.", '([0-9]{1,3})(?: damage)', 1)
If @error == 0 Then
MsgBox(0, "SRE Example 6 Result", $asResult[0])
EndIf

This could get lengthy, but mostly I just wanted to lay out the foundation for how regular expressions work, and mainly how SRE "thinks". A few things to keep in mind:
- Remember to think about the pattern one character at a time
- The StringRegExp() function finds the first character in the pattern, then it's your job to provide enough
evidence to "prove" whether or not it truly is a match. Example 6 is a good display of this.
- Remember [ ... ] means OR ([xyz] match an "x", a "y", OR a "z")
If you have any other questions, consult the help file first! It explains in detail all of the nitty gritty syntax that comes along with SRE's. One thing to look at in particular is the section on "Repeating Characters". It can make your pattern more readible by substituting certain characters for ranges. For example: "*" is equivalent to {0,} or the range from 0 to any number of characters.

Good luck, Regular Expressions can greatly decrease the length of your code, and make it easier to modify later. Corrections and feedback are welcome!

Resources

Wikipedia Article - Regular Expressions - Thanks blindwig.

The 30 Minute Regex Tutorial - by Jim Hollenhorst.

GUI for testing various StringRegExp() patterns - Thanks steve8tch. Credit: w0uter

Thanks to neogia for this tutorial.


Language Reference

The basics of the AutoIt language:

  • Datatypes
  • Variables
  • Macros
  • Operators
  • Conditional Statements
  • Loop Statements
  • Obj Statements
  • User Functions
  • Comments


Language Reference - Datatypes

In AutoIt there is only one datatype called a Variant. A variant can contain numeric or string data and decides how to use the data depending on the situation it is being used in. For example, if you try and multiply two variants they will be treated as numbers, if you try and concatenate (join) two variants they will be treated as strings.

Some examples:

10 * 20 equals the number 200 (* is used to multiply two numbers)

10 * "20" equals the number 200

"10" * "20" equals the number 200

10 & 20 equals the string "1020" (& is used to join strings)

If a string is used as a number, an implicit call to Number() function is done. So if it doesn't contain a valid number, it will be assumed to equal 0. For example,

10 * "fgh" equals the number 0.

If a string is used as a boolean and it is an empty string "" , it will be assumed to equal False (see below). For example,

NOT "" equals the Boolean true.

Numbers

Numbers can be standard decimal numbers like 2, 4.566, and -7.

Scientific notation is also supported; therefore, you could write 1.5e3 instead of 1500.

Integers (whole numbers) can also be represented in hexadecimal notation by preceding the integer with 0x as in 0x409 or 0x4fff (when using hex notation only 32-bit numbers are valid).

Strings

Strings are enclosed in double-quotes like "this". If you want a string to actually contain a double-quote use it twice like:

"here is a ""double-quote"" - ok?"

You can also use single-quotes like 'this' and 'here is a ' 'single-quote' ' - ok?'

You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them:

'This "sentence" contains "lots" of "double-quotes" does it not?'

is much simpler than:

"This ""sentence"" contains ""lots"" of ""double-quotes"" does it not?"

When evaluated, strings can have Env variables or Var variables substitution according to Opt() function definition.

Booleans

Booleans are logical values. Only two Boolean values exist: true and false.

They can be used in variable assignments, together with the Boolean operators and, or and not.

Examples:
$Boolean1 = true
$Boolean2 = false
$Boolean3 = $Boolean1 AND $Boolean2

This will result in $Boolean3 being false

$Boolean1 = false
$Boolean2 = not $boolean1

This will result in $Boolean2 being true

If Boolean values are used together with numbers, the following rules apply:

A value 0 will be equal to Boolean false
Any other number value will be equal to Boolean true

Example:
$Number1 = 0
$Boolean1 = true
$Boolean2 = $Number1 and $Boolean1

This will result in $Boolean2 being false

If you use arithmetics together with Boolean values (which is not advisable!), the following rules apply:

A Boolean true will be converted into the numeric value 1
A Boolean false will be converted into the numeric value 0

Example:
$Boolean1 = true
$Number1 = 100
$Number2 = $Boolean1 + $Number1

This will result in $Number2 to be the numeric value 101

If you use strings together with Boolean values, they will be converted as follows:

A Boolean true will be the string value "True"
A Boolean false will be the string value "False"

Example:
$Boolean1=true
$String1="Test is: "
$String2=$String1 & $Boolean1

This will result in $String2 being the string value "Test is: True"

The other way around however is different. When you use string comparisons with Boolean values, the following rules apply:
Only an empty string ("") will be a Boolean false
Any other string values (including a string equal "0") will be a Boolean true

Binary

Binary type can store any byte value. they are converted in hexadecimal representation when stored in a string variable. Example:
$bin = Binary("abc")
$str = String($bin) ; "0x616263"

Pointer

Pointer types store a memory address which is 32bits or 64bits depending on if the 32bit or 64 bit of AutoIt is used. They are converted to hexadecimal representation when stored in a string variable. Window handles (HWnd) as returned from WinGetHandle are a pointer type.

Datatypes and Ranges

The following table shows the internal variant datatypes and their ranges.

Data Sub-type | Range and Notes
Int32 | A 32bit signed integer number.
Int64 | A 64bit signed integer number
Double | A double-precision floating point number.
String | Can contain strings of up to 2147483647 characters.
Binary | Binary data, can contain up to 2147483647 bytes.
Pointer | A memory address pointer. 32bit or 64bit depending on the version of AutoIt used.

Some functions in AutoIt only work with 32 bit numbers (e.g. BitAND) and are converted automatically - these functions are documented where required.


Language Reference - Variables

A variable is just a place to store data in memory so that it can be accessed quickly. Think of it as a mailbox in memory that you can put information in or take information out of. For example you might create a variable to store the number a user's response to a question, or the result to a math equation.

Each variable has a name (again, similar to a mailbox) and must start with the $ character and may only contain letters, numbers and the underscore _ character. Here are some example names:

$var1

$my_variable

Each variable is stored as a variant.

Declaring Variables

Variables are declared and created with the Dim, Local and Global keywords:

Dim $var1

Or you can declare multiple variables at once:

Dim $var1, $myvariable

You can also assign a variable without declaring it first, but many prefer explicit declarations.

$var1 = "create and assign"

Declaring Constants

Constants are declared and created using Const keyword like:

Const $const1 = 1, $const2=12

Constants can be declared and initialized using Enum keyword like:

Enum $const1 = 1, $const2, $const3 ; 1, 2, 3
Enum STEP 2 $incr0, $incr2, $incr4 ; 0, 2, 4
Enum STEP *2 $mult1, $mult2, $mult4 ; 1, 2, 4

Constants cannot redeclare an existing variable.

Scope

A variable's scope is controlled by when and how you declare the variable. If you declare a variable at the start of your script and outside any functions it exists in the Global scope and can be read or changed from anywhere in the script.

If you declare a variable inside a function it is in Local scope and can only be used within that same function. Variables created inside functions are automatically destroyed when the function ends.

By default when variables are declared using Dim or assigned in a function they have Local scope unless there is a global variable of the same name (in which case the global variable is reused). This can be altered by using the Local and Global keywords to declare variables and force the scope you want.

Arrays

An Array is a variable containing series of data elements of the same type and size. Each element in this variable can be accessed by an index number.

An example:

Let's say you want to store these series of characters: "A", "U", "T", "O", "I", "T" and "3".
You could use seven separate variables to do so, but using an Array is more efficient:

$Array[0]="A"
$Array[1]="U"
..etc..
$Array[6]="3"

To access a specific value in an Array, you only have to know the index number:

$MyChar=$Array[2]

This results in $MyChar containing the letter "T" (See also: 'operators').

The index number can also be substituted by another variable or an expression, so you can build complex ways to assign or access elements in an array.

Arrays can also be multi dimensional, when you use multiple series of index numbers, like:

$Array[0][0]="Upper-Left"
$Array[1][0]="Lower-Left"
$Array[0][1]="Upper-Right"
$Array[1][1]="Lower-Right"

(These values are just examples)

You can use up to 64 dimensions in an Array. The total number of entries cannot be greater than 2^24 (16 777 216).

Before you can start using Arrays in your script, you must define their bounds using the 'Dim' keyword.

Data types in Arrays

It was said that an Array contains only one datatype of the same type. But technically speaking, a Variant in AutoIt can contain anything from a number to a boolean value. So an AutoIt-Array could also contain different types, even other Arrays:

$Array[0]=1
$Array[1]=true
$Array[2]="Text"
$Array[3]=$AnotherArray

This has not been strictly forbidden in AutoIt. However, it is NOT ADVISABLE to mix different datatypes in an Array. Especially the use of an Array inside another Array will severely affect the execution speed of your script.


Language Reference - Macros

AutoIt has an number of Macros that are special read-only variables used by AutoIt. Macros start with the @ character instead of the usual $ so are easy to tell apart. As with normal variables you can use macros in expressions but you cannot assign a value to them.

The pre-defined macros are generally used to provide easy access to system information like the location of the Windows directory, or the name of the logged on user.

Go here for a complete list.


Language Reference - Operators

AutoIt has the following assignment, mathematical, comparison, and logical operators.

Operator | Description
 | Assignment operators
= | Assignment. e.g. $var = 5 (assigns the number 5 to $var)
+= | Addition assignment. e.g. $var += 1 (adds 1 to $var)
-= | Subtraction assignment.
*= | Multiplication assignment.
/= | Division assignment.
&= | Concatenation assignment. e.g. $var = "one", and then $var &= 10 ($var now equals "one10")
 | Mathematical operators
+ | Adds two numbers. e.g. 10 + 20 (equals 30)
- | Subtracts two numbers. e.g. 20 - 10 (equals 10)
* | Multiplies two numbers. e.g. 20 * 10 (equals 200)
/ | Divides two numbers. e.g. 20 / 10 (equals 2)
& | Concatenates/joins two strings. e.g. "one" & 10 (equals "one10")
^ | Raises a number to the power. e.g. 2 ^ 4 (equals 16)
 | Comparison operators (case insensitive if used with strings except for ==)
= | Tests if two values are equal. e.g. If $var= 5 Then (true if $var equals 5). Case insensitive when used with strings.
== | Tests if two strings are equal. Case sensitive. The left and right values are converted to strings if they are not strings already. This operator should only be used for string comparisons that need to be case sensitive.
<> | Tests if two values are not equal. Case insensitive when used with strings. To do a case sensitive not equal comparison use Not ("string1" == "string2")
> | Tests if the first value is greater than the second. Strings are compared lexicographically even if the contents of the string happen to be numeric.
>= | Tests if the first value is greater than or equal to the second. Strings are compared lexicographically even if the contents of the string happen to be numeric.
< | Tests if the first value is less than the second. Strings are compared lexicographically even if the contents of the string happen to be numeric.
<= | Tests if the first value is less than or equal to the second. Strings are compared lexicographically even if the contents of the string happen to be numeric.
 | Logical operators
AND | Logical AND operation. e.g. If $var = 5 AND $var2 > 6 Then (True if $var equals 5 and $var2 is greater than 6)
OR | Logical OR operation. e.g. If $var = 5 OR $var2 > 6 Then (True if $var equals 5 or $var2 is greater than 6)
NOT | Logical NOT operation. e.g. NOT 1 (False)

When more than one operator is used in an expression the order in which things happen is controlled by operator precedence. The precedence used in AutoIt is given below. Where two operators have the same precedence the expression is evaluated left to right.

From highest precedence to lowest:

NOT
^
* /
+ -
&
< > <= >= = <> ==
AND OR

e.g. 2 + 4 * 10 is evaluated as 42:

4 * 10 (equals 40)

2 + 40 (equals 42)

As the * has a higher precedence than + it occurs before the addition.

You can use brackets to force a part of the expression to be evaluated first.

e.g. (2 + 4) * 10 equals 60.

Note the following when using the logical operators AND, OR:

e.g. If MyFunc1() OR MyFunc2() Then (MyFunc2() is not called if MyFunc1() returns true)

e.g. If MyFunc1() AND MyFunc2() Then (MyFunc2() is not called if MyFunc1() returns false)


Language Reference - Conditional Statements

You will often want to change the flow of your script based on a condition or series of conditions. Is one number bigger than another? Or, does a string contain a certain value?

Conditions are evaluated as true (non-zero) or false (zero). Conditions generally use comparison operators like ==, <>, >=.

The following conditional statements are available in AutoIt:

  • If...Then...Else
  • Select...Case
  • Switch...Case

All three statements are similar and decide which code to execute depending on the condition(s) given. Here is an example of an If statement that pops up a message box depending on the value of a variable.

$var = -20

If $var > 0 Then
MsgBox(0, "Example", "$var was positive!")
ElseIf $var < 0 Then
MsgBox(0, "Example", "$var was negative!")
Else
MsgBox(0, "Example", "$var was zero.")
EndIf

In the example above, the expression $var > 0 evaluated to false because the variable was less than zero. When the first condition failed, the second condition was tested. The expression $var < 0 evaluated to true. This caused the If statement to execute the second MsgBox line and display "$var was negative!".

A Select statement is very similar, but is generally used for situations where you want to test a large number of conditions as it is generally easier to read than a large If/ElseIf type block. e.g.

$var = 30

Select
Case $var > 1 AND $var <= 10
MsgBox(0, "Example", "$var was greater than 1")

Case $var > 10 AND $var <= 20
MsgBox(0, "Example", "$var was greater than 10")

Case $var > 20 AND $var <= 30
MsgBox(0, "Example", "$var was greater than 20")

Case $var > 30 AND $var <= 40
MsgBox(0, "Example", "$var was greater than 30")

Case $var > 40
MsgBox(0, "Example", "$var was greater than 40")
EndSelect

A Switch statement is very similar to Select statement, but is generally used for situations where the same expression is tested against some different possible values.

$var = 30

Switch Int($var)
Case 1 To 10
MsgBox(0, "Example", "$var was greater than 1")

Case 11 To 20
MsgBox(0, "Example", "$var was greater than 10")

Case 21 To 30
MsgBox(0, "Example", "$var was greater than 20")

Case 31 To 40
MsgBox(0, "Example", "$var was greater than 30")

Case Else
MsgBox(0, "Example", "$var was greater than 40 or less or equal to 0")

EndSwitch

With each of these structures, the first condition that is true controls which group of statements get executed. All subsequent conditions and their associated statements get ignored.


Language Reference - Loops Statements

Language Reference - Loop Statements

A loop is how you refer to a section of script that you repeat a number of times. You might want to loop a given number of times or you might wish to repeat a section of script as long as a certain condition is true or false.

The following loop statements are available in AutoIt:

  • For...Next
  • While...WEnd
  • Do...Until
  • For...In...Next

While (no pun intended) all the statements perform similar functions, they are slightly different and one will usually be more appropriate than another for a given situation.


Language Reference - Obj Statements

An obj is how you refer to an object. You might want to enumerate elements in an Object collection

The following obj statements are available in AutoIt:

  • With...Endwith
  • For...In...Next


Language Reference - User Functions

A function is a section of code that can be called from the script to perform a certain "function". There are two sorts of functions in AutoIt, built-in functions and user functions.

Built-in Functions

The full list of built-in functions is here and the notes on using them are here.

User Functions

User functions are declared using the Func...EndFunc statements.

Functions can accept parameters and return values as required.

Function names must start with either a letter or an underscore, and the remainder of the name can contain any combination of letters and numbers and underscores. Some valid function names are:

MyFunc

Func1

_My_Func1

Here is an example of using a function to double a number 10 times:

$val = 10
For $i = 1 To 10
$doubled = MyDouble($val)
MsgBox(0, "", $val & " doubled is " & $doubled)
$val = $doubled
Next

Exit

Func MyDouble($value)
$value = $value * 2
Return $value
EndFunc


Language Reference - Comments

Although only one statement per line is allowed, a long statement can span multiple lines if an underscore " _" preceded by a blank is placed at the end of a "broken" line. String definition cannot be split in several lines, concatenation need to be used.

MsgBox(4096,"", "This is a rather long line, so I " & _
"broke it with the underscore, _, character.")

The semicolon (;) is the comment character. Unless the semicolon is within a string, all text following it is ignored by the script interpreter/compiler.

; The next line contains a meaningful, end-of-line comment
Sleep(5000) ;pause 5 seconds

You can combine underscore and semicolon to put comments on lines and still have a long statement span on next line.

dim $b_ ; This _ is not a continuation character, nor is the next one
dim $k_
Dim $a[8][2] = [ _
[ "Word", 4 ], _ ; Comment 1
[ "Test", 3 ], _
[ "pi", 3.14159], _ ; Associate the name with the value
[ "e", 2.718281828465], _ ; Same here
[ "test;1;2;3", 123], _
[ ';', Asc(';') ], _ ; This comment is removed, but the strings remain.
["", 0] ]

It is also possible to comment of large blocks of script by using the #comments-start and #comments-end directives.


GUI Reference

  • GUI Concepts
  • GUI MessageLoop Mode
  • GUI OnEvent Mode
  • GUI Constants include files


GUI Reference

AutoIt has the ability to create simple Graphical User Interfaces (GUIs) that consist of windows and controls.

GUI Concepts

A GUI consists of one or more windows and each window contains one or more controls. GUIs are "event driven" which means you react to events - like a button that is clicked. You spend most of your time idling and waiting for an event to happen - this is a little different to a normal script where you are in control of what happens and when! Think of it as waiting by the door for the postman - you sit there until a letter pops through the postbox and then you look at the letters and decide what to do with them - this is exactly how GUIs work - you wait for the postman to come to you.

Of course, you may choose to do other tasks while the GUI is active - for example you might use the GUI functions to create an elaborate progress box that you update while your script performs complex actions.

GUI Controls

All users will be familiar with controls - anything you click on or interact with in a window is a type of control. The types of controls that can be created with AutoIt are listed below - you will have used most of them in other Windows programs.

Label | A plain piece of text.
Button | A simple button.
Input | A single line control that you can enter text into.
Edit | A multi-line control that you can enter text into.
Checkbox | A box that can be "checked" or "unchecked".
Radio | A set of circular buttons - only one can be active at once.
Combo | A list with a dropdown box.
List | A list.
Date | A date picker.
Pic | A picture.
Icon | An icon.
Progress | A progress bar.
Tab | A group of controls that are contained in tabs.
UpDown | A control that can be added to input controls.
Avi | Display an AVI format clip.
Menu | A menu across the top of the window.
ContextMenu | A menu that appears when you right click inside the window.
TreeView | A control similar to the windows file-explorer.
Slider | A control similar to the windows sound volume control.
ListView | A control displaying columns information.
ListViewItem | A control displaying item in a listview control.
Graphic | A control displaying graphics drawn with GUICtrlSetGraphic.
Dummy | A dummy user control.

Here is an example of a single window GUI that contains many of the controls available. As you can see it is possible to create very detailed GUIs!

Controls are created with the GUICtrlCreate... set of functions. When a control is created a Control ID is returned. The most important things to note about a control ID is that:

  • The control ID is a positive number (that is, a number greater than 0)
  • Each control ID is unique - even when there are multiple windows
  • The control ID is actually the same value as the Control ID that the AutoIt Window Info Tool shows.

    • GUI Basic Functions

    These are the main functions that you will need to create a GUI. They are just the basics though, there are many more when you are ready to create some really advanced GUIs.

    Function | Explanation
GUICreate | Create a window.
GUICtrlCreate... | Create various controls in a window.
GUISetState | Display or hide the window.
GUIGetMsg | Poll the GUI to see if an event has happened (MessageLoop mode only)
GUICtrlRead | Read the data in a control.
GUICtrlSetData | Set/change the data in a control.
GUICtrlUpdate... | Change various options for a control (color, style, etc.)

    You will need to #include <GUIConstantsEx.au3> for basic GUI related constants. There are other files containing constants related to the various controls you can create on the GUI.

    First let's create a window, call it "Hello World" and make it 200 by 100 pixels in size. When a new window is created it is hidden - so we must "show" it.

    #include <GUIConstantsEx.au3>

    GUICreate("Hello World", 200, 100)
    GUISetState(@SW_SHOW)
    Sleep(2000)

    If your run the above script you will see a window open and close after 2 seconds. Not very interesting...let's add some text and an OK button. The text will be added at position 30, 10 and the button at 70, 50 and the button will be 60 pixels wide.

    #include <GUIConstantsEx.au3>

    GUICreate("Hello World", 200, 100)
    GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
    GUICtrlCreateButton("OK", 70, 50, 60)
    GUISetState(@SW_SHOW)
    Sleep(2000)

    That's pretty good, but how do we make the GUI react to us clicking the button? Well, this is where we must make a decision as to how we will process events - via a MessageLoop or via OnEvent functions.

    GUI Event Modes

    As mentioned above there are two basic GUI modes: MessageLoop mode and OnEvent mode. The modes are simply two different ways of reacting to GUI events. The mode you choose will depend on personal preference, and to some extent the type of GUI you wish to create. Both modes are equally capable of creating any GUI you wish but sometimes one mode is more suited to a task than the other.

    The default mode is the MessageLoop mode. To switch to OnEvent mode use Opt("GUIOnEventMode", 1).

    Message-loop Mode (default)

    In the Message-loop mode your script will spend the majority of its time in a tight loop. This loop will simply poll the GUI using the GUIGetMsg function. When an event has occurred the return value of the GUIGetMsg function will show the details (a button is clicked, the GUI has been closed, etc.).

    In this mode you will only receive events while you are actively polling the GUIGetMsg function so you must ensure that you call it many times a second otherwise your GUI will be unresponsive.

    This mode is best for GUIs where the GUI is "king" and all you care about is waiting for user events.

    See this page for a more detailed explanation of the MessageLoop mode.

    OnEvent Mode

    In the OnEvent mode instead of constantly polling the GUI to find out if anything has happened you make the GUI temporarily pause your script and call a pre-defined function to handle the event. For example, if the user clicks Button1 the GUI halts your main script and calls a previously defined user function that deals with Button1. When the function call is completed the main script is resumed. This mode is similar to the Visual Basic forms method.

    This mode is best for GUIs where the GUI is of secondary importance and your script has other tasks to perform in addition to looking after the GUI.

    See this page for a more detailed explanation of the OnEvent mode.


GUI Reference - MessageLoop Mode

In the MessageLoop mode your script will spend the majority of its time in a tight loop. This loop will simply poll the GUI using the GUIGetMsg function. When an event has occurred the return value of the GUIGetMsg function will show the details (a button is clicked, the GUI has been closed, etc.).

The MessageLoop mode is the default message mode for AutoIt GUIs - the other possible mode is the OnEvent mode.

In the MessageLoop mode you will only receive events while you are actively polling the GUIGetMsg function so you must ensure that you call it many times a second otherwise your GUI will be unresponsive.

Basic MessageLoop Format

The general layout of MessageLoop code is:

While 1
$msg = GUIGetMsg()
...
...
WEnd

Usually a tight loop like the one shown would send the CPU to 100% - fortunately the GUIGetMsg function automatically idles the CPU when there are no events waiting. Do not put a manual sleep in the loop for fear of stressing the CPU - this will only cause the GUI to become unresponsive.

GUI Events

There are three types of event messages that GUIGetMsg will return:

  • No Event
  • Control Event
  • System Event

    • No Event

    When there are no events waiting to be processed GUIGetMsg returns 0. In a usual GUI this is the most common event.

    Control Event

    When a control is clicked or changes a control event is sent - this event is a positive number that corresponds to the controlID that was returned when the control was created with GUICtrlCreate....

    System Event

    System events - such as the GUI closing - are negative numbers. The different events are shown below and are defined in GUIConstantsEx.au3:

    $GUI_EVENT_CLOSE
    $GUI_EVENT_MINIMIZE
    $GUI_EVENT_RESTORE
    $GUI_EVENT_MAXIMIZE
    $GUI_EVENT_PRIMARYDOWN
    $GUI_EVENT_PRIMARYUP
    $GUI_EVENT_SECONDARYDOWN
    $GUI_EVENT_SECONDARYUP
    $GUI_EVENT_MOUSEMOVE
    $GUI_EVENT_RESIZED
    $GUI_EVENT_DROPPED

    Example GUI

    In the main GUI Reference page we started a simple Hello World example that looked like this:

    #include <GUIConstantsEx.au3>

    GUICreate("Hello World", 200, 100)
    GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
    GUICtrlCreateButton("OK", 70, 50, 60)
    GUISetState(@SW_SHOW)
    Sleep(2000)

    Now we will finish the code using a MessageLoop and some of the event messages described above. It is usual because of the number of possible messages to use a Select statement for readability.

    #include <GUIConstantsEx.au3>

    GUICreate("Hello World", 200, 100)
    GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
    $okbutton = GUICtrlCreateButton("OK", 70, 50, 60)
    GUISetState(@SW_SHOW)

    While 1
    $msg = GUIGetMsg()

    Select
    Case $msg = $okbutton
    MsgBox(0, "GUI Event", "You pressed OK!")

    Case $msg = $GUI_EVENT_CLOSE
    MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
    ExitLoop
    EndSelect
    WEnd

    It's that simple. Obviously the more windows and controls you create the more complicated it gets but the above shows you the basics.

    Advanced GUIGetMsg and Multiple Windows

    Control IDs are unique, even when you have multiple windows, so the above code with work fine with controls and multiple windows. However, when processing events such as $GUI_EVENT_CLOSE or $GUI_MOUSEMOVE you need to know which GUI window generated the event. To do this you must call GUIGetMsg like so:

    $msg = GUIGetMsg(1)

    When called with the 1 parameter instead of returning an event value an array will be returned, the array contains the event ( in $array[0] ) and extra information such as the window handle ( in $array[1] ). If two windows were created in the previous example then the correct way to write the code would be:

    #include <GUIConstantsEx.au3>

    $mainwindow = GUICreate("Hello World", 200, 100)
    GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
    $okbutton = GUICtrlCreateButton("OK", 70, 50, 60)

    $dummywindow = GUICreate("Dummy window for testing ", 200, 100)

    GUISwitch($mainwindow)
    GUISetState(@SW_SHOW)

    While 1
    $msg = GUIGetMsg(1)

    Select
    Case $msg[0] = $okbutton
    MsgBox(0, "GUI Event", "You pressed OK!")

    Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $mainwindow
    MsgBox(0, "GUI Event", "You clicked CLOSE on the main window! Exiting...")
    ExitLoop
    EndSelect
    WEnd

    The first major change is the GUISwitch function call - when a new window is created it becomes the "default" window for future GUI operations (including control creation). In our case we want to work with the main "Hello World" window, not the test window, so we "switch". Some GUI functions allow you to use the window handle in the function call itself - these functions will do the switch automatically. In our example we could have done this with:

    GUISetState(@SW_SHOW, $mainwindow)

    The next change is the way GUIGetMsg is called and how the events are checked - notice the use of $msg[0] and $msg[1] - now we only exit the script if the close event is sent and the event is from our main window.


GUI Reference - OnEvent Mode

In the OnEvent mode instead of constantly polling the GUI to find out if anything has happened you make the GUI temporarily pause your script and call a pre-defined function to handle the event. For example, if the user clicks Button1 the GUI pauses your main script and calls a previously defined user function that deals with Button1. When the function call is completed the main script is resumed. This mode is similar to the Visual Basic forms method.

While the GUI is executing, your main script could be doing any normal scripting work, but for ease of examples we will just make the main script "idle" in an infinite While loop.

The default mode is the MessageLoop mode so before using the OnEvent mode we must use Opt("GUIOnEventMode", 1).

Basic OnEvent Format

The general layout of OnEvent code is:

While 1
Sleep(1000) ; Just idle around
WEnd

Func Event1()
; Code to handle event goes here
EndFunc

Func Event2()
; Code to handle event goes here
EndFunc

GUI Events

In the OnEvent mode your GUI will generate the following "events":

  • Control Event
  • System Event

    • Both types of event will call a user defined function if one was set for the GUI (GUISetOnEvent) or for a control (GUICtrlSetOnEvent). If no functions are defined for an event then it is simply ignored. When inside this called function various macros will be set to values to help process the event.

    Macro | Details
@GUI_CTRLID | The control ID of the control sending the message OR the system event ID
@GUI_WINHANDLE | The handle of the GUI that sent the message
@GUI_CTRLHANDLE | The handle of the Control that sent the message (if applicable)

    Note: It is perfectly legal to use the same function for multiple events, all that you need to do in these cases is to take action based on the @GUI_CTRLID macro. For example, you could register all system events to the same function.

    Control Event

    When a control is clicked or changes a control event is sent. The event is sent to the function defined with GUICtrlSetOnEvent. Inside the user defined function @GUI_CTRLID is set to the controlID that was returned when the control was created with GUICtrlCreate....

    System Event

    System events - such as the GUI closing - are sent in a similar way to Control event, but the event type is defined by @GUI_CTRLID. The event is sent to the function defined with GUISetOnEvent. The possible system event values are shown here:

    $GUI_EVENT_CLOSE
    $GUI_EVENT_MINIMIZE
    $GUI_EVENT_RESTORE
    $GUI_EVENT_MAXIMIZE
    $GUI_EVENT_PRIMARYDOWN
    $GUI_EVENT_PRIMARYUP
    $GUI_EVENT_SECONDARYDOWN
    $GUI_EVENT_SECONDARYUP
    $GUI_EVENT_MOUSEMOVE
    $GUI_EVENT_RESIZED
    $GUI_EVENT_DROPPED

    Example GUI

    In the main GUI Reference page we started a simple Hello World example that looked like this:

    #include <GUIConstantsEx.au3>

    GUICreate("Hello World", 200, 100)
    GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
    GUICtrlCreateButton("OK", 70, 50, 60)
    GUISetState(@SW_SHOW)
    Sleep(2000)

    Now we will finish the code using OnEvents and some of the event messages described above.

    #include <GUIConstantsEx.au3>

    Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
    $mainwindow = GUICreate("Hello World", 200, 100)
    GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
    GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
    $okbutton = GUICtrlCreateButton("OK", 70, 50, 60)
    GUICtrlSetOnEvent($okbutton, "OKButton")
    GUISetState(@SW_SHOW)

    While 1
    Sleep(1000) ; Idle around
    WEnd

    Func OKButton()
    ;Note: at this point @GUI_CTRLID would equal $okbutton,
    ;and @GUI_WINHANDLE would equal $mainwindow
    MsgBox(0, "GUI Event", "You pressed OK!")
    EndFunc

    Func CLOSEClicked()
    ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE,
    ;and @GUI_WINHANDLE would equal $mainwindow
    MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
    Exit
    EndFunc

    It's that simple. Obviously the more windows and controls you create the more complicated it gets but the above shows you the basics.

    Advanced Operations and Multiple Windows

    Control IDs are unique, even when you have multiple windows but how do we handle multiple windows?

    Here is an example similar to the one above but with another "dummy" window.

    #include <GUIConstantsEx.au3>

    Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
    $mainwindow = GUICreate("Hello World", 200, 100)
    GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
    GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
    $okbutton = GUICtrlCreateButton("OK", 70, 50, 60)
    GUICtrlSetOnEvent($okbutton, "OKButton")

    $dummywindow = GUICreate("Dummy window for testing ", 200, 100)
    GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")

    GUISwitch($mainwindow)
    GUISetState(@SW_SHOW)

    While 1
    Sleep(1000) ; Idle around
    WEnd

    Func OKButton()
    ;Note: at this point @GUI_CTRLID would equal $okbutton
    MsgBox(0, "GUI Event", "You pressed OK!")
    EndFunc

    Func CLOSEClicked()
    ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE,
    ;@GUI_WINHANDLE will be either $mainwindow or $dummywindow
    If @GUI_WINHANDLE = $mainwindow Then
    MsgBox(0, "GUI Event", "You clicked CLOSE in the main window! Exiting...")
    Exit
    EndIf
    EndFunc

    The first major change is the GUISwitch function call - when a new window is created it becomes the "default" window for future GUI operations (including control creation). In our case we want to work with the main "Hello World" window, not the test window, so we "switch". Some GUI functions allow you to use the window handle in the function call itself - these functions will do the switch automatically. In our example we could have done this with:

    GUISetState(@SW_SHOW, $mainwindow)

    Also notice that we used the same OnEvent function to handle the "close" button for both windows and then used @GUI_WINHANDLE to determine which window sent the message - then we only closed the GUI when the close button was clicked and the message came from the main window . You can just as easily use separate functions for each window if you wish.


COM Reference

COM Extensions to AutoIt

A short introduction

What is COM?

COM stands for "Component Object Model". It is the Microsoft way to interconnect software using a common interface. These interfaces are defined in a COM Object.

Before COM, you had to know the exact implementation of a program before you could 'interface' with it. Using COM, you can now "talk" to its defined Object(s). The only things you have to know are the names of the Objects that are used and which 'properties' or 'methods' they have.

What are (Object) properties or methods?

These are the two basic characteristics of an Object. You can see a 'property' as the data storage of an Object. A 'method' can be seen as an internal function call to do something with the data.

Do I need COM in my AutoIt script?

It just depends. AutoIt has a lot of built-in functions and a huge library of UDF's. You can do most of your programming with these. However if you need special 'interfacing' to other applications, using COM might save you some lines of script. Scripters have to be aware that the existence of COM Objects depend HEAVILY on the Operating System AND the installed software. The examples below have all been tested under a 'plain' Windows XP professional version with Microsoft Office 2000.

An example usage of COM in AutoIt

Let's say you want to minimize all open windows. You could do this using regular AutoIt functions like WinList and WinSetState. However, two lines of COM-code can give you the same result:

$oShell = ObjCreate("shell.application")

$oShell.MinimizeAll

Side note: The example is no longer the shortest way to minimize all windows after the introduction of the WinMinimizeAll() function in AutoIt.

On the first line we create a new object called "shell.application". This is an internal Windows object, defined in shell32.dll. The pointer to this new object is assigned to the variable $oShell. $oShell is from now on an Object variable.

On the second line, we use a Method called "MinimizeAll" to the oShell object. This will minimize all windows.

All Windows versions have a huge amount of internal Objects for various purposes. And applications like Excel or Word have also their own set of Objects.

However, it is sometimes difficult to get a list of all existing Objects defined on your system with their corresponding properties and methods. Searching at Microsoft.com or Google.com might give you some clues about the Object 'X' you want to use.

For instance, you can find information about the "shell.application" object at:
http://msdn.microsoft.com/en-us/library/bb774094.aspx

To get a peek on all objects currently installed on your system, the "OLE/COM Object Viewer" is a very helpful tool. This tool will be explained in a separate section below.

Let's do another example. We would like to get a HTML source code from a certain web page. You could use the internal InetGet() function to save the result to a file and retrieve it back again with FileRead(). But these lines of code do the same:

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET","http://www.AutoItScript.com")
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext

The (string) variable $HTMLSource now contains the complete HTML code of the AutoItScript.com home page (that is, the top HTML-Frame).

(Information about the "winhttp.winhttprequest" object can be found at:
http://msdn.microsoft.com/en-us/library/aa384106.aspx )

Please mind this: The existence of Objects depend on the computer's operating system and installed programs. For example, the winhttp.winhttprequest.5.1 object only exists on computers that have at least Internet Explorer version 5 installed. When you are sharing scripts that use COM objects, be sure the objects exist on all computers.

Object variables behave a bit different than other types of AutoIt variables. An Object is not a real value, but a 'pointer' to something outside the script. So you can't perform arithmetic's, nor equations on Object variables. When you assign an Object variable a different value, the 'pointer' will automatically be released. You can, for instance, force deletion of an Object by assigning it any number or any text value.

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1") ; Object is created
$oHTTP=0 ; Object is deleted

You don't need to delete Objects when you are finished. If a script exits, AutoIt tries to release all active references to Objects that had been created in the script. Same thing happens when you had defined a local Object variable inside a function, and the function ends with a return.

Automation using COM

A very popular application of COM is to 'automate' programs. Instead of using the regular AutoIt functions like Send() or WinActivate(), you can make use of the Objects that are defined inside the program.

Here is an example that 'automates' Microsoft Excel:

$oExcel = ObjCreate("Excel.Application") ; Create an Excel Object
$oExcel.Visible = 1 ; Let Excel show itself
$oExcel.WorkBooks.Add ; Add a new workbook
$oExcel.ActiveWorkBook.ActiveSheet.Cells(1,1).Value="test" ; Fill a cell
sleep(4000) ;See the results for 4 seconds
$oExcel.ActiveWorkBook.Saved = 1 ; Simulate a save of the Workbook
$oExcel.Quit ; Quit Excel

The complexity of controlling other programs depends on that specific program, not on the AutoIt script. If something does not work as expected you might need to consult the applications' documentation and not the AutoIt help.

Special Statements

In AutoIt, two special statements are designed for COM usage:

WITH/ENDWITH and the FOR/IN/NEXT loop.

WITH..ENDWITH

The WITH/ENDWITH statement does not add functionality, but it makes your script easier to read. For instance, the previous example using Excel can also be written as:

$oExcel = ObjCreate("Excel.Application") ; Create an Excel Object

WITH $oExcel
.Visible = 1 ; Let Excel show itself
.WorkBooks.Add ; Add a new workbook
.ActiveWorkBook.ActiveSheet.Cells(1,1).Value="test" ; Fill a cell
sleep(4000) ;See the results for 4 seconds
.ActiveWorkBook.Saved = 1 ; Simulate a save of the Workbook
.Quit ; Quit Excel
ENDWITH

This example does not save you a lot of text, but when your object uses long lines of properties/methods, you can shorten it heavily within a WITH statement.

FOR..IN

The FOR...IN loop is required when using Collections. Collections are a special type of Object, that exist out of multiple sub-Objects. You could see them as Arrays (Actually, the FOR..IN statement also works on Array-type variables).

FOR..IN loop using an Array

Below is an example of an FOR..IN loop. This example uses a normal AutoIt array, so it has nothing to do with COM. It's just to show you the principle:

$String = "" ; A string for displaying purposes

$aArray[0]="a" ; We fill an array
$aArray[1]=0 ; with several
$aArray[2]=1.3434 ; different
$aArray[3]="testestestest" ; example values.

FOR $Element IN $aArray ; Here it starts..
$String = $String & $Element & @CRLF
NEXT

; Now Show the results to the user
Msgbox(0,"For..IN Arraytest","Result: " & @CRLF & $String)

FOR..IN loop using an Object

In most cases you can't use 'normal' Object methods to retrieve the elements of a collection. In 'COM'-terms they say you have to 'enumerate' them. This is where the FOR..IN loop comes in.

The Excel example below loops on cells A1:O16 on the current active sheet. If one of the cells has a value less than 5, the code replaces the value with 0 (zero):

$oExcel = ObjCreate("Excel.Application") ; Create an Excel Object

$oExcel.Visible = 1 ; Let Excel show itself
$oExcel.WorkBooks.Add ; Add a new workbook

dim $arr[16][16] ; These lines
for $i = 0 to 15 ; are just
for $j = 0 to 15 ; an example to
$arr[$i][$j] = $i ; create some
next ; cell contents.
next

$oExcel.activesheet.range("A1:O16").value = $arr ; Fill cells with example numbers

sleep(2000) ; Wait a while before continuing

For $cell in $oExcel.ActiveSheet.Range("A1:O16")
If $cell.Value < 5 Then
$cell.Value = 0
Endif
Next

$oExcel.ActiveWorkBook.Saved = 1 ; Simulate a save of the Workbook
sleep(2000) ; Wait a while before closing
$oExcel.Quit ; Quit Excel

Advanced COM usage

The following features of AutoItCOM requires profound knowledge of COM Events and COM Error handling.

If you are a newbie to COM programming, please read some good COM documentation first.

The bible of COM is the book called "Inside OLE 2" by Kraig Brockschmidt (Microsoft Press).

You can also find some COM resources on the internet (not AutoIt related):

http://msdn.microsoft.com/en-us/library/ms694363.aspx (introduction)

http://www.garybeene.com/vb/tut-obj.htm (about Objects in Visual Basic)

http://java.sun.com/docs/books/tutorial/java/concepts/ (Using objects in Java)

http://msdn.microsoft.com/archive/en-us/dnarguion/html/drgui082399.asp (Object Events in C++)

http://www.garybeene.com/vb/tut-err.htm (Error handling in Visual Basic)

COM Events

Normal COM Automation mainly uses one-way communication. You 'ask' the Object for any properties or results from a Method. However a COM Object can also 'talk back' to your script when it suits it.

This could be very handy in cases you need to wait for some COM-related action to happen.

Instead of writing a kind of loop, asking the Object if something interesting has happened, you can let the Object itself call a specific UDF in your script. Meanwhile you can do other things in your script (almost) simultaneously.

Not all Object to support events. You have to read the Object documentation carefully whether it supports events or not.

If it does, the second thing to know is the type of Events it supports. AutoItCOM can only receive 'dispatch' type events.

Finally you have to know the names of the Events the Object could generate, including their arguments (if any).

Only when you have all this information, you can start building an AutoIt script using COM Events.

Below is a snippet from a script that demonstrates how to receive Events from the Internet Explorer:

$oIE=ObjCreate("InternetExplorer.Application.1") ; Create an Internet Explorer Object

$EventObject=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents") ; Start receiving Events.

$oIE.url= "http://www.autoitscript.com" ; Load an example web page
;From now on, the $oIE Object generates events during web page load.
;They are handled in the event functions shown below.

;Here you can let the script wait until the user wants to finish.
...(your code here)...

$EventObject.stop ; Tell IE we want to stop receiving Events
$EventObject=0 ; Kill the Event Object
$oIE.quit ; Quit IE
$oIE=0 ; Remove IE from memory (not really necessary)
Exit ; End of main script

; A few Internet Explorer Event Functions.
;
; For the full list of IE Event Functions, see the MSDN WebBrowser documentation at:
; http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx

Func IEEvent_StatusTextChange($Text)
; In the complete script (see link below) we show the contents in a GUI Edit box.
GUICtrlSetData ( $GUIEdit, "IE Status text changed to: " & $Text & @CRLF, "append" )
EndFunc

Func IEEvent_BeforeNavigate($URL, $Flags, $TargetFrameName, $PostData, $Headers, $Cancel)
; In the complete script (see link below) we show the contents in a GUI Edit box.
; Note: the declaration is different from the one on MSDN.
GUICtrlSetData ( $GUIEdit, "BeforeNavigate: " & $URL & " Flags: " & $Flags & @CRLF, "append")
EndFunc

Click here to view the complete script.

The main line in this script is: $EventObject=ObjEvent($oIE,"IEEvent_",...).
This function takes the object $oIE and reroutes it's events to AutoIt functions whose names start with MYEvent_. The third parameter is optional. It is used when an Object has multiple Event interfaces and you don't want AutoIt to choose one automatically.

The Object responsible for the continuous rerouting is $EventObject. This variable does not require any further attention, unless you want to stop the events.

To stop rerouting Events, you can not just delete the variable like $EventObject="". The reason is that the 'calling' Object is still holding a reference to this variable, and it won't loose it until the Object itself quits. You could solve this problem by killing the 'calling' Object, but you can also tell the Object that you don't want to receive any events by using: $EventObject.Stop.  Then you can (but not really necessary) kill the Event by assigning it any value, like: $EventObject=""

If you know the names of the Events $oIE fires, you can implement the Events you are interested in by creating AutoIt UDF's with the name IE Event_Eventname(optional arguments). Be sure you use the correct number of arguments and in their correct order as specified for THAT Event function.  Otherwise you might end up with unexpected values.

If you don't know (for some reason) the names of the events, you can add a UDF with only the prefix. In this example: Func IEEvent_($Eventname).
When an event is received and no IEEvent_ Eventname UDF exists, this function will be called instead and the name of the event will be placed in the variable $Eventname.

You don't have to implement ALL event functions. Those not implemented will just be ignored.

More script examples using COM Event functions can be found in the tests directory in the AutoIt 3.1.1.xx beta ZIP distribution file, downloadable from: http://www.autoitscript.com/autoit3/files/beta/autoit/COM/

Limitations on COM Events in AutoIt

Some Objects (like the 'WebBrowser') pass arguments to their Event Functions 'by reference'. This is intended to allow the user change these arguments and passing it back to the Object. However, AutoIt uses it's own variable scheme, which is not compatible to COM variables. This means that all values from Objects need to be converted into AutoIt variables, thus loosing the reference to the original memory space. Maybe in the near future we can solve this limitation for you !

COM Error Handling

Using COM without proper error handling can be very tricky. Especially when you are not familiar with the Objects in your script.

An AutoIt script will immediately stop execution when it detects a COM error. This is the default and also the safest setting. In this case you have to take measures in your script to prevent the error from happening.

Only if there is no way to prevent a COM error, you could install an "Error Handler" in which you take action after the error has happened. It is not a solution to make a buggy script work properly. Neither does it catch non-COM related script errors (e.g. declaration and syntax errors).

Error handling is implemented in the same way as a normal COM Event, using ObjEvent() and a user defined COM Event Function. The only difference is the usage of the fixed string "AutoIt.Error" as the name of the object.

An example:

Global $g_eventerror = 0 ; to be checked to know if com error occurs. Must be reset after handling.

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler

; Performing a deliberate failure here (object does not exist)
$oIE = ObjCreate("InternetExplorer.Application")
$oIE.visible = 1
$oIE.bogus
if $g_eventerror then Msgbox(0,"","the previous line got an error.")

Exit

; This is my custom error handler
Func MyErrFunc()
$HexNumber=hex($oMyError.number,8)
Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
"Number is: " & $HexNumber & @CRLF & _
"Windescription is: " & $oMyError.windescription )

$g_eventerror = 1 ; something to check for when this function returns
Endfunc

One thing is special about the Error Event Handler, and that is the Object it returns. This is an AutoIt Error Object that contains some useful properties and methods. It's implementation is partly based on the "Err" Object in VB(script):

Properties of the AutoIt Error Object:

.number | The Windows HRESULT value from a COM call
.windescription | The FormatWinError() text derived from .number
.source | Name of the Object generating the error (contents from ExcepInfo.source)
.description | Source Object's description of the error (contents from ExcepInfo.description)
.helpfile | Source Object's helpfile for the error (contents from ExcepInfo.helpfile)
.helpcontext | Source Object's helpfile context id number (contents from ExcepInfo.helpcontext)
.lastdllerror | The number returned from GetLastError()
.scriptline | The script line on which the error was generated

Methods of the AutoIt Error Object:

.raise | Raises an error event, initiated by the user
.clear | Clears the contents of the Error Object (i.e. numbers to 0, strings to "")

A note for UDF writers

You can only have ONE Error Event Handler active per AutoIt script. If you are writing UDF's containing COM functions, you can check if the user has an Error Handler installed as follows:

$sFuncName = ObjEvent("AutoIt.Error")
if $sFuncName <> "" then Msgbox (0,"Test","User has installed Error Handler function: " & $sFuncName)

If no Error Handler was active, you can temporarily install your own during the UDF call.

However, you can never stop an existing Error Handler without releasing the variable it had been assigned to. If the script author had installed a COM Error Handler, it's his responsibility to use a proper function that will also be able to catch COM errors generated by UDF's.

OLE/COM Object Viewer

The "OLE/COM Object Viewer" is a very handy tool to get a peek on all COM objects currently installed on your system. It is part of the Windows 2000 resource kit and can be downloaded for free from: http://www.microsoft.com/downloads/details.aspx?familyid=5233b70d-d9b2-4cb5-aeb6-45664be858b6&displaylang=en

The setup of this program is a bit awkward. It will not create any start menu icon for you. Instead, a file called oleview.exe will be installed in the C:\Program Files\Resource Kit directory (default install).

When running oleview.exe, some systems will complain about a missing file called iviewers.dll. This file is required, but strangely enough not included in the latest setup. You can obtain this dll from an older version of oleview.exe at: http://download.microsoft.com/download/2/f/1/2f15a59b-6cd7-467b-8ff2-f162c3932235/ovi386.exe. It will install the files by default to the C:\MSTOOLS\BIN directory. You only need the file iviewer.dll. Copy it to the same directory where oleview.exe resides, then register the dll using the command line: regsvr32 iviewers.dll.

Let's do an example with the Oleviewer. Run it and follow this tree: Object Classes->Grouped by Component Category->Control->Microsoft Web Browser.

In the left column you see all COM Interfaces that have been defined for this object. We talk about those later. Take a closer look at the right column. It contains a lot of information to use this object in an AutoIt script. Most important is the "VersionIndependentProgID". This is the name to be used in an ObjCreate, ObjGet or ObjEvent function. Furthermore it contains the directory and filename that contains the object. This can be an EXE, a DLL or an OCX file. InProcServer32 means that the object runs in the same thread as your script (in-process). When you see LocalServer32, the object runs as a separate process. The object must also contain a type library (the lines following "TypeLib="), otherwise it can't be used in an AutoIt script.

The interfaces in the left column are used for several ways of interacting with the object. Some are used for storage (IStorage, IPersist), others for embedding in a GUI (IOleObject, IOleControl). AutoIt uses the IDispatch interface for automation. This interface 'exposes' all scriptable methods and properties that the object supports. If it does not exist, you can't use the object in an AutoIt script.

Let's take a look at this interface. Right-click on the name IDispatch and choose "View..." from the context menu. Then click the "View TypeInfo..." button. (Note: if this button is grayed out, you did not have registered the iviewers.dll file, or the object does not have a type library)

The "ITypeInfo Viewer" window does only show the information that is provided with the object. If the developer decides not to include a help file, you will only see the names of the method/properties and nothing else. The "Microsoft Web Browser" type library is however quite extensive. Just click an item in the left column, and a description will be shown at the right. Sometimes you have to browse through "Inherited Interfaces" to retrieve more methods for the object.

The syntax of the described methods/properties are in C/C++ style. A property described as "HRESULT Resizable([in] VARIANT_BOOL pbOffline)", has to be rewritten in AutoIt like: $Resizable=$Object.Resizable ($Object holds the object created with ObjCreate or ObjGet).

COMmonly mixed up terms

These terms are commonly mixed up with COM, but have a different meaning:

OOP = Object Oriented Programming. A programming technique in which software components are put together from reusable building blocks known as Objects.

DDE = Dynamic Data Exchange.

You can say this is the predecessor of COM. It used IPC to transfer information and commands between different applications.

OLE =Object Linking and Embedding

In his first version, OLE was an extended version of DDE to 'embed' data from one program into another. The current generation of OLE is built on top of COM and is part of ActiveX.

Automation = This is a way of manipulating another application's objects. It is used in OLE, ActiveX and COM.

ActiveX = The next generation OLE with Automation, at first mainly developed to interface between applications over a network (especially web browsers). ActiveX is built on top of COM.

DCOM=Distributed COM. A slight modification to COM, making it able to communicate between different physical computers.

.NET (dot Net)= This is not really a piece of software, but an 'idea' from Microsoft to interconnect just about "everything" through (their) software. "dot Net" is used mainly for Web-based services.

COMmunist = This is not a supporter of COM, but someone who believes in communism (a theory that the common people should own all the property).


Keywords

Keyword Reference

Below is a complete list of the keywords available in AutoIt. Click on a keyword name for a detailed description.

Keyword | Description
False / True | Boolean values for use in logical expressions.
#comments-start | Specify that an entire section of script should be commented out.
ContinueCase | Abort the current case and continue a case into the next case in a Select or Switch block.
ContinueLoop | Continue a While/Do/For loop.
Default | Keyword value use in function call.
Dim / Global / Local / Const | Declare a variable, a constant, or create an array.
Do...Until | Loop based on an expression.
Enum | Enumerates constants.
Exit | Terminates the script.
ExitLoop | Terminate a While/Do/For loop.
For...To...Step...Next | Loop based on an expression.
For...In...Next | Enumerates elements in an Object collection or an array
Func...Return...EndFunc | Defines a user-defined function that takes zero or more arguments and optionally returns a result.
If...Then | Conditionally run a single statement.
If...ElseIf...Else...EndIf | Conditionally run statements.
#include-once | Specifies that the current file may only be included once.
#include | Includes a file in the current script.
#NoAutoIt3Execute | Specifies that the current compiled script cannot run with /AutoIt3ExecuteLine or /AutoIt3ExecuteScript switch.
#NoTrayIcon | Indicates that the AutoIt tray icon will not be shown when the script starts.
#OnAutoItStartRegister | Registers a function to be called when AutoIt starts.
ReDim | Resize an existing array
#RequireAdmin | Specifies that the current script requires full administrator rights to run.
Select...Case...EndSelect | Conditionally run statements.
Static | Declare a static variable or create a static array.
Switch...Case...EndSwitch | Conditionally run statements.
While...WEnd | Loop based on an expression.
With...EndWith | Used to reduce long references to object type variables


Keyword #comments-start

Keyword Reference

#comments-start

Specify that an entire section of script should be commented out.

#comments-start
...
...
#comments-end

Parameters

None.

Remarks

The #comments-start and #comments-end directives can be nested.
You can also use the abbreviated keywords #cs and #ce.
Additionally, the directives themselves can be commented out!

Related

Example

#comments-start
MsgBox(4096, "", "This won't be executed")
MsgBox(4096, "", "Or this")
#comments-end

;;; #cs
MsgBox(4096, "", "This will print if '#cs' is commented out.")
#ce


Keyword #include

Keyword Reference

#include

Includes a file in the current script.

#include "[path\]filename"
#include <filename>

Parameters

filename The filename of the current script to include. Path is optional. This must be a string--it cannot be a variable.
If "..." is used, the filename is taken to be relative to the current script.
If <...> is used the filename is taken to be relative to include library directory (usually C:\Program Files\AutoIt3\Include). The include library contains many pre-written user-functions for you to use!

Remarks

In an AutoIt script, other scripts can be included using the #include" command.

If you include the same file containing a user-function more than once you will get a "Duplicate function" error. When writing an include file that may be used in this way, make sure that the top line contains #include-once to prevent that file from being included more than once.

There is a special registry value that can be created at "HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt" called "Include". It should be a REG_SZ (string) value. The contents of this value are a semi-colon delimited list of directories that should be searched for files when resolving #include's in addition to the standard locations.

The search order used by AutoIt depends on which form of #include you use. The tables below show the order directories are searched using both forms.

Using #include <>
Standard library | The path of the currently running interpreter with "\Include" appended is searched.
User-defined libraries | The registry value mentioned above is read and each directory is searched in the order they appear in.
Script directory | The directory of the currently executing script.

Using #include "" (This is the reverse of #include <>).
Script directory | The directory of the currently executing script.
User-defined libraries | The registry value mentioned above is read and each directory is searched in the reverse order they appear in.
Standard library | The path of the currently running interpreter with "\Include" appended is searched.

A note about using the /AutoIt3ExecuteScript option. Since the standard library is searched for in the current interpreter's directory, the standard library functions will not be found; that library will only be found when run through AutoIt3.exe. It's recommended that you compile a script to the .a3x format before attempting to run it with /AutoIt3ExecuteScript.

Aut2Exe uses the same algorithm as AutoIt3.exe with the only difference being it looks for the Include sub-directory as being in a sibling directory to itself (..\Include).

If Opt("TrayIconDebug",1) only 64 include files name can be displayed in the traytooltip. for the other no filename will be displayed.

Related

#include-once

Example

;;; TIME.AU3 ;;;
MsgBox(0,"", "The time is " & @HOUR & ":" & @MIN & ":" & @SEC)

;;; SCRIPT.AU3 ;;;
#include "TIME.AU3"
MsgBox(0,"", "Example")
#include "TIME.AU3"
Exit

; Running script.au3 will output three message boxes:
; one with the time, one with 'Example', and another with the time.


Keyword #include-once

Keyword Reference

#include-once

Specifies that the current file may only be included once.

#include-once

Parameters

None.

Remarks

If you include the same file containing a user-function more than once, you will get a "Duplicate function" error. When writing an include file that may be used in this way, make sure that the top line contains #include-once to prevent that file from being included more than once.

Related

#include

Example

;;; LIBRARY.AU3 ;;;
#include-once

Func myFunc()
MsgBox(0,"", "Hello from library.au3")
EndFunc

;;; SCRIPT.AU3 ;;;
#include "Library.au3"
#include "Library.au3" ;throws an error if #include-once was not used

MsgBox(0, "Example", "This is from 'script.au3' file")
myFunc()
Exit

; Running script.au3 will output the two message boxes:
; one saying "This is from 'script.au3' file"
; and another saying "Hello from library.au3"


Keyword #NoTrayIcon

Keyword Reference

#NoTrayIcon

Indicates that the AutoIt tray icon will not be shown when the script starts.

#NoTrayIcon

Parameters

None.

Remarks

It is possible to use Opt("TrayIconHide", 1) to remove the AutoIt tray icon but it will still be visible for a second when the script starts. Placing the #NoTrayIcon directive at the top of your script will stop the icon from being shown at startup.

You may still turn the icon back on later in the script using Opt("TrayIconHide", 0)

Related

TrayIconHide (Option)

Example

#NoTrayIcon
MsgBox(4096,"Click OK","Show the tray icon for 5 seconds...")
Opt("TrayIconHide", 0) ;un-hide the icon
Sleep(5000)


Keyword #OnAutoItStartRegister

Keyword Reference

#OnAutoItStartRegister

Registers a function to be called when AutoIt starts.

#OnAutoItStartRegister "function"

Parameters

function The name of the user function to call.

Remarks

Related

Example

#OnAutoItStartRegister "MyTestFunc"
#OnAutoItStartRegister "MyTestFunc2"

Sleep(1000)

Func MyTestFunc()
MsgBox(64, "Start Results 2", 'Start Message from MyTestFunc()')
EndFunc

Func MyTestFunc2()
MsgBox(64, "Start Results 3", 'Start Message from MyTestFunc()')
EndFunc


Keyword #NoAutoIt3Execute

Keyword Reference

#NoAutoIt3Execute

Specifies that the current compiled script cannot run with /AutoIt3ExecuteLine or /AutoIt3ExecuteScript switch.

#NoAutoIt3Execute

Parameters

None.

Remarks

Launching a compiled script is terminated with exit code = -1 if /AutoIt3ExecuteLine or /AutoIt3ExecuteScript are used.

Related

None.


Keyword #RequireAdmin

Keyword Reference

#RequireAdmin

Specifies that the current script requires full administrator rights to run.

#RequireAdmin

Parameters

None.

Remarks

This function was primarily aimed at allowing AutoIt scripts to work correctly with Windows Vista User Account Control (UAC) (However, will also work on Windows 2000 and Windows XP).

For more details see AutoIt on Windows Vista.

As this function launch a new process, some functions as Consolewrite() cannot be captured (Scite will not display anything).

Related

IsAdmin

Example

#RequireAdmin

MsgBox(4096,"Info","Now running with admin rights")


Keyword Func...Return...EndFunc

Keyword Reference

Func...Return...EndFunc

Defines a user-defined function that takes zero or more arguments and optionally returns a result.

Func functioname ( [Const] [ByRef] $param1, ..., [Const] [ByRef] $paramN, $optionalpar1 = value, ...)
...
[Return [value]]
EndFunc

Parameters

The parameters are set by you. You later call the function like any other built-in function.

Remarks

The Const keyword is optional and indicates that the value of the parameter will not change during the execution of the function. A variable declared Const can only be passed to a function using a Const parameter.

The ByRef keyword indicates the parameter should be treated as a reference to the original object. The default behavior copies the parameter into a new variable however ByRef links the new variable to the original parameter. ByRef is typically preferred when a function expects large amounts of data, such as a large array, where copying all the data would impose a significant performance penalty. Note that not only a named variable can be passed for a ByRef parameter; unnamed temporary variables, such as function return values, may be passed as ByRef parameters as well. A literal can not be passed to a ByRef parameter.

If using both keywords ByRef and Const with a function parameter, the order of the keywords is not important, so long as they are both in front of the variable they modify.

Entire arrays can be passed to functions (and returned from them) by simply using the array name without any brackets. Arrays should be passed to user-defined functions using the ByRef keyword to avoid the overhead of copying all the data in the array.

Optional parameters are defined by assigning a default value to them. The value may be a global variable, macro or literal value. Optional parameters always appear last in the function definition. All parameters added after the first optional parameter must also be optional. Inside the function, the number of parameters given when the function was called can be retrieved with the @NUMPARAMS macro (see example 2).

Use the Return keyword to exit the function. Unlike built-in functions, user-defined functions return 0 unless another return value is specified.

Note that function declarations cannot appear inside other function declarations.

Related

Dim/Global/Local, #include, Const

Example

Opt('MustDeclareVars', 1)

Example1()
Example2()

; example1
Func Example1()
; Sample script with three user-defined functions
; Notice the use of variables, ByRef, and Return

Local $foo = 2
Local $bar = 5
msgBox(0,"Today is " & today(), "$foo equals " & $foo)
swap($foo, $bar)
msgBox(0,"After swapping $foo and $bar", "$foo now contains " & $foo)
msgBox(0,"Finally", "The larger of 3 and 4 is " & max(3,4))
EndFunc ;==>Example1

Func swap(ByRef $a, ByRef $b) ;swap the contents of two variables
Local $t
$t = $a
$a = $b
$b = $t
EndFunc

Func today() ;Return the current date in mm/dd/yyyy form
return (@MON & "/" & @MDAY & "/" & @YEAR)
EndFunc

Func max($x, $y) ;Return the larger of two numbers
If $x > $y Then
return $x
Else
return $y
EndIf
EndFunc

;End of sample script 1

; example2
Func Example2()
; Sample scriptusing @NumParams macro
Test_Numparams(1,2,3,4,5,6,7,8,9,10,11,12,13,14)
EndFunc ;==>Example2

Func Test_Numparams($v1 = 0, $v2 = 0, $v3 = 0, $v4 = 0, $v5 = 0, $v6 = 0, $v7 = 0, $v8 = 0, $v9 = 0, _
$v10 = 0, $v11 = 0, $v12 = 0, $v13 = 0, $v14 = 0, $v15 = 0, $v16 = 0, $v17 = 0, $v18 = 0, $v19 = 0)
Local $val
For $i = 1 To @NumParams
$val &= Eval("v" & $i) & " "
Next
MsgBox(0, "@NumParams example", "@NumParams =" & @NumParams & @CRLF & @CRLF & $val)
EndFunc

;End of sample script 2


Keyword Dim / Global / Local / Const

Keyword Reference

Dim / Global / Local / Const

Declare a variable, a constant, or create an array.

Dim [Const] $variable [ = initializer ]
Dim [Const] $array[subscript 1]...[subscript n] [ = initializer ]

Parameters

const | [optional] If present, the Const keyword creates a constant rather than a variable.
$variable | The name of the variable/constant to declare.
initializer | The value that will be initially assigned to the variable. A Const must include the initializer. The initializer can be a function call.
subscript | The number of elements to create for the array dimension, indexed 0 to n-1.

Remarks

The Dim/Local/Global keywords perform similar functions:
1. Declare a variable before you use it (similar to VBScript)
2. Create an array

Note: In AutoIt you can create a variable simply by assigning a value ($myvar = 0) but many people like to explicitly declare them. If AutoItSetOption("MustDeclareVars", 1) is active, then variables must be declared prior to use.

You can also declare multiple variables on a single line:

Dim $a, $b, $c

And initialize the variables:

Dim $a = 2, $b = 10, $c = 20

Creating constants can be done in a similar way:

Const $a = 2, $b = 10, $c = 20
Dim Const $d = 21, $e = Exp(1)
Local Const $f = 5, $g = 7, $h = -2

Once created, you cannot change the value of a constant. Also, you cannot change an existing variable into a constant.

To initialize an array, specify the values for each element inside square brackets, separated by commas. For multiple dimensions, nest the initializers. You can specify fewer elements in the initializer than declared, but not more. Function calls can also be placed in the initializers of an array. If the function call returns an array, then the one array element will contain that returned array.

Dim $Array1[12]=[3, 7.5, "string"], $array[5] = [8, 4, 5, 9, 1]
Dim $Grid[2][4]=[["Paul", "Jim", "Richard", "Louis"], [485.44, 160.68, 275.16, 320.00]]
Dim $Test[5] = [3, 1, StringSplit("Abe|Jack|Bobby|Marty", "|"), Cos(0)]

The difference between Dim, Local and Global is the scope in which they are created:
Dim = Local scope if the variable name doesn't already exist globally (in which case it reuses the global variable!)
Global = Forces creation of the variable in the Global scope
Local = Forces creation of the variable in the Local/Function scope

You should use Local or Global, instead of Dim, to explicitly state which scope is desired for a variable/constant/array.

When using variables, the local scope is checked first and then the global scope second.

When creating arrays you are limited to up to 64 dimensions and/or a total of 16 million elements.

A unique feature in AutoIt is the ability to copy arrays like this:
$mycopy = $myarray
In this case $mycopy will be an exact copy of $myarray and will have the same dimensions - no Dim statement is required to size the array first. If AutoItSetOption("MustDeclareVars", 1) is active then the variable $mycopy would still need to be declared first, but would not need to be sized. If the variable $mycopy was already an array or single value it will be erased before the copy takes place.

To erase an array (maybe because it is a large global array and you want to free the memory), simply assign a single value to it:
$array = 0
This will free the array and convert it back to the single value of 0.

Declaring the same variable name again will erase all array values and reset the dimensions to the new definition. Declaring a variable with a simple value in the same scope will not change the value in the variable.

If you declare a variable with the same name as a parameter, using Local inside a user function, an error will occur. Global can be used to assign to global variables inside a function, but if a local variable (or parameter) has the same name as a global variable, the local variable will be the only one used. It is recommended that local and global variables have distinct names.

Related

UBound, ReDim, Static, AutoItSetOption

Example

; Example 1 - Declaring variables
Dim $x, $y = 23, $z
Global $_PI = 3.14159, $RADIUS
Local $_daysWorking = 5

; Example 2 - Declaring arrays
Dim $weeklyWorkSchedule[$_daysWorking]
Global $chessBoard[8][8]
Local $mouseCoordinates[2], $windowStats[4]

; Example 3 - Declaring constant variables
Const $x1 = 11, $y1 = 23, $z1 = 55
Global Const $PI = 3.14159, $E = 2.71828
Local Const $daysWorking = 5


Keyword ContinueCase

Keyword Reference

ContinueCase

Abort the current case and continue a case into the next case in a Select or Switch block.

ContinueCase

Parameters

None.

Remarks

Normally in a Select or Switch block, a case ends when the next Case statement is encountered. Executing the ContinueCase will tell AutoIt to stop executing the current case and start executing the next case.

Trying to execute ContinueCase outside of a Select or Switch will cause a fatal error.

Related

Select...EndSelect, Switch...EndSwitch

Example

$msg = ""
$szName = InputBox(Default, "Please enter a word.", "", " M", Default, Default, Default, Default, 10)
Switch @error
Case 2
$msg = "Timeout "
ContinueCase
Case 1; Continuing previous case
$msg &= "Cancellation"
Case 0
Switch $szName
Case "a", "e", "i", "o", "u"
$msg = "Vowel"
Case "QP"
$msg = "Mathematics"
Case "Q" to "QZ"
$msg = "Science"
Case Else
$msg = "Others"
EndSwitch
Case Else
$msg = "Something went horribly wrong."
EndSwitch

MsgBox(0, Default, $msg)


Keyword ContinueLoop

Keyword Reference

ContinueLoop

Continue a While/Do/For loop.

ContinueLoop [level]

Parameters

level [optional] The level of the loop to restart. The default is 1 (meaning the current loop).

Remarks

ContinueLoop will continue execution of the loop at the expression testing statement (that is the While, Until or Next statement).

A negative level or zero value has no effect.

Even though any program that uses ContinueLoop can be rewritten using If-ElseIf-EndIf statements, ContinueLoop can make long scripts easier to understand.
Be careful with While/Do loops; you can create infinite loops by using ContinueLoop incorrectly.

Related

ExitLoop, For, While, Do

Example

;Print all numbers from 1 to 10 except number 7
For $i = 1 to 10
If $i = 7 Then ContinueLoop
MsgBox(0, "The value of $i is:", $i)
Next

;Example of using level is needed.


Keyword Default

Keyword Reference

Default

Keyword value use in function call.

$var = Default

Parameters

None.

Remarks

This keyword should not be used in a general computation expression. AutoIt will not detect such situations because it has too much of a performance penalty.

When used in parameter passing, the behavior is specified in the corresponding AutoIt function documentation.
For UDF's, it is the scripter's responsiblity to check if the parameter has been set to Default and to perform the desired behavior in this situation.
If used, the passed parameter will be set to the Default keyword and not to an optional parameter value, if defined.

Related

IsKeyWord

Example

WinMove("[active]","",default, default, 200,300) ; just resize the active window (no move)

MyFunc2(Default,Default)

Func MyFunc2($Param1 = Default, $Param2 = 'Two', $Param3 = Default)
If $Param1 = Default Then $Param1 = 'One'
If $Param3 = Default Then $Param3 = 'Three'

MsgBox(0, 'Params', '1 = ' & $Param1 & @LF & _
'2 = ' & $Param2 & @LF & _
'3 = ' & $Param3)
EndFunc


Keyword Do...Until

Keyword Reference

Do...Until

Loop based on an expression.

Do
statements
...
Until <expression>

Parameters

expression The statements in between Do and Until are executed until the expression is true.

Remarks

Do...Until statements may be nested.
The expression is tested after the loop is executed, so the loop will be executed one or more times.

Related

ContinueLoop, ExitLoop

Example

$i = 0
Do
MsgBox(0, "Value of $i is:", $i)
$i = $i + 1
Until $i = 10


Keyword Enum

Keyword Reference

Enum

Enumerates constants.

[scope] Enum [Step <stepval>] <constantlist>

Parameters

scope | [optional] The scope the Enum should be placed in, either Local, Global, Dim or none. If none, Dim behavior is used.
stepval | [optional] The default step is to add 1. Other possible step methods are: *n, +n, -n where n is a whole number.
constantlist | A list constants to be enumerated.

Remarks

By default, the first constant will be 0 and the rest will be incremented by 1 from there.
When using the multiply operator to step, the first constant will be assigned 1 and the rest will be multiplied based on the previous constant value.
Constants can be explicitly assigned by any valid statement.

Related

Example

Global Enum $E1VAR1, $E1VAR2, $E1VAR3
MsgBox(4096, "", "Expect 0: " & $E1VAR1)
MsgBox(4096, "", "Expect 1: " & $E1VAR2)
MsgBox(4096, "", "Expect 2: " & $E1VAR3)

Global Enum $E2VAR1 = 10, $E2VAR2, $E2VAR3 = 15
MsgBox(4096, "", "Expect 10: " & $E2VAR1)
MsgBox(4096, "", "Expect 11: " & $E2VAR2)
MsgBox(4096, "", "Expect 15: " & $E2VAR3)

Global Enum Step *2 $E3VAR1, $E3VAR2, $E3VAR3
MsgBox(4096, "", "Expect 1: " & $E3VAR1)
MsgBox(4096, "", "Expect 2: " & $E3VAR2)
MsgBox(4096, "", "Expect 4: " & $E3VAR3)


Keyword Exit

Keyword Reference

Exit

Terminates the script.

Exit [return code]

Parameters

return code [optional] Integer that sets the script's return code. This code can be used by Windows or the DOS variable %ERRORLEVEL%. The default is 0. Scripts normally set an errorlevel of 0 if the script executed properly; error levels 1 and above typically indicate that the script did not execute properly.

Remarks

The parameter, if included, can be enclosed in parentheses. Thus, the following are equivalent: Exit, Exit 0, and Exit(0). However, Exit() is invalid.

The code can be retrieved in an OnAutoItExitRegister function by @EXITCODE.

Related

ExitLoop, OnAutoItExitRegister

Example

;First Example
Exit

;Second Example
; Terminate script if no command-line arguments
If $CmdLine[0] = 0 Then Exit(1)

;Third Example
; Open file specified as first command-line argument
$file = FileOpen($CmdLine[1], 0)

; Check if file opened for reading OK
If $file = -1 Then Exit(2)

; If file is empty then exit (script is successful)
$line = FileReadLine($file)
If @error = -1 Then Exit

;code to process file goes here
FileClose($file)
Exit ;is optional if last line of script


Keyword ExitLoop

Keyword Reference

ExitLoop

Terminate a While/Do/For loop.

ExitLoop [level]

Parameters

level [optional] The number of loop levels to exit from. The default is 1 (meaning the current loop).

Remarks

A negative level or zero value has no effect.

ExitLoop will break out of a While, Do or For loop.
ExitLoop is useful when you would otherwise need to perform error checking in both the loop-test and the loop-body.

Related

ContinueLoop, Exit, For, Do, While

Example

$sum = 0
While 1 ;use infinite loop since ExitLoop will get called
$ans = InputBox("Running total=" & $sum, _
" Enter a positive number. (A negative number exits)")
If $ans < 0 Then ExitLoop
$sum = $sum + $ans
WEnd
MsgBox(0,"The sum was", $sum)


Keyword False / True

Keyword Reference

False / True

Boolean values for use in logical expressions.

$var = False
$var = True

Parameters

None.

Remarks

These keywords should not be used in expressions as AutoIt will not detect this 'misuse' and the results will be unpredictable.

Related

Example

$bool= False
if NOT $bool = true Then Msgbox(0,"Bool comparison", "OK")


Keyword For...To...Step...Next

Keyword Reference

For...To...Step...Next

Loop based on an expression.

For <variable> = <start> To <stop> [Step <stepval>]
statements
...
Next

Parameters

variable | The variable used for the count.
start | The initial numeric value of the variable.
stop | The final numeric value of the variable.
stepval | [optional] The numeric value (possibly fractional) that the count is increased by each loop. Default is 1.

Remarks

The Variable will be created automatically with a LOCAL scope, even when MustDeclareVars is on.

For...Next statements may be nested. The For loop terminates when the value of variable exceeds the stop threshold. If stepVal or stop is a variable, its value is only read the first time the loop executes.

A For loop will execute zero times if:
start > stop and step > 0, or
start < stop and step is negative

Related

ContinueLoop, ExitLoop

Example

For $i = 5 to 1 Step -1
MsgBox(0, "Count down!", $i)
Next
MsgBox(0,"", "Blast Off!")


Keyword For...In...Next

Keyword Reference

For...In...Next

Enumerates elements in an Object collection or an array

For <$Variable> In <expression>
statements
...
Next

Parameters

Variable | A variable to which an element is being assigned
expression | Must be an expression resulting in an Object, or an Array with at least one element

Remarks

The Variable will be created automatically with a LOCAL scope, even when MustDeclareVars is on.
If the expression is an Object collection with no elements, or an multi-dimensional array, the loop will be skipped and the Variable will contain an empty string.
If the expression is not an Object nor an Array, the script stops with an error, unless a COM Error handler had been configured.
Autoit Array's are read-only when using For...In. While you can assign the variable inside the For...In loop a value, this change is not reflected in the array itself. To modify the contents of an array during enumeration, use a For...To loop.

For...In...Next statements may be nested.

Related

With...EndWith

Example

;Using an Array
Dim $aArray[4]

$aArray[0]="a"
$aArray[1]=0
$aArray[2]=1.3434
$aArray[3]="test"

$string = ""
FOR $element IN $aArray
$string = $string & $element & @CRLF
NEXT

Msgbox(0,"For..IN Arraytest","Result is: " & @CRLF & $string)

;Using an Object Collection

$oShell = ObjCreate("shell.application")
$oShellWindows=$oShell.windows

if Isobj($oShellWindows) then
$string=""

for $Window in $oShellWindows
$String = $String & $Window.LocationName & @CRLF
next

msgbox(0,"","You have the following windows open:" & @CRLF & $String)
else

msgbox(0,"","you have no open shell windows.")
endif


Keyword If...Then

Keyword Reference

If...Then

Conditionally run a single statement.

If <expression> Then statement

Parameters

expression If the expression is true, the statement is executed.

Remarks

This version of the If statement is used to execute a single statement without the overhead of an EndIf.
The expression can contain the boolean operators of AND, OR, and NOT as well as the logical operators <, <=, >, >=, =, ==, and <> grouped with parentheses as needed.

Related

If...Else...EndIf, Select...Case...EndSelect, Switch...EndSwitch

Example

;Terminates script if no command-line arguments
If $CmdLine[0] = 0 Then Exit

;Alternative:
If $CmdLine[0] = 0 Then
Exit
EndIf


Keyword If...ElseIf...Else...EndIf

Keyword Reference

If...ElseIf...Else...EndIf

Conditionally run statements.

If <expression> Then
statements
...
[ElseIf expression-n Then
[elseif statements ... ]]
...
[Else
[else statements]
...
EndIf

Parameters

expression If the expression is true, the first statement block is executed. If not, the first true ElseIf block is executed. Otherwise, the "Else" block is executed.

Remarks

If statements may be nested.
The expression can contain the boolean operators of AND, OR, and NOT as well as the logical operators <, <=, >, >=, =, ==, and <> grouped with parentheses as needed.

Related

If...Then, Select...Case...EndSelect, Switch...EndSwitch

Example

If $var > 0 Then
MsgBox(4096,"", "Value is positive.")
ElseIf $var < 0 Then
MsgBox(4096,"", "Value is negative.")
Else
If StringIsXDigit ($var) Then
MsgBox(4096,"", "Value might be hexadecimal!")
Else
MsgBox(4096,"", "Value is either a string or is zero.")
EndIf
EndIf


Keyword ReDim

Keyword Reference

ReDim

Resize an existing array

ReDim $array[subscript 1]...[subscript n]

Parameters

$array | The name of the array to resize.
subscript | The number of elements to create for the array dimension, indexed 0 to n-1.

Remarks

The ReDim keyword is similar to Dim, except that ReDim preserves the values in the array instead of removing the values while resizing an array. The number of dimensions must remain the same, or the old array will be forgotten during the ReDim. The array will retain the scope (Global or Local) that it had prior to resizing.

Related

Dim, UBound

Example

; Example Resizing an array
Dim $I, $K, $T, $MSG
Dim $X[4][6], $Y[4][6]

For $I = 0 To 3
For $K = 0 To 5
$T = Int(Random(20) + 1) ;Get random numbers between 1 and 20
$X[$I][$K] = $T
$Y[$I][$K] = $T
Next
Next

ReDim $X[3][8]
Dim $Y[3][8]

$MSG = ""
For $I = 0 To UBound($X, 1) - 1
For $K = 0 To UBound($X, 2) - 1
If $K > 0 Then $MSG = $MSG & ", "
$MSG = $MSG & $X[$I][$K]
Next
$MSG = $MSG & @CR
Next
MsgBox(0, "ReDim Demo", $MSG)

$MSG = ""
For $I = 0 To UBound($Y, 1) - 1
For $K = 0 To UBound($Y, 2) - 1
If $K > 0 Then $MSG = $MSG & ", "
$MSG = $MSG & $Y[$I][$K]
Next
$MSG = $MSG & @CR
Next
MsgBox(0, "ReDim Demo", $MSG)


Keyword Select...Case...EndSelect

Keyword Reference

Select...Case...EndSelect

Conditionally run statements.

Select
Case <expression>
statement1
...
[Case
statement2
...]
[Case Else
statementN
...]
EndSelect

Parameters

Case <expression> If the expression is true the following statements up to the next Case or EndSelect statement are executed. If more than one of the Case statements are true, only the first one is executed.

Remarks

Select statements may be nested.
The expression can contain the boolean operators of AND, OR, and NOT as well as the logical operators <, <=, >, >=, =, ==, and <> grouped with parentheses as needed.

Related

If...Then, If...Else...EndIf, Switch...EndSwitch, ContinueCase

Example

$var = 0
$var2= ""

Select
Case $var = 1
MsgBox(0, "", "First Case expression was true")
Case $var2 = "test"
MsgBox(0, "", "Second Case expression was true")
Case Else
MsgBox(0, "", "No preceding case was true!")
EndSelect


Keyword Static

Warning: This feature is experimental. It may not work, may contain bugs or may be changed or removed without notice.

DO NOT REPORT BUGS OR REQUEST NEW FEATURES FOR THIS FEATURE.

USE AT YOUR OWN RISK.

Keyword Reference

Static

Declare a static variable or create a static array.

Static [Scope] $variable [ = initializer ]
Static [Scope] $array[subscript 1]...[subscript n] [ = initializer ]

Parameters

Scope | An optional modifier, Local or Global that indicates where the variable is visible.
$variable | The name of the static variable to declare.
initializer | The value that will be initially assigned to the variable. The initializer can be a function call of involve mathematical or string operations. This initializer is only evaluated the first time this variable declaration is encountered.
subscript | The number of elements to create for the array dimension, indexed 0 to n-1.

Remarks

The Static keyword can appear on the line before the optional scope specifier, or after. e.g. Local Static or Static Local are both acceptable.

If the scope modifier Local is used, then the static variable is visible and usable only in the function in which it is declared. If the scope modifier Global is used, then the static variable is visible and usable in all parts of the script; in this regard, a Global Static has very little difference from a Global variable. If the scope modifier is not used, then the static variable will be created in the local scope; in this way, Static is similar to Dim.

The difference between Local and Static is variable lifetime. Local variables are only stored while the function is called and are visible only within the function in which they are declared; when the function returns, all its local variables are released. Static variables are likewise visible only in the function in which they are declared, but they continue to exist, retaining their last value, after the function finishes execution. When looking for variables, the local scope is checked first and then the global scope second.

The Static keyword performs similar functions to the Global/Local/Dim keywords.
  1. They all declare a variable before you use it.

  2. They all can create an array.

Note: Static variables must be declared using the Static keyword prior to use, no matter how AutoItSetOption("MustDeclareVars") is set. Static variables can not be Const.

You can also declare multiple static variables on a single line:

Static $a, $b, $c

And initialize the variables:

Static $a = 2, $b = 10, $c = 20

When initializing a static variable, the initialization value is evaluated and assigned only the first time, when the variable is created. On all subsequent passes, the initializer is ignored.

See Local for more information about using arrays, which has all the same functionality as in Local, except for:
  1. Reinitalizing a Static variable has no effect.

  2. Changing the size of a Static array is treated like a ReDim.

  3. You can not change a static variable to a local or global variable nor vice-versa.

If you want to resize an array, always use Static to do so, not Redim.

Related

Local, UBound, ReDim, AutoItSetOption

Example

; Static variables examples.

Opt("MustDeclareVars", 1)

Func Test1()
Static $STbFirstPass = 1

If $STbFirstPass Then
$STbFirstPass = 0
; Perform tasks for the first time through
EndIf
; Other things the function should do
EndFunc ;==>Test1

Func Accumulate($State)
Static $Values[9]
Local $I

If IsNumber($State) Then
Switch $State
Case -1
; Reset
For $I = 0 To 8
$Values[$I] = 0
Next
Return True
Case -2
Return $Values
Case 0 To UBound($Values) - 1
$Values[$State] += 1
Return $Values[$State]
Case Else
If $State < 0 Then
SetError(1, 0)
Return False
Else
Static $Values[$State + 1] ; Resize the array to accomodate the new value
$Values[$State] = 1
Return 1
EndIf
EndSwitch
Else
SetError(2, 0)
EndIf
EndFunc ;==>Accumulate

Global $I

Test1()

For $I = 1 To 99
Accumulate(Random(0, 20, 1))
Next
For $I In Accumulate(-2)
ConsoleWrite($I & ", ")
Next
ConsoleWrite("\n");

Test1()


Keyword Switch...Case...EndSwitch

Keyword Reference

Switch...Case...EndSwitch

Conditionally run statements.

Switch <expression>
Case <value> [To <value>] [,<value> [To <value>] ...]
statement1
...
[Case <value> [To <value>] [,<value> [To <value>] ...]
statement2
...]
[Case Else
statementN
...]
EndSwitch

Parameters

<expression> | An expression that returns a value. The value from the expression is then compared against the values of each case until a match is found. This expression is always evaluted exactly once each time through the structure.
<value> To <value> | The case is executed if the expression is between the two values.
<value> | The case is executed if the expression matches the value.

Remarks

If no cases match the Switch value, then the Case Else section, if present, is executed. If no cases match and Case Else is not defined, then none of the code inside the Switch structure, other than the condition, will be executed.

Switch statements may be nested.

Related

If...Then, If...Else...EndIf, Select...EndSelect, ContinueCase

Example

Switch @HOUR
Case 6 To 11
$msg = "Good Morning"
Case 12 To 17
$msg = "Good Afternoon"
Case 18 To 21
$msg = "Good Evening"
Case Else
$msg = "What are you still doing up?"
EndSwitch

MsgBox(0, Default, $msg)


Keyword With...EndWith

Keyword Reference

With...EndWith

Used to reduce long references to object type variables

With <expression>
statements
...
EndWith

Parameters

expression Must be an object type expression

Remarks

With...EndWith statements may NOT be nested.

Related

For...In...Next

Example

$oExcel = ObjCreate("Excel.Application")
$oExcel.visible =1
$oExcel.workbooks.add

With $oExcel.activesheet
.cells(2,2).value = 1
.range("A1:B2").clear
EndWith

$oExcel.quit


Keyword While...WEnd

Keyword Reference

While...WEnd

Loop based on an expression.

While <expression>
statements
...
WEnd

Parameters

expression If the expression is true the following statements up to the WEnd statement are executed. This loop continues until the expression is false.

Remarks

While...WEnd statements may be nested.
The expression is tested before the loop is executed so the loop will be executed zero or more times.
To create an infinite loop, you can use a non-zero number as the expression.

Related

ContinueLoop, ExitLoop

Example

$i = 0
While $i <= 10
MsgBox(0, "Value of $i is:", $i)
$i = $i + 1
WEnd


Macros

Macro Reference

Below is an alphabetized list of all the macros available in AutoIt.

Macro | Description
@AppDataCommonDir | path to Application Data
@AppDataDir | path to current user's Application Data
@AutoItExe | The full path and filename of the AutoIt executable currently running. For compiled scripts it is the path of the compiled script.
@AutoItPID | PID of the process running the script.
@AutoItVersion | Version number of AutoIt such as 3.0.81.0
@AutoItX64 | Returns 1 if the script is running under the native x64 version of AutoIt.
@COM_EventObj | Object the COM event is being fired on. Only valid in a COM event Function.
@CommonFilesDir | path to Common Files folder
@Compiled | Returns 1 if script is a compiled executable; otherwise, returns 0.
@ComputerName | Computer's network name.
@ComSpec value of %comspec%, the SPECified secondary COMmand interpreter;
primarily for command line uses, e.g. Run(@ComSpec & " /k help | more")
@CPUArch | Returns "X86" when the CPU is a 32-bit CPU and "X64" when the CPU is 64-bit.
@CR | Carriage return, Chr(13); sometimes used for line breaks.
@CRLF | = @CR & @LF ;occasionally used for line breaks.
@DesktopCommonDir | path to Desktop
@DesktopDir | path to current user's Desktop
@DesktopHeight | Height of the desktop screen in pixels. (vertical resolution)
@DesktopWidth | Width of the desktop screen in pixels. (horizontal resolution)
@DesktopDepth | Depth of the desktop screen in bits per pixel.
@DesktopRefresh | Refresh rate of the desktop screen in hertz.
@DocumentsCommonDir | path to Documents
@error | Status of the error flag. See the SetError function.
@exitCode | Exit code as set by Exit statement.
@exitMethod | Exit method. See the Func OnAutoItExitRegister().
@extended | Extended function return - used in certain functions such as StringReplace.
@FavoritesCommonDir | path to Favorites
@FavoritesDir | path to current user's Favorites
@GUI_CtrlId | Last click control identifier. Only valid in an event Function. See the GUICtrlSetOnEvent function.
@GUI_CtrlHandle | Last click control handle. Only valid in an event Function. See the GUICtrlSetOnEvent function.
@GUI_DragId | Drag control identifier. Only valid on Drop Event. See the GUISetOnEvent function.
@GUI_DragFile | Filename of the file being dropped. Only valid on Drop Event. See the GUISetOnEvent function.
@GUI_DropId | Drop control identifier. Only valid on Drop Event. See the GUISetOnEvent function.
@GUI_WinHandle | Last click GUI window handle. Only valid in an event Function. See the GUICtrlSetOnEvent function.
@HomeDrive | Drive letter of drive containing current user's home directory.
@HomePath | Directory part of current user's home directory. To get the full path, use in conjunction with @HomeDrive.
@HomeShare | Server and share name containing current user's home directory.
@HOUR | Hours value of clock in 24-hour format. Range is 00 to 23
@HotKeyPressed | Last hotkey pressed. See the HotKeySet function.
@IPAddress1 IP address of first network adapter. Tends to return 127.0.0.1 on some computers.
@IPAddress2 | IP address of second network adapter. Returns 0.0.0.0 if not applicable.
@IPAddress3 | IP address of third network adapter. Returns 0.0.0.0 if not applicable.
@IPAddress4 | IP address of fourth network adapter. Returns 0.0.0.0 if not applicable.
@KBLayout | Returns code denoting Keyboard Layout. See Appendix for possible values.
@LF | Line feed, Chr(10); typically used for line breaks.
@LogonDNSDomain | Logon DNS Domain.
@LogonDomain | Logon Domain.
@LogonServer | Logon server.
@MDAY | Current day of month. Range is 01 to 31
@MIN | Minutes value of clock. Range is 00 to 59
@MON | Current month. Range is 01 to 12
@MSEC | Milliseconds value of clock. Range is 00 to 999
@MUILang | Returns code denoting Multi Language if available (Vista is OK by default). See Appendix for possible values.
@MyDocumentsDir | path to My Documents target
@NumParams | Number of parameters used to call the user functions
@OSArch | Returns one of the following: "X86", "IA64", "X64" - this is the architecture type of the currently running operating system.
@OSBuild | Returns the OS build number. For example, Windows 2003 Server returns 3790
@OSLang | Returns code denoting OS Language. See Appendix for possible values.
@OSServicePack | Service pack info in the form of "Service Pack 3".
@OSType | Returns "WIN32_NT" for NT/2000/XP/2003/Vista/2008/Win7/2008R2.
@OSVersion | Returns one of the following: "WIN_2008R2", "WIN_7", "WIN_2008", "WIN_VISTA", "WIN_2003", "WIN_XP", "WIN_XPe", "WIN_2000".
@ProgramFilesDir | path to Program Files folder
@ProgramsCommonDir | path to Start Menu's Programs folder
@ProgramsDir | path to current user's Programs (folder on Start Menu)
@ScriptDir | Directory containing the running script. (Result does not contain a trailing backslash)
@ScriptFullPath | Equivalent to @ScriptDir & "\" & @ScriptName
@ScriptLineNumber | Line number of the currently executed script line. Useful for debug statements specially when a function is call you can pass the caller line number. (Not significant in complied script)
@ScriptName | Long filename of the running script.
@SEC | Seconds value of clock. Range is 00 to 59
@StartMenuCommonDir | path to Start Menu folder
@StartMenuDir | path to current user's Start Menu
@StartupCommonDir | path to Startup folder
@StartupDir | current user's Startup folder
@SW_DISABLE | Disables the window.
@SW_ENABLE | Enables the window.
@SW_HIDE | Hides the window and activates another window.
@SW_LOCK | Lock the window to avoid repainting.
@SW_MAXIMIZE | Maximizes the specified window.
@SW_MINIMIZE | Minimizes the specified window and activates the next top-level window in the Z order.
@SW_RESTORE | Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
@SW_SHOW | Activates the window and displays it in its current size and position.
@SW_SHOWDEFAULT | Sets the show state based on the SW_ value specified by the program that started the application.
@SW_SHOWMAXIMIZED | Activates the window and displays it as a maximized window.
@SW_SHOWMINIMIZED | Activates the window and displays it as a minimized window.
@SW_SHOWMINNOACTIVE | Displays the window as a minimized window. This value is similar to @SW_SHOWMINIMIZED, except the window is not activated.
@SW_SHOWNA | Displays the window in its current size and position. This value is similar to @SW_SHOW, except the window is not activated.
@SW_SHOWNOACTIVATE | Displays a window in its most recent size and position. This value is similar to @SW_SHOWNORMAL, except the window is not activated.
@SW_SHOWNORMAL | Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
@SW_UNLOCK | Unlock windows to allow painting.
@SystemDir | path to Windows' System (or System32) folder
@TAB | Tab character, Chr(9)
@TempDir | Path to the temporary files folder.
@TRAY_ID | Last clicked item identifier during a TraySet(Item)OnEvent action.
@TrayIconFlashing | Returns 1 if tray icon is flashing; otherwise, returns 0.
@TrayIconVisible | Returns 1 if tray icon is visible; otherwise, returns 0.
@UserProfileDir | Path to current user's Profile folder.
@UserName | ID of the currently logged on user.
@WDAY | Numeric day of week. Range is 1 to 7 which corresponds to Sunday through Saturday.
@WindowsDir | path to Windows folder
@WorkingDir | Current/active working directory. (Result does not contain a trailing backslash)
@YDAY | Current day of year. Range is 001 to 366 (or 001 to 365 if not a leap year)
@YEAR | Current four-digit year


Macros Reference - AutoIt Related

Macro Reference - AutoIt Related

Below is a list of AutoIt-related macros.

The full list of macros can be found here.

Macro | Description
@compiled | Returns 1 if script is a compiled executable; otherwise, returns 0.
@error | Status of the error flag. See the SetError function.
@exitCode | Exit code as set by Exit statement.
@exitMethod | See the Func OnAutoItExitRegister().
@extended | Extended function return - used in certain functions such as StringReplace.
@NumParams | Number of parameters used in calling the user function.
@ScriptName | Filename of the running script.
@ScriptDir | Directory containing the running script. (Result does not contain a trailing backslash)
@ScriptFullPath | Equivalent to @ScriptDir & "\" & @ScriptName
@ScriptLineNumber | Line number currently being executed. Useful for debug statements specially when a function is call you can pass the caller line number. (Not significant in compiled script)
@WorkingDir | Current/active working directory. (Result does not contain a trailing backslash)
@AutoItExe | The full path and filename of the AutoIt executable currently running. For compiled scripts it is the path of the compiled script.
@AutoItPID | PID of the process in which the script is running.
@AutoItVersion | Version number of AutoIt such as 3.0.102.0
@AutoItX64 | Returns 1 if the script is running under the native x64 version of AutoIt.
@COM_EventObj | Object the COM event is being fired on. Only valid in a COM event Function.
@GUI_CtrlId | Last click GUI Control identifier. Only valid in an event Function. See the GUICtrlSetOnEvent function.
@GUI_CtrlHandle | Last click GUI Control handle. Only valid in an event Function. See the GUICtrlSetOnEvent function.
@GUI_DragID | Drag GUI Control identifier. Only valid on Drop Event. See the GUISetOnEvent function.
@GUI_DragFile | Filename of the file being dropped. Only valid on Drop Event. See the GUISetOnEvent function.
@GUI_DropID | Drop GUI Control identifier. Only valid on Drop Event. See the GUISetOnEvent function.
@GUI_WinHandle | Last click GUI Window handle. Only valid in an event Function. See the GUICtrlSetOnEvent function.
@HotKeyPressed | Last HotKey pressed. See the HotkeySet function
For use with the WinSetState, Run, RunWait, FileCreateShortcut and FileGetShortcut functions:
@SW_DISABLE | Disables the window.
@SW_ENABLE | Enables the window.
@SW_HIDE | Hides the window and activates another window.
@SW_LOCK | Lock window to avoid painting.
@SW_MAXIMIZE | Maximizes the specified window.
@SW_MINIMIZE | Minimizes the specified window and activates the next top-level window in the Z order.
@SW_RESTORE | Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
@SW_SHOW | Activates the window and displays it in its current size and position.
@SW_SHOWDEFAULT | Sets the show state based on the SW_ value specified by the program that started the application.
@SW_SHOWMAXIMIZED | Activates the window and displays it as a maximized window.
@SW_SHOWMINIMIZED | Activates the window and displays it as a minimized window.
@SW_SHOWMINNOACTIVE | Displays the window as a minimized window. This value is similar to @SW_SHOWMINIMIZED, except the window is not activated.
@SW_SHOWNA | Displays the window in its current size and position. This value is similar to @SW_SHOW, except the window is not activated.
@SW_SHOWNOACTIVATE | Displays a window in its most recent size and position. This value is similar to @SW_SHOWNORMAL, except the window is not activated.
@SW_SHOWNORMAL | Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
@SW_UNLOCK | Unlock windows to allow painting.
@TRAY_ID | Last clicked item identifier during a TraySet(Item)OnEvent action.
@TrayIconFlashing | Returns 1 if tray icon is flashing; otherwise, returns 0.
@TrayIconVisible | Returns 1 if tray icon is visible; otherwise, returns 0.
@CR | Carriage return, Chr(13); sometimes used for line breaks.
@LF | Line feed, Chr(10); typically used for line breaks.
@CRLF | = @CR & @LF ;occasionally used for line breaks.
@TAB | Tab character, Chr(9)


Macro Reference - Directory

Below is a list of Directory macros. Note that paths do not contain a trailing backslash.

The full list of macros can be found here.

Macro | Description
Macros for "All Users" data.
@AppDataCommonDir | path to Application Data
@DesktopCommonDir | path to Desktop
@DocumentsCommonDir | path to Documents
@FavoritesCommonDir | path to Favorites
@ProgramsCommonDir | path to Start Menu's Programs folder
@StartMenuCommonDir | path to Start Menu folder
@StartupCommonDir | path to Startup folder
Macros for Current User data.
@AppDataDir | path to current user's Application Data
@DesktopDir | path to current user's Desktop
@MyDocumentsDir | path to My Documents target
@FavoritesDir | path to current user's Favorites
@ProgramsDir | path to current user's Programs (folder on Start Menu)
@StartMenuDir | path to current user's Start Menu
@StartupDir | current user's Startup folder
@UserProfileDir | Path to current user's Profile folder.
Other macros for the computer system:
@HomeDrive | Drive letter of drive containing current user's home directory.
@HomePath | Directory part of current user's home directory. To get the full path, use in conjunction with @HomeDrive.
@HomeShare | Server and share name containing current user's home directory.
@LogonDNSDomain | Logon DNS Domain.
@LogonDomain | Logon Domain.
@LogonServer | Logon server.
@ProgramFilesDir | path to Program Files folder
@CommonFilesDir | path to Common Files folder
@WindowsDir | path to Windows folder
@SystemDir | path to Windows' System (or System32) folder
@TempDir | path to the temporary files folder
@ComSpec value of %comspec%, the SPECified secondary COMmand interpreter;
primarly for command line uses, e.g. Run(@ComSpec & " /k help | more")


Macro Reference - System Info

Below is a list of System information macros.

The full list of macros can be found here.

Macro | Description
@CPUArch | Returns "X86" when the CPU is a 32-bit CPU and "X64" when the CPU is 64-bit.
@KBLayout | Returns code denoting Keyboard Layout. See Appendix for possible values.
@MUILang | Returns code denoting Multi Language if available (Vista is OK by default). See Appendix for possible values.
@OSArch | Returns one of the following: "X86", "IA64", "X64" - this is the architecture type of the currently running operating system.
@OSLang | Returns code denoting OS Language. See Appendix for possible values.
@OSType | Returns "WIN32_NT" for NT/2000/XP/2003/Vista/2008/Win7/2008R2.
@OSVersion | Returns one of the following: "WIN_2008R2", "WIN_7", "WIN_2008", "WIN_VISTA", "WIN_2003", "WIN_XP", "WIN_XPe", "WIN_2000".
@OSBuild | Returns the OS build number. For example, Windows 2003 Server returns 3790
@OSServicePack | Service pack info in the form of "Service Pack 3" or, for Windows 95, it may return "B"
@ComputerName | Computer's network name.
@UserName | ID of the currently logged on user.
@IPAddress1 | IP address of first network adapter. Tends to return 127.0.0.1 on some computers.
@IPAddress2 | IP address of second network adapter. Returns 0.0.0.0 if not applicable.
@IPAddress3 | IP address of third network adapter. Returns 0.0.0.0 if not applicable.
@IPAddress4 | IP address of fourth network adapter. Returns 0.0.0.0 if not applicable.
@DesktopHeight | Height of the desktop screen in pixels. (vertical resolution)
@DesktopWidth | Width of the desktop screen in pixels. (horizontal resolution)
@DesktopDepth | Depth of the desktop screen in bits per pixel.
@DesktopRefresh | Refresh rate of the desktop screen in hertz.


Macro Reference - Time And Date

Below is a list of Time and Date macros. Notice that most return values are two-digits long.

The full list of macros can be found here.

Macro | Description
@MSEC | Milliseconds value of clock. Range is 00 to 999
@SEC | Seconds value of clock. Range is 00 to 59
@MIN | Minutes value of clock. Range is 00 to 59
@HOUR | Hours value of clock in 24-hour format. Range is 00 to 23
@MDAY | Current day of month. Range is 01 to 31
@MON | Current month. Range is 01 to 12
@YEAR | Current four-digit year
@WDAY | Numeric day of week. Range is 1 to 7 which corresponds to Sunday through Saturday.
@YDAY | Current day of year. Range is 001 to 366 (or 001 to 365 if not a leap year)


Functions

Function Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
Abs | Calculates the absolute value of a number.
ACos | Calculates the arcCosine of a number.
AdlibRegister | Registers an Adlib function.
AdlibUnRegister | Unregisters an adlib function.
Asc | Returns the ASCII code of a character.
AscW | Returns the unicode code of a character.
ASin | Calculates the arcsine of a number.
Assign | Assigns a variable by name with the data.
ATan | Calculates the arctangent of a number.
AutoItSetOption | Changes the operation of various AutoIt functions/parameters.
AutoItWinGetTitle | Retrieves the title of the AutoIt window.
AutoItWinSetTitle | Changes the title of the AutoIt window.
Beep | Plays back a beep to the user.
Binary | Returns the binary representation of an expression.
BinaryLen | Returns the number of bytes in a binary variant.
BinaryMid | Extracts a number of bytes from a binary variant.
BinaryToString | Converts a binary variant into a string.
BitAND | Performs a bitwise AND operation.
BitNOT | Performs a bitwise NOT operation.
BitOR | Performs a bitwise OR operation.
BitRotate | Performs a bit shifting operation, with rotation.
BitShift | Performs a bit shifting operation.
BitXOR | Performs a bitwise exclusive OR (XOR) operation.
BlockInput | Disable/enable the mouse and keyboard.
Break | Enables or disables the users' ability to exit a script from the tray icon menu.
Call | Calls a user-defined function contained in a string parameter.
CDTray | Opens or closes the CD tray.
Ceiling | Returns a number rounded up to the next integer.
Chr | Returns a character corresponding to an ASCII code.
ChrW | Returns a character corresponding to a unicode code.
ClipGet | Retrieves text from the clipboard.
ClipPut | Writes text to the clipboard.
ConsoleRead | Read from the STDIN stream of the AutoIt script process.
ConsoleWrite | Writes data to the STDOUT stream. Some text editors can read this stream as can other programs which may be expecting data on this stream.
ConsoleWriteError | Writes data to the STDERR stream. Some text editors can read this stream as can other programs which may be expecting data on this stream.
ControlClick | Sends a mouse click command to a given control.
ControlCommand | Sends a command to a control.
ControlDisable | Disables or "grays-out" a control.
ControlEnable | Enables a "grayed-out" control.
ControlFocus | Sets input focus to a given control on a window.
ControlGetFocus | Returns the ControlRef# of the control that has keyboard focus within a specified window.
ControlGetHandle | Retrieves the internal handle of a control.
ControlGetPos | Retrieves the position and size of a control relative to it's window.
ControlGetText | Retrieves text from a control.
ControlHide | Hides a control.
ControlListView | Sends a command to a ListView32 control.
ControlMove | Moves a control within a window.
ControlSend | Sends a string of characters to a control.
ControlSetText | Sets text of a control.
ControlShow | Shows a control that was hidden.
ControlTreeView | Sends a command to a TreeView32 control.
Cos | Calculates the cosine of a number.
Dec | Returns a numeric representation of a hexadecimal string.
DirCopy | Copies a directory and all sub-directories and files (Similar to xcopy).
DirCreate | Creates a directory/folder.
DirGetSize | Returns the size in bytes of a given directory.
DirMove | Moves a directory and all sub-directories and files.
DirRemove | Deletes a directory/folder.
DllCall | Dynamically calls a function in a DLL.
DllCallbackFree | Frees a previously created handle created with DllCallbackRegister.
DllCallbackGetPtr | Returns the pointer to a callback function that can be passed to the Win32 API.
DllCallbackRegister | Creates a user-defined DLL Callback function.
DllClose | Closes a previously opened DLL.
DllOpen | Opens a DLL file for use in DllCall.
DllStructCreate | Creates a C/C++ style structure to be used in DllCall.
DllStructGetData | Returns the data of an element of the struct.
DllStructGetPtr | Returns the pointer to the struct or an element in the struct.
DllStructGetSize | Returns the size of the struct in bytes.
DllStructSetData | Sets the data in of an element in the struct.
DriveGetDrive | Returns an array containing the enumerated drives.
DriveGetFileSystem | Returns File System Type of a drive.
DriveGetLabel | Returns Volume Label of a drive, if it has one.
DriveGetSerial | Returns Serial Number of a drive.
DriveGetType | Returns drive type.
DriveMapAdd | Maps a network drive.
DriveMapDel | Disconnects a network drive.
DriveMapGet | Retrieves the details of a mapped drive.
DriveSetLabel | Sets the Volume Label of a drive.
DriveSpaceFree | Returns the free disk space of a path in Megabytes.
DriveSpaceTotal | Returns the total disk space of a path in Megabytes.
DriveStatus | Returns the status of the drive as a string.
EnvGet | Retrieves an environment variable.
EnvSet | Writes an environment variable.
EnvUpdate | Refreshes the OS environment.
Eval | Return the value of the variable defined by an string.
Execute | Execute an expression.
Exp | Calculates e to the power of a number.
FileChangeDir | Changes the current working directory.
FileClose | Closes a previously opened text file.
FileCopy | Copies one or more files.
FileCreateNTFSLink | Creates an NTFS hardlink to a file or a directory
FileCreateShortcut | Creates a shortcut (.lnk) to a file.
FileDelete | Delete one or more files.
FileExists | Checks if a file or directory exists.
FileFindFirstFile | Returns a search "handle" according to file search string.
FileFindNextFile | Returns a filename according to a previous call to FileFindFirstFile.
FileFlush | Flushes the file's buffer to disk.
FileGetAttrib | Returns a code string representing a file's attributes.
FileGetEncoding | Determines the text encoding used in a file.
FileGetLongName | Returns the long path+name of the path+name passed.
FileGetPos | Retrieves the current file position.
FileGetShortcut | Retrieves details about a shortcut.
FileGetShortName | Returns the 8.3 short path+name of the path+name passed.
FileGetSize | Returns the size of a file in bytes.
FileGetTime | Returns the time and date information for a file.
FileGetVersion | Returns the "File" version information.
FileInstall | Include and install a file with the compiled script.
FileMove | Moves one or more files
FileOpen | Opens a text file for reading or writing.
FileOpenDialog | Initiates a Open File Dialog.
FileRead | Read in a number of characters from a previously opened text file.
FileReadLine | Read in a line of text from a previously opened text file.
FileRecycle | Sends a file or directory to the recycle bin.
FileRecycleEmpty | Empties the recycle bin.
FileSaveDialog | Initiates a Save File Dialog.
FileSelectFolder | Initiates a Browse For Folder dialog.
FileSetAttrib | Sets the attributes of one or more files.
FileSetPos | Sets the current file position.
FileSetTime | Sets the timestamp of one of more files.
FileWrite | Append a text/data to the end of a previously opened file.
FileWriteLine | Append a line of text to the end of a previously opened text file.
Floor | Returns a number rounded down to the closest integer.
FtpSetProxy | Sets the internet proxy to use for ftp access.
GUICreate | Create a GUI window.
GUICtrlCreateAvi | Creates an AVI video control for the GUI.
GUICtrlCreateButton | Creates a Button control for the GUI.
GUICtrlCreateCheckbox | Creates a Checkbox control for the GUI.
GUICtrlCreateCombo | Creates a ComboBox control for the GUI.
GUICtrlCreateContextMenu | Creates a context menu for a control or entire GUI window.
GUICtrlCreateDate | Creates a date control for the GUI.
GUICtrlCreateDummy | Creates a Dummy control for the GUI.
GUICtrlCreateEdit | Creates an Edit control for the GUI.
GUICtrlCreateGraphic | Creates a Graphic control for the GUI.
GUICtrlCreateGroup | Creates a Group control for the GUI.
GUICtrlCreateIcon | Creates an Icon control for the GUI.
GUICtrlCreateInput | Creates an Input control for the GUI.
GUICtrlCreateLabel | Creates a static Label control for the GUI.
GUICtrlCreateList | Creates a List control for the GUI.
GUICtrlCreateListView | Creates a ListView control for the GUI.
GUICtrlCreateListViewItem | Creates a ListView item.
GUICtrlCreateMenu | Creates a Menu control for the GUI.
GUICtrlCreateMenuItem | Creates a MenuItem control for the GUI.
GUICtrlCreateMonthCal | Creates a month calendar control for the GUI.
GUICtrlCreateObj | Creates an ActiveX control in the GUI.
GUICtrlCreatePic | Creates a Picture control for the GUI.
GUICtrlCreateProgress | Creates a Progress control for the GUI.
GUICtrlCreateRadio | Creates a Radio button control for the GUI.
GUICtrlCreateSlider | Creates a Slider control for the GUI.
GUICtrlCreateTab | Creates a Tab control for the GUI.
GUICtrlCreateTabItem | Creates a TabItem control for the GUI.
GUICtrlCreateTreeView | Creates a TreeView control for the GUI.
GUICtrlCreateTreeViewItem | Creates a TreeViewItem control for the GUI.
GUICtrlCreateUpdown | Creates an UpDown control for the GUI.
GUICtrlDelete | Deletes a control.
GUICtrlGetHandle | Returns the handle for a control and some special (item) handles (Menu, ContextMenu, TreeViewItem).
GUICtrlGetState | Gets the current state of a control
GUICtrlRead | Read state or data of a control.
GUICtrlRecvMsg | Send a message to a control and retrieve information in lParam.
GUICtrlRegisterListViewSort | Register a user defined function for an internal listview sorting callback function.
GUICtrlSendMsg | Send a message to a control.
GUICtrlSendToDummy | Sends a message to a Dummy control.
GUICtrlSetBkColor | Sets the background color of a control.
GUICtrlSetColor | Sets the text color of a control.
GUICtrlSetCursor | Sets the mouse cursor icon for a particular control.
GUICtrlSetData | Modifies the data for a control.
GUICtrlSetDefBkColor | Sets the default background color of all the controls of the GUI window.
GUICtrlSetDefColor | Sets the default text color of all the controls of the GUI window.
GUICtrlSetFont | Sets the font for a control.
GUICtrlSetGraphic | Modifies the data for a control.
GUICtrlSetImage | Sets the bitmap or icon image to use for a control.
GUICtrlSetLimit | Limits the number of characters/pixels for a control.
GUICtrlSetOnEvent | Defines a user-defined function to be called when a control is clicked.
GUICtrlSetPos | Changes the position of a control within the GUI window.
GUICtrlSetResizing | Defines the resizing method used by a control.
GUICtrlSetState | Changes the state of a control.
GUICtrlSetStyle | Changes the style of a control.
GUICtrlSetTip | Sets the tip text associated with a control.
GUIDelete | Deletes a GUI window and all controls that it contains.
GUIGetCursorInfo | Gets the mouse cursor position relative to GUI window.
GUIGetMsg | Polls the GUI to see if any events have occurred.
GUIGetStyle | Retrieves the styles of a GUI window.
GUIRegisterMsg | Register a user defined function for a known Windows Message ID (WM_MSG).
GUISetAccelerators | Sets the accelerator table to be used in a GUI window.
GUISetBkColor | Sets the background color of the GUI window.
GUISetCoord | Sets absolute coordinates for the next control.
GUISetCursor | Sets the mouse cursor icon for a GUI window.
GUISetFont | Sets the default font for a GUI window.
GUISetHelp | Sets an executable file that will be run when F1 is pressed.
GUISetIcon | Sets the icon used in a GUI window.
GUISetOnEvent | Defines a user function to be called when a system button is clicked.
GUISetState | Changes the state of a GUI window.
GUISetStyle | Changes the styles of a GUI window.
GUIStartGroup | Defines that any subsequent controls that are created will be "grouped" together.
GUISwitch | Switches the current window used for GUI functions.
Hex | Returns a string representation of an integer or of a binary type converted to hexadecimal.
HotKeySet | Sets a hotkey that calls a user function.
HttpSetProxy | Sets the internet proxy to use for http access.
HttpSetUserAgent | Sets the user-agent string sent with InetGet() and InetRead() requests.
HWnd | Converts an expression into an HWND handle.
InetClose | Closes a handle returned from InetGet().
InetGet | Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.
InetGetInfo | Returns detailed data for a handle returned from InetGet().
InetGetSize | Returns the size (in bytes) of a file located on the internet.
InetRead | Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.
IniDelete | Deletes a value from a standard format .ini file.
IniRead | Reads a value from a standard format .ini file.
IniReadSection | Reads all key/value pairs from a section in a standard format .ini file.
IniReadSectionNames | Reads all sections in a standard format .ini file.
IniRenameSection | Renames a section in a standard format .ini file.
IniWrite | Writes a value to a standard format .ini file.
IniWriteSection | Writes a section to a standard format .ini file.
InputBox | Displays an input box to ask the user to enter a string.
Int | Returns the integer (whole number) representation of an expression.
IsAdmin | Checks if the current user has full administrator privileges.
IsArray | Checks if a variable is an array type.
IsBinary | Checks if a variable or expression is a binary type.
IsBool | Checks if a variable's base type is boolean.
IsDeclared | Check if a variable has been declared.
IsDllStruct | Checks if a variable is a DllStruct type.
IsFloat | Checks if a variable or expression is a float-type.
IsHWnd | Checks if a variable's base type is a pointer and window handle.
IsInt | Checks if a variable or expression is an integer type.
IsKeyword | Checks if a variable is a keyword (for example, Default).
IsNumber | Checks if a variable's base type is numeric.
IsObj | Checks if a variable or expression is an object type.
IsPtr | Checks if a variable's base type is a pointer.
IsString | Checks if a variable is a string type.
Log | Calculates the natural logarithm of a number.
MemGetStats | Retrieves memory related information.
Mod | Performs the modulus operation.
MouseClick | Perform a mouse click operation.
MouseClickDrag | Perform a mouse click and drag operation.
MouseDown | Perform a mouse down event at the current mouse position.
MouseGetCursor | Returns the cursor ID Number for the current Mouse Cursor.
MouseGetPos | Retrieves the current position of the mouse cursor.
MouseMove | Moves the mouse pointer.
MouseUp | Perform a mouse up event at the current mouse position.
MouseWheel | Moves the mouse wheel up or down. NT/2000/XP ONLY.
MsgBox | Displays a simple message box with optional timeout.
Number | Returns the numeric representation of an expression.
ObjCreate | Creates a reference to a COM object from the given classname.
ObjEvent | Handles incoming events from the given Object.
ObjGet | Retrieves a reference to a COM object from an existing process or filename.
ObjName | Returns the name or interface description of an Object
OnAutoItExitRegister | Registers a function to be called when AutoIt exits.
OnAutoItExitUnRegister | UnRegisters a function that was called when AutoIt exits.
Ping | Pings a host and returns the roundtrip-time.
PixelChecksum | Generates a checksum for a region of pixels.
PixelGetColor | Returns a pixel color according to x,y pixel coordinates.
PixelSearch | Searches a rectangle of pixels for the pixel color provided.
PluginClose | Close a plugin file
PluginOpen | Open a plugin file.
ProcessClose | Terminates a named process.
ProcessExists | Checks to see if a specified process exists.
ProcessGetStats | Returns an array about Memory or IO infos of a running process.
ProcessList | Returns an array listing the currently running processes (names and PIDs).
ProcessSetPriority | Changes the priority of a process
ProcessWait | Pauses script execution until a given process exists.
ProcessWaitClose | Pauses script execution until a given process does not exist.
ProgressOff | Turns Progress window off.
ProgressOn | Creates a customizable progress bar window.
ProgressSet | Sets the position and/or text of a previously created Progress bar window.
Ptr | Converts an expression into a pointer variant.
Random | Generates a pseudo-random float-type number.
RegDelete | Deletes a key or value from the registry.
RegEnumKey | Reads the name of a subkey according to it's instance.
RegEnumVal | Reads the name of a value according to it's instance.
RegRead | Reads a value from the registry.
RegWrite | Creates a key or value in the registry.
Round | Returns a number rounded to a specified number of decimal places.
Run | Runs an external program.
RunAs | Runs an external program under the context of a different user.
RunAsWait | Runs an external program under the context of a different user and pauses script execution until the program finishes.
RunWait | Runs an external program and pauses script execution until the program finishes.
Send | Sends simulated keystrokes to the active window.
SendKeepActive | Attempts to keep a specified window active during Send().
SetError | Manually set the value of the @error macro.
SetExtended | Manually set the value of the @extended macro.
ShellExecute | Runs an external program using the ShellExecute API.
ShellExecuteWait | Runs an external program using the ShellExecute API and pauses script execution until it finishes.
Shutdown | Shuts down the system.
Sin | Calculates the sine of a number.
Sleep | Pause script execution.
SoundPlay | Play a sound file.
SoundSetWaveVolume | Sets the system wave volume by percent.
SplashImageOn | Creates a customizable image popup window.
SplashOff | Turns SplashText or SplashImage off.
SplashTextOn | Creates a customizable text popup window.
Sqrt | Calculates the square-root of a number.
SRandom | Set Seed for random number generation.
StatusbarGetText | Retrieves the text from a standard status bar control.
StderrRead | Reads from the STDERR stream of a previously run child process.
StdinWrite | Writes a number of characters to the STDIN stream of a previously run child process.
StdioClose | Closes all resources associated with a process previously run with STDIO redirection.
StdoutRead | Reads from the STDOUT stream of a previously run child process.
String | Returns the string representation of an expression.
StringAddCR | Takes a string and prefixes all linefeed characters ( Chr(10) ) with a carriage return character ( Chr(13) ).
StringCompare | Compares two strings with options.
StringFormat | Returns a formatted string (similar to the C sprintf() function).
StringFromASCIIArray | Converts an array of ASCII codes to a string.
StringInStr | Checks if a string contains a given substring.
StringIsAlNum | Checks if a string contains only alphanumeric characters.
StringIsAlpha | Checks if a string contains only alphabetic characters.
StringIsASCII | Checks if a string contains only ASCII characters in the range 0x00 - 0x7f (0 - 127).
StringIsDigit | Checks if a string contains only digit (0-9) characters.
StringIsFloat | Checks if a string is a floating point number.
StringIsInt | Checks if a string is an integer.
StringIsLower | Checks if a string contains only lowercase characters.
StringIsSpace | Checks if a string contains only whitespace characters.
StringIsUpper | Checks if a string contains only uppercase characters.
StringIsXDigit | Checks if a string contains only hexadecimal digit (0-9, A-F) characters.
StringLeft | Returns a number of characters from the left-hand side of a string.
StringLen | Returns the number of characters in a string.
StringLower | Converts a string to lowercase.
StringMid | Extracts a number of characters from a string.
StringRegExp | Check if a string fits a given regular expression pattern.
StringRegExpReplace | Replace text in a string based on regular expressions.
StringReplace | Replaces substrings in a string.
StringRight | Returns a number of characters from the right-hand side of a string.
StringSplit | Splits up a string into substrings depending on the given delimiters.
StringStripCR | Removes all carriage return values ( Chr(13) ) from a string.
StringStripWS | Strips the white space in a string.
StringToASCIIArray | Converts a string to an array containing the ASCII code of each character.
StringToBinary | Converts a string into binary data.
StringTrimLeft | Trims a number of characters from the left hand side of a string.
StringTrimRight | Trims a number of characters from the right hand side of a string.
StringUpper | Converts a string to uppercase.
Tan | Calculates the tangent of a number.
TCPAccept | Permits an incoming connection attempt on a socket.
TCPCloseSocket | Closes a TCP socket.
TCPConnect | Create a socket connected to an existing server.
TCPListen | Creates a socket listening for an incoming connection.
TCPNameToIP | Converts an Internet name to IP address.
TCPRecv | Receives data from a connected socket.
TCPSend | Sends data on a connected socket.
TCPShutdown, UDPShutdown | Stops TCP/UDP services.
TCPStartup, UDPStartup | Starts TCP or UDP services.
TimerDiff | Returns the difference in time from a previous call to TimerInit().
TimerInit | Returns a timestamp (in milliseconds).
ToolTip | Creates a tooltip anywhere on the screen.
TrayCreateItem | Creates a menuitem control for the tray.
TrayCreateMenu | Creates a menu control for the tray menu.
TrayGetMsg | Polls the tray to see if any events have occurred.
TrayItemDelete | Deletes a menu/item control from the tray menu.
TrayItemGetHandle | Returns the handle for a tray menu(item).
TrayItemGetState | Gets the current state of a control.
TrayItemGetText | Gets the itemtext of a tray menu/item control.
TrayItemSetOnEvent | Defines a user-defined function to be called when a tray item is clicked.
TrayItemSetState | Sets the state of a tray menu/item control.
TrayItemSetText | Sets the itemtext of a tray menu/item control.
TraySetClick | Sets the clickmode of the tray icon - what mouseclicks will display the tray menu.
TraySetIcon | Loads/Sets a specified tray icon.
TraySetOnEvent | Defines a user function to be called when a special tray action happens.
TraySetPauseIcon | Loads/Sets a specified tray pause icon.
TraySetState | Sets the state of the tray icon.
TraySetToolTip | (Re)Sets the tooltip text for the tray icon.
TrayTip | Displays a balloon tip from the AutoIt Icon. (2000/XP only)
UBound | Returns the size of array dimensions.
UDPBind | Create a socket bound to an incoming connection.
UDPCloseSocket | Close a UDP socket.
UDPOpen | Open a socket connected to an existing server .
UDPRecv | Receives data from a opened socket
UDPSend | Sends data on an opened socket
VarGetType | Returns the internal type representation of a variant.
WinActivate | Activates (gives focus to) a window.
WinActive | Checks to see if a specified window exists and is currently active.
WinClose | Closes a window.
WinExists | Checks to see if a specified window exists.
WinFlash | Flashes a window in the taskbar.
WinGetCaretPos | Returns the coordinates of the caret in the foreground window
WinGetClassList | Retrieves the classes from a window.
WinGetClientSize | Retrieves the size of a given window's client area.
WinGetHandle | Retrieves the internal handle of a window.
WinGetPos | Retrieves the position and size of a given window.
WinGetProcess | Retrieves the Process ID (PID) associated with a window.
WinGetState | Retrieves the state of a given window.
WinGetText | Retrieves the text from a window.
WinGetTitle | Retrieves the full title from a window.
WinKill | Forces a window to close.
WinList | Retrieves a list of windows.
WinMenuSelectItem | Invokes a menu item of a window.
WinMinimizeAll | Minimizes all windows.
WinMinimizeAllUndo | Undoes a previous WinMinimizeAll function.
WinMove | Moves and/or resizes a window.
WinSetOnTop | Change a window's "Always On Top" attribute.
WinSetState | Shows, hides, minimizes, maximizes, or restores a window.
WinSetTitle | Changes the title of a window.
WinSetTrans | Sets the transparency of a window. (Windows 2000/XP or later)
WinWait | Pauses execution of the script until the requested window exists.
WinWaitActive | Pauses execution of the script until the requested window is active.
WinWaitClose | Pauses execution of the script until the requested window does not exist.
WinWaitNotActive | Pauses execution of the script until the requested window is not active.


Function Notes

Many functions contain optional parameters that can be omitted. If you wish to specify an optional parameter, however, all preceding parameters must be specified!
For example, consider Run ( "filename", ["workingdir" [, flag]] ). If you wish to specify the flag, you must specify a workingdir.

Many Win___ functions contain an optional parameter "text". This parameter is intended to help differentiate between windows that have identical titles.

Some functions indicate success/failure as a return value; others indicate it by setting the @error flag. Some do both....
@error = 0 ;is always success
Return = varies, but is typically non-zero for success to allow easy to read code...

If someUserFunc() then ;...function worked
If Not someUserFunc() then ;...function failed

$x = FileReadLine("C:\someFile.txt")
If @error = -1 Then ;end-of-file was reached

If a function can set the @error flag, you should always check it before using a return value - if @error indicates an error then the function return value is generally undefined...

@error is always set to 0 when entering in a function.

When the documentation states that the return value = none, AutoIt always returns a value to avoid errors. 1 is usually the value returned, but you should not depend on this return value.

When an optional parameter needs to be defined and is preceded by one or more optional parameters, the default value must be given. This may be "" for a string parameter and -1 for other types. Some functions like StringInStr or StringReplace require 0. See the corresponding optional parameter description.


Functions

Environment functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
ClipGet | Retrieves text from the clipboard.
ClipPut | Writes text to the clipboard.
EnvGet | Retrieves an environment variable.
EnvSet | Writes an environment variable.
EnvUpdate | Refreshes the OS environment.
MemGetStats | Retrieves memory related information.


Function ClipGet

Function Reference

ClipGet

Retrieves text from the clipboard.

ClipGet ( )

Parameters

None.

Return Value

Success: | Returns a string containing the text on the clipboard.
Failure: | Sets @error to 1 if clipboard is empty
 | to 2 if contains a non-text entry.
 | to 3 or 4 if cannot access the clipboard.

Remarks

When multiple selecting file/dir are stored in the clipboard, the filename/dirname are returned as texts separated by @LF.

Related

ClipPut

Example

$bak = ClipGet()
MsgBox(0, "Clipboard contains:", $bak)

ClipPut($bak & "additional text")
MsgBox(0, "Clipboard contains:", ClipGet())


Function ClipPut

Function Reference

ClipPut

Writes text to the clipboard.

ClipPut ( "value" )

Parameters

value The text to write to the clipboard.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Any existing clipboard contents are overwritten.
An empty string "" will empty the clipboard.

Related

ClipGet

Example

ClipPut("I am copied to the clipboard")


Function EnvGet

Function Reference

EnvGet

Retrieves an environment variable.

EnvGet ( "envvariable" )

Parameters

envvariable Name of the environment variable to get such as "TEMP" or "PATH".

Return Value

Returns the requested variable (or a blank string if the variable does not exist).

Remarks

None.

Related

EnvSet, EnvUpdate

Example

$var = EnvGet("PATH")
MsgBox(4096, "Path variable is:", $var)


Function EnvSet

Function Reference

EnvSet

Writes an environment variable.

EnvSet ( "envvariable" [, "value"] )

Parameters

envvariable | Name of the environment variable to set.
value | [optional] Value to set the environment variable to. If a value is not used the environment variable will be deleted.

Return Value

Success: | Returns not 0.
Failure: | Returns 0.

Remarks

A environment variable set in this way will only be accessible to programs that AutoIt spawns (Run, RunWait). Once AutoIt closes, the variables will cease to exist.

Related

EnvGet, EnvUpdate

Example

EnvSet("MYENV", "this is a test")


Function EnvUpdate

Function Reference

EnvUpdate

Refreshes the OS environment.

EnvUpdate ( )

Parameters

None.

Return Value

Success: | None.
Failure: | Sets @error to 1.

Remarks

Similar effect as logging off and then on again. For example, changes to the %path% environment might not take effect until you call EnvUpdate (or you logoff/reboot).

Related

EnvGet, EnvSet

Example

EnvUpdate()


Function MemGetStats

Function Reference

MemGetStats

Retrieves memory related information.

MemGetStats ( )

Parameters

None.

Return Value

Returns a seven-element array containing the memory information:

$array[0] = Memory Load (Percentage of memory in use)
$array[1] = Total physical RAM
$array[2] = Available physical RAM
$array[3] = Total Pagefile
$array[4] = Available Pagefile
$array[5] = Total virtual
$array[6] = Available virtual

All memory sizes are in kilobytes.

Remarks

None.

Related

None.

Example

$mem = MemGetStats()
MsgBox(0, "Total physical RAM (KB):", $mem[1])


Functions

File, Directory and Disk functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
ConsoleRead | Read from the STDIN stream of the AutoIt script process.
ConsoleWrite | Writes data to the STDOUT stream. Some text editors can read this stream as can other programs which may be expecting data on this stream.
ConsoleWriteError | Writes data to the STDERR stream. Some text editors can read this stream as can other programs which may be expecting data on this stream.
DirCopy | Copies a directory and all sub-directories and files (Similar to xcopy).
DirCreate | Creates a directory/folder.
DirGetSize | Returns the size in bytes of a given directory.
DirMove | Moves a directory and all sub-directories and files.
DirRemove | Deletes a directory/folder.
DriveGetDrive | Returns an array containing the enumerated drives.
DriveGetFileSystem | Returns File System Type of a drive.
DriveGetLabel | Returns Volume Label of a drive, if it has one.
DriveGetSerial | Returns Serial Number of a drive.
DriveGetType | Returns drive type.
DriveMapAdd | Maps a network drive.
DriveMapDel | Disconnects a network drive.
DriveMapGet | Retrieves the details of a mapped drive.
DriveSetLabel | Sets the Volume Label of a drive.
DriveSpaceFree | Returns the free disk space of a path in Megabytes.
DriveSpaceTotal | Returns the total disk space of a path in Megabytes.
DriveStatus | Returns the status of the drive as a string.
FileChangeDir | Changes the current working directory.
FileClose | Closes a previously opened text file.
FileCopy | Copies one or more files.
FileCreateNTFSLink | Creates an NTFS hardlink to a file or a directory
FileCreateShortcut | Creates a shortcut (.lnk) to a file.
FileDelete | Delete one or more files.
FileExists | Checks if a file or directory exists.
FileFindFirstFile | Returns a search "handle" according to file search string.
FileFindNextFile | Returns a filename according to a previous call to FileFindFirstFile.
FileFlush | Flushes the file's buffer to disk.
FileGetAttrib | Returns a code string representing a file's attributes.
FileGetEncoding | Determines the text encoding used in a file.
FileGetLongName | Returns the long path+name of the path+name passed.
FileGetPos | Retrieves the current file position.
FileGetShortcut | Retrieves details about a shortcut.
FileGetShortName | Returns the 8.3 short path+name of the path+name passed.
FileGetSize | Returns the size of a file in bytes.
FileGetTime | Returns the time and date information for a file.
FileGetVersion | Returns the "File" version information.
FileInstall | Include and install a file with the compiled script.
FileMove | Moves one or more files
FileOpen | Opens a text file for reading or writing.
FileOpenDialog | Initiates a Open File Dialog.
FileRead | Read in a number of characters from a previously opened text file.
FileReadLine | Read in a line of text from a previously opened text file.
FileRecycle | Sends a file or directory to the recycle bin.
FileRecycleEmpty | Empties the recycle bin.
FileSaveDialog | Initiates a Save File Dialog.
FileSelectFolder | Initiates a Browse For Folder dialog.
FileSetAttrib | Sets the attributes of one or more files.
FileSetPos | Sets the current file position.
FileSetTime | Sets the timestamp of one of more files.
FileWrite | Append a text/data to the end of a previously opened file.
FileWriteLine | Append a line of text to the end of a previously opened text file.
IniDelete | Deletes a value from a standard format .ini file.
IniRead | Reads a value from a standard format .ini file.
IniReadSection | Reads all key/value pairs from a section in a standard format .ini file.
IniReadSectionNames | Reads all sections in a standard format .ini file.
IniRenameSection | Renames a section in a standard format .ini file.
IniWrite | Writes a value to a standard format .ini file.
IniWriteSection | Writes a section to a standard format .ini file.


Function ConsoleRead

Function Reference

ConsoleRead

Read from the STDIN stream of the AutoIt script process.

ConsoleRead ( [peek = false[, binary = false ]])

Parameters

peek | [optional] If true the function does not remove the read characters from the stream.
binary | [optional] If true the function reads the data as binary instead of text (default is text).

Return Value

Success: | Returns the data read. @extended contains the number of bytes read.
Failure: | Sets @error to non-zero if EOF is reached, STDIN is not connected for the process or other error.

Remarks

ConsoleRead reads from the console standard input stream of the AutoIt script process, which is normally used by console applications to read input from a parent process.
ConsoleRead does not block, it will return immediately. In order to get all data, it must be called in a loop.
Peeking on the stream does not remove the data from the buffer, however, it does return the available data as normal.
By default, data is returned in text format. By using the binary option, the data will be returned in binary format.

Related

ConsoleWrite, ConsoleWriteError, Run

Example

; Compile this script to "ConsoleRead.exe".
; Open a command prompt to the directory where ConsoleRead.exe resides.
; Type the following on the command line:
; echo Hello! | ConsoleRead.exe
;
; When invoked in a console window, the above command echos the text "Hello!"
; but instead of dispalying it, the | tells the console to pipe it to the STDIN stream
; of the ConsoleRead.exe process.
If Not @Compiled Then
MsgBox(0, "", "This script must be compiled in order to properly demonstrate it's functionality.")
Exit -1
EndIf

Local $data
While True
$data &= ConsoleRead()
If @error Then ExitLoop
Sleep(25)
WEnd
MsgBox(0, "", "Received: " & @CRLF & @CRLF & $data)


Function ConsoleWrite

Function Reference

ConsoleWrite

Writes data to the STDOUT stream. Some text editors can read this stream as can other programs which may be expecting data on this stream.

ConsoleWrite ( "data" )

Parameters

data The data you wish to output. This may either be text or binary.

Return Value

The amount of data written. If writing binary, the number of bytes written, if writing text, the number of characters written.

Remarks

The purpose for this function is to write to the STDOUT stream. Many popular text editors can read this stream. Scripts compiled as Console applications also have a STDOUT stream.

This does not write to a DOS console unless the script is compiled as a console application..

Characters are converted to ANSI before being written.

Binary data is written as-is. It will not be converted to a string. To print the hex representation of binary data, use the String() function to explicitly cast the data to a string.

Related

ConsoleWriteError, ConsoleRead

Example

Local $var = "Test"
ConsoleWrite("var=" & $var & @CRLF)
; Running this in a text editor which can trap console output should produce "var=Test"


Function ConsoleWriteError

Function Reference

ConsoleWriteError

Writes data to the STDERR stream. Some text editors can read this stream as can other programs which may be expecting data on this stream.

ConsoleWriteError ( "data" )

Parameters

data The data you wish to output. This may either be text or binary.

Return Value

The amount of data written. If writing binary, the number of bytes written, if writing text, the number of characters written.

Remarks

The purpose for this function is to write to the STDERR stream. Many popular text editors can read this stream. Scripts compiled as Console applications also have a STDERR stream.

This does not write to a DOS console unless the script is compiled as a console application..

Characters are converted to ANSI before being written.

Binary data is written as-is. It will not be converted to a string. To print the hex representation of binary data, use the String() function to explicitly cast the data to a string.

Related

ConsoleWrite, ConsoleRead

Example

Local $var = "Test"
ConsoleWriteError("var=" & $var & @CRLF)
; Running this in a text editor which can trap console output should produce "var=Test"


Function DirCopy

Function Reference

DirCopy

Copies a directory and all sub-directories and files (Similar to xcopy).

DirCopy ( "source dir", "dest dir" [, flag] )

Parameters

source dir | Path of the source directory (with no trailing backslash). e.g. "C:\Path1"
dest dir | Path of the destination dir (with no trailing backslash). e.g. "C:\Path_Copy"
flag | [optional] this flag determines whether to overwrite file if they already exist: 0 = (default) do not overwrite existing files 1 = overwrite existing files

Return Value

Success: | Returns 1.
Failure: | Returns 0 if there is an error copying the directory.

Remarks

If the destination directory structure doesn't exist, it will be created (if possible).

Related

DirRemove, FileCopy

Example

DirCopy(@MyDocumentsDir, "C:\Backups\MyDocs", 1)


Function DirCreate

Function Reference

DirCreate

Creates a directory/folder.

DirCreate ( "path" )

Parameters

path Path of the directory to create.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if there is an error creating the directory.

Remarks

This function will also create all parent directories given in "path" if they do not already exist.

Related

DirRemove, FileCopy

Example

DirCreate("C:\Test1\Folder1\Folder2")


Function DirGetSize

Function Reference

DirGetSize

Returns the size in bytes of a given directory.

DirGetSize ( "path" [, flag] )

Parameters

path | The directory path to get the size from, e.g. "C:\Windows".
flag | [optional] this flag determines the behaviour and result of the function, and can be a combination of the following: 0 = (default) 1 = Extended mode is On -> returns an array that contains extended information (see Remarks). 2 = Don't get the size of files in subdirectories (recursive mode is Off)

Return Value

Success: | Returns >= 0 the sizes
Failure: | Returns -1 and sets @error to 1 if the path doesn't exist.

Remarks

If the script is paused then this function is paused too and will only continue when the script continues!

If you use the extended mode then the array returned from this function is a single dimension array containing the following elements:
$array[0] = Size
$array[1] = Files count
$array[2] = Dirs Count

Related

None.

Example

$size = DirGetSize(@HomeDrive)
Msgbox(0,"","Size(MegaBytes):" & Round($size / 1024 / 1024))

$size = DirGetSize(@WindowsDir, 2)
Msgbox(0,"","Size(MegaBytes):" & Round($size / 1024 / 1024))

$timer = TimerInit()
$size = DirGetSize("\\10.0.0.1\h$",1)
$diff = Round(TimerDiff($timer) / 1000) ; time in seconds
If IsArray($size) Then
Msgbox(0,"DirGetSize-Info","Size(Bytes):" & $size[0] & @LF _
& "Files:" & $size[1] & @LF & "Dirs:" & $size[2] & @LF _
& "TimeDiff(Sec):" & $diff)
EndIf


Function DirMove

Function Reference

DirMove

Moves a directory and all sub-directories and files.

DirMove ( "source dir", "dest dir" [, flag] )

Parameters

source dir | Path of the source directory (with no trailing backslash). e.g. "C:\Path1"
dest dir | Path of the destination dir (with no trailing backslash). e.g. "C:\Path_Copy"
flag | [optional] this flag determines whether to overwrite files if they already exist: 0 = (default) do not overwrite existing files 1 = overwrite existing files

Return Value

Success: | Returns 1.
Failure: | Returns 0 if there is an error moving the directory.

Remarks

If the source and destination are on different volumes or UNC paths are used then a copy/delete operation will be performed rather than a move.

If the destination already exists and the overwrite flag is specified then the source directory will be moved inside the destination.

Because AutoIt lacks a "DirRename" function, use DirMove to rename a folder!

Related

DirRemove, FileMove

Example

DirMove(@MyDocumentsDir, "C:\Backups\MyDocs")


Function DirRemove

Function Reference

DirRemove

Deletes a directory/folder.

DirRemove ( "path" [, recurse] )

Parameters

path | Path of the directory to remove.
recurse | [optional] Use this flag to specify if you want to delete sub-directories too. 0 = (default) do not remove files and sub-directories 1 = remove files and subdirectories (like the DOS DelTree command)

Return Value

Success: | Returns 1.
Failure: | Returns 0 if there is an error removing the directory (or if directory does not exist).

Remarks

Some dir attributes can make the removal impossible.

Related

DirCreate, FileRecycle, DirCopy, DirMove, FileDelete

Example

; Delete C:\Test1 and all subdirs and files
DirRemove("C:\Test1", 1)


Function DriveGetDrive

Function Reference

DriveGetDrive

Returns an array containing the enumerated drives.

DriveGetDrive ( "type" )

Parameters

type Type of drive to find:
"ALL", "CDROM", "REMOVABLE", "FIXED", "NETWORK", "RAMDISK", or "UNKNOWN"

Return Value

Success: | Returns an array of strings (drive letter followed by colon) of drives found. The zeroth array element contains the number of drives.
Failure: | Returns "" and sets @error to 1.

Remarks

None.

Related

DriveGetFileSystem, DriveGetLabel, DriveGetSerial, DriveGetType, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal, DriveStatus

Example

$var = DriveGetDrive( "all" )
If NOT @error Then
MsgBox(4096,"", "Found " & $var[0] & " drives")
For $i = 1 to $var[0]
MsgBox(4096,"Drive " & $i, $var[$i])
Next
EndIf


Function DriveGetFileSystem

Function Reference

DriveGetFileSystem

Returns File System Type of a drive.

DriveGetFileSystem ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Success: | Returns the File System Type of the drive as a string; see table below.
Failure: | Sets @error to 1.

Return Value | Interpretation
1 (numeric) | Drive does NOT contain media (CD, Floppy, Zip) or media is unformatted (RAW).
"FAT" | Typical file system for drives under ~500 MB such as Floppy, RAM disks, USB "pen" drives, etc.
"FAT32" | Typical file system for Windows 9x/Me hard drives.
"NTFS" | Typical file system for Windows NT/2000/XP hard drives.
"NWFS" | Typical file system for Novell Netware file servers.
"CDFS" | Typically indicates a CD (or an ISO image mounted as a virtual CD drive).
"UDF" | Typically indicates a DVD.

Remarks

The list of possible return values might be incomplete.

Related

DriveGetDrive, DriveGetLabel, DriveGetSerial, DriveGetType, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal, DriveStatus

Example

$var = DriveGetFileSystem( "c:\" )
MsgBox(4096,"File System Type:", $var)


Function DriveGetLabel

Function Reference

DriveGetLabel

Returns Volume Label of a drive, if it has one.

DriveGetLabel ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Success: | Returns the Volume Label of the drive as a string.
Failure: | Sets @error to 1.

Remarks

None.

Related

DriveGetDrive, DriveGetFileSystem, DriveGetSerial, DriveGetType, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal, DriveStatus

Example

$var = DriveGetLabel( "c:\" )
MsgBox(4096,"Volume Label: ",$var)


Function DriveGetSerial

Function Reference

DriveGetSerial

Returns Serial Number of a drive.

DriveGetSerial ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Success: | Returns the Serial Number of the drive as a string.
Failure: | Sets @error to 1.

Remarks

The value returned is not the hardware serial number as found on the label of the drive, it is the Windows Volume ID for the drive.

Related

DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetType, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal, DriveStatus

Example

$var = DriveGetSerial( "c:\" )
MsgBox(4096, "Serial Number: ", $var)


Function DriveGetType

Function Reference

DriveGetType

Returns drive type.

DriveGetType ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Success: | Returns the type of drive: "Unknown", "Removable", "Fixed", "Network", "CDROM", "RAMDisk"
Failure: | Returns "" and sets @error to 1.

Remarks

The list of possible return values might be incomplete.

Related

DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal, DriveStatus, CDTray

Example

$var = DriveGetType( "c:\" )
MsgBox(4096, "Drive Type:", $var)


Function DriveMapAdd

Function Reference

DriveMapAdd

Maps a network drive.

DriveMapAdd ( "device", "remote share" [, flags [, "user" [, "password"]]] )

Parameters

device | The device to map, for example "O:" or "LPT1:". If you pass a blank string for this parameter a connection is made but not mapped to a specific drive. If you specify "*" an unused drive letter will be automatically selected.
remote share | The remote share to connect to in the form "\\server\share".
flags | [optional] A combination of the following: 0 = default 1 = Persistent mapping 8 = Show authentication dialog if required
user | [optional] The username to use to connect. In the form "username" or "domain\username".
password | [optional] The password to use to connect.

Return Value

Success: | Returns 1. (See Remarks)
Failure: | Returns 0 if a new mapping could not be created and sets @error (see below). (See Remarks)

Remarks

When the function fails (returns 0) @error contains extended information:
1 = Undefined / Other error. @extended set with Windows API return
2 = Access to the remote share was denied
3 = The device is already assigned
4 = Invalid device name
5 = Invalid remote share
6 = Invalid password

Note: When using "*" for the device parameter the drive letter selected will be returned instead of 1 or 0, e.g. "U:". If there was an error using "*" then a blank string "" will be returned.

If defined the user/password will be presented to the remote computer that will validate the credential.

Related

DriveMapDel, DriveMapGet

Example

; Map X drive to \\myserver\stuff using current user
DriveMapAdd("X:", "\\myserver\stuff")

; Map X drive to \\myserver2\stuff2 using the user "jon" from "domainx" with password "tickle"
DriveMapAdd("X:", "\\myserver2\stuff2", 0, "domainx\jon", "tickle")


Function DriveMapDel

Function Reference

DriveMapDel

Disconnects a network drive.

DriveMapDel ( "drive" )

Parameters

drive The device to disconnect, e.g. "O:" or "LPT1:".

Return Value

Success: | Returns 1.
Failure: | Returns 0 if the disconnection was unsuccessful.

Remarks

If a connection has no drive letter mapped you may use the connection name to disconnect, e.g. \\server\share

Related

DriveMapAdd, DriveMapGet

Example

; Map X drive to \\myserver\stuff using current user
DriveMapAdd("X:", "\\myserver\stuff")

; Disconnect
DriveMapDel("X:")


Function DriveMapGet

Function Reference

DriveMapGet

Retrieves the details of a mapped drive.

DriveMapGet ( "device" )

Parameters

device The device (drive or printer) letter to query, e.g. "O:" or "LPT1:"

Return Value

Success: | Returns details of the mapping, e.g. \\server\share
Failure: | Returns a blank string "" and sets @error to 1.

Remarks

None.

Related

DriveMapAdd, DriveMapDel

Example

; Map X drive to \\myserver\stuff using current user
DriveMapAdd("X:", "\\myserver\stuff")

; Get details of the mapping
MsgBox(0, "Drive X: is mapped to", DriveMapGet("X:"))


Function DriveSetLabel

Function Reference

DriveSetLabel

Sets the Volume Label of a drive.

DriveSetLabel ( "path", "label" )

Parameters

path | Path of drive to change.
label | New volume label for the drive. (11 characters is usually max length)

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Most hard drives have a maximum label length of 11 characters, and DriveSetLabel will fail if max length is exceeded. Also, FAT32 partition labels tend to revert to all capital letters.

Related

DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial, DriveGetType, DriveSpaceFree, DriveSpaceTotal, DriveStatus

Example

DriveSetLabel("C:\", "New_Label")


Function DriveSpaceFree

Function Reference

DriveSpaceFree

Returns the free disk space of a path in Megabytes.

DriveSpaceFree ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Success: | Returns free disk space in Megabytes as a float number.
Failure: | Returns 0 and sets @error to 1.

Remarks

DriveSpaceFree may even work when a complete directory path (that exists) is given. However, a file path won't work.
Use the Round function if the return value is too precise.

Related

DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial, DriveGetType, DriveSetLabel, DriveSpaceTotal, DriveStatus

Example

$var = DriveSpaceFree( "c:\" )
MsgBox(4096, "Free space on C:", $var & " MB")


Function DriveSpaceTotal

Function Reference

DriveSpaceTotal

Returns the total disk space of a path in Megabytes.

DriveSpaceTotal ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Success: | Returns diskspace in Megabytes as a float number.
Failure: | Sets @error to 1.

Remarks

DriveSpaceTotal may even work when a complete directory path (that exists) is given. However, a file path won't work.

Related

DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial, DriveGetType, DriveSetLabel, DriveSpaceFree, DriveStatus, FileGetSize

Example

$var = DriveSpaceTotal( "c:\" )
MsgBox(4096, "Total Space on C:", $var & " MB")


Function DriveStatus

Function Reference

DriveStatus

Returns the status of the drive as a string.

DriveStatus ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Value | Interpretation
UNKNOWN | Drive may be unformatted (RAW).
READY | Typical of hard drives and drives that contain removable media.
NOTREADY | Typical of floppy and CD drives that do not contain media.
INVALID | May indicate the drive letter does not exist or that a mapped network drive is inaccessible.

Remarks

The list of possible return values may be incomplete.
DriveStatus may even work when a complete directory path (which exists) is given. However, a file path won't work.

Related

DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial, DriveGetType, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal, CDTray, FileExists

Example

$var = DriveStatus( "c:\" )
MsgBox(4096,"Status",$var)


Function FileChangeDir

Function Reference

FileChangeDir

Changes the current working directory.

FileChangeDir ( "path" )

Parameters

path The path to make the current working directory.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if working directory not changed.

Remarks

None.

Related

@WorkingDir

Example

FileChangeDir(@WindowsDir)


Function FileClose

Function Reference

FileClose

Closes a previously opened text file.

FileClose ( filehandle )

Parameters

filehandle The handle of a file, as returned by a previous call to FileOpen.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if the filehandle is invalid.

Remarks

Upon termination, AutoIt automatically closes any files it opened, but calling FileClose is still a good idea.

This function is also used to close search handles as returned by FileFindFirstFile().

Related

FileFindFirstFile, FileOpen, FileFindNextFile, FileFlush

Example

$handle = FileOpen("test.txt", 0)

FileClose($handle)


Function FileCopy

Function Reference

FileCopy

Copies one or more files.

FileCopy ( "source", "dest" [, flag] )

Parameters

source | The source path of the file(s) to copy. Wildcards are supported.
dest | The destination path of the copied file(s).
flag | [optional] this flag determines whether to overwrite files if they already exist. Can be a combination of the following: 0 = (default) do not overwrite existing files 1 = overwrite existing files 8 = Create destination directory structure if it doesn't exist (See Remarks).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

The destination directory must already exist, except using with flag value '8'.
For instance the combined flag '9' (1 + 8) overwrites the target file and pre-checks for the destination directory structure and if it doesn't exist creates it automatically.

See FileFindFirstFile for a discussion of wildcards.

Some file attributes can make the overwriting impossible.

Related

FileMove, FileDelete, DirCopy, DirCreate

Example

FileCopy("C:\*.au3", "D:\mydir\*.*")

; Method to copy a folder (with its contents)
DirCreate("C:\new")
FileCopy("C:\old\*.*", "C:\new\")

FileCopy("C:\Temp\*.txt", "C:\Temp\TxtFiles\", 8)
; RIGHT - 'TxtFiles' is now the target directory and the file names are given by the source names

FileCopy("C:\Temp\*.txt", "C:\Temp\TxtFiles\", 9) ; Flag = 1 + 8 (overwrite + create target directory structure)
; Copy the txt-files from source to target and overwrite target files with same name


Function FileCreateNTFSLink

Function Reference

FileCreateNTFSLink

Creates an NTFS hardlink to a file or a directory

FileCreateNTFSLink ( "source", "hardlink" [, flag] )

Parameters

source | Path of the source to which the hardlink will be created.
hardlink | Path of the hardlink.
flag | [optional] this flag determines whether to overwrite link if they already exist. Can be a combination of the following: 0 = (default) do not overwrite existing link 1 = overwrite existing link

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

The destination directory must already exist.

This function works only on volume with NTFS File system.

If the source is a file, the hardlink must be on the same volume.
If the source is a directory cross volume is allowed.

FileDelete or FileMove can be used on hardlink.

To manage the link with the explorer you can use the shell extension NTFSLink

Related

FileCreateShortcut

Example

FileChangeDir(@ScriptDir)

DirCreate('dir')
FileWriteLine("test.txt","test")
MsgBox(0,"Hardlink", FileCreateNTFSLink("test.txt", "dir\test.log", 1))


Function FileCreateShortcut

Function Reference

FileCreateShortcut

Creates a shortcut (.lnk) to a file.

FileCreateShortcut ( "file", "lnk" [, "workdir" [, "args" [, "desc" [, "icon" [, "hotkey" [, icon number [, state]]]]]]] )

Parameters

file | Full path and file name of file to create shortcut to.
lnk | Full path and file name of the shortcut.
workdir | [optional] Working directory.
args | [optional] Additional file arguments.
desc | [optional] File Description.
icon | [optional] Full Path/File name of icon to use.
hotkey | [optional] Hotkey - same as the Send() key format.
icon number | [optional] The icon instance to use (usually 0)
state | [optional] The state the shortcut is launched in. Use either @SW_SHOWNORMAL, @SW_SHOWMINNOACTIVE or @SW_SHOWMAXIMIZED

Return Value

Success: | Returns 1.
Failure: | Returns 0 if lnk cannot be created.

Remarks

Hotkeys for windows shortcuts are of the following form: Ctrl+Alt+X, Ctrl+Shift+X, Shift+Alt+X, Ctrl+NumPadKey, or Alt+NumPadKey where X represents a letter, number, punctuation, or function key. If you specify an invalid form, Windows typically defaults to Ctrl+Alt
Note that Windows distinguishes number pad keys from regular number and punctuation keys. FileCreateShortcut allows you to create Ctrl+X and Alt+X shortcuts (which Windows normally only allows when X is a NumPadKey); however, you should avoid these assignments as they may conflict with standard application hotkeys.
Windows prohibits ESC, ENTER, TAB, SPACEBAR, PRINT SCREEN, SHIFT, or BACKSPACE from being used in hotkeys.

FileCreateShortcut does not require a valid target, workdir, icon, or hotkey in order to "successfully" create the LNK file; however, the destination of the LNK file must be valid! If the hotkey you choose is already in use, your new shortcut takes precedence. Also, if you create a shortcut with the same path\name as as a pre-existing shortcut, it gets overwritten with your new version.

Related

FileGetShortcut, FileCreateNTFSLink

Example

; Sets a shortcut with ctrl+alt+t hotkey
FileCreateShortcut(@WindowsDir & "\Explorer.exe",@DesktopDir & "\Shortcut Test.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "15", @SW_MINIMIZE)


Function FileDelete

Function Reference

FileDelete

Delete one or more files.

FileDelete ( "path" )

Parameters

Path The path of the file(s) to delete. Wildcards are supported.

Return Value

Success: | Return 1.
Failure: | Returns 0 if files are not deleted or do not exist.

Remarks

Note: If the "path" passed to FileDelete is a folder, the files therein will be deleted just as if you had used the *.* mask.
See FileFindFirstFile for a discussion of wildcards.

Some file attributes can make the deletion impossible.

Related

FileCopy, FileMove, FileRecycle, DirRemove, FileRecycleEmpty

Example

FileDelete("D:\*.tmp")


Function FileExists

Function Reference

FileExists

Checks if a file or directory exists.

FileExists ( "path" )

Parameters

Path The directory or file to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if path/file does not exist.

Remarks

FileExists returns 0 if you specify a floppy drive which does not contain a disk.

Related

FileGetAttrib, DriveStatus

Example

If FileExists("C:\autoexec.bat") Then
MsgBox(4096, "C:\autoexec.bat File", "Exists")
Else
MsgBox(4096,"C:\autoexec.bat File", "Does NOT exists")
EndIf

If FileExists("C:\") Then
MsgBox(4096, "C:\ Dir ", "Exists")
Else
MsgBox(4096,"C:\ Dir" , "Does NOT exists")
EndIf

If FileExists("D:") Then
MsgBox(4096, "D: Drive", "Exists")
Else
MsgBox(4096,"D: Drive", "Does NOT exists")
EndIf


Function FileFindFirstFile

Function Reference

FileFindFirstFile

Returns a search "handle" according to file search string.

FileFindFirstFile ( "filename" )

Parameters

filename File search string. (* and ? wildcards accepted)

Return Value

Success: | Returns a search "handle" for use with subsequent FileFindNextFile functions.
Failure: | Returns -1 if error occurs. If the Folder is empty the @error is set to 1.

Remarks

The search string is not case sensitive.
Wildcards: In general, * denotes zero or more characters, and ? denotes zero or one character. If your file search string contains only wildcards (or is "*.*"), then see the example below for the return value!

You can use only one wildcard in the filename part or in the extension part i.e. a*.b?.
?? seems equivalent to * (not described in Microsoft documentation).
When using a 3-char extension any extension starting with those 3 chars will match, .e.g. "*.log" will match "test.log_1". (not described either in Microsoft documentation).

When you have finished searching with the FileFind... functions you must call FileClose() to release the search handle.

Directory name are return according to the wildcards if any.

Related

FileClose, FileFindNextFile

Example

; Shows the filenames of all files in the current directory.
$search = FileFindFirstFile("*.*")

; Check if the search was successful
If $search = -1 Then
MsgBox(0, "Error", "No files/directories matched the search pattern")
Exit
EndIf

While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop

MsgBox(4096, "File:", $file)
WEnd

; Close the search handle
FileClose($search)


Function FileFindNextFile

Function Reference

FileFindNextFile

Returns a filename according to a previous call to FileFindFirstFile.

FileFindNextFile ( search )

Parameters

search The search handle, as returned by FileFindFirstFile.

Return Value

Success: | Returns a filename according to a previous call to FileFindFirstFile, @extended set to 1 if filename is a directory.
Failure: | Sets @error to 1 if no more files/directories match the search.

Remarks

A previous call to FileFindFirstFile is necessary to setup the search and get a search handle. Every subsequent call to FileFindNextFile will return the next file found according to the search string supplied to FileFindFirstFile. When @error = 1, no more files found matching the original search string.

When you have finished searching with the FileFind... functions you must call FileClose() to release the search handle.

Related

FileClose, FileFindFirstFile

Example

; Shows the filenames of all files in the current directory
$search = FileFindFirstFile("*.*")

; Check if the search was successful
If $search = -1 Then
MsgBox(0, "Error", "No files/directories matched the search pattern")
Exit
EndIf

While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop

MsgBox(4096, "File:", $file)
WEnd

; Close the search handle
FileClose($search)


Function FileFlush

Function Reference

FileFlush

Flushes the file's buffer to disk.

FileFlush ( handle )

Parameters

handle A handle to a file previously opened with FileOpen().

Return Value

Success: | Returns true if the buffer was flushed (or did not need to be flushed).
Failure: | Returns false.

Remarks

A file is flushed when it's handle is closed or when Windows internal buffer is full. This function forces an immediate flushing of the buffer.
This function can only be used with file handles returned from FileOpen().

Related

FileClose, FileOpen, FileWrite, FileWriteLine, FileSetPos

Example

Local Const $sFile = "test.txt"
Local $hFile = FileOpen($sFile, 1)

; Check if file opened for writing OK
If $hFile = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

; Write something to the file.
FileWriteLine($hFile, "Line1")

; Run notepad to show that the file is empty because it hasn't been flushed yet.
RunWait("notepad.exe " & $sFile)

; Flush the file to disk.
FileFlush($hFile)

; Run notepad again to show that the contents of the file are now flushed to disk.
RunWait("notepad.exe " & $sFile)

; Close the handle.
FileClose($hFile)

; Clean up the temporary file.
FileDelete($sFile)


Function FileGetAttrib

Function Reference

FileGetAttrib

Returns a code string representing a file's attributes.

FileGetAttrib ( "filename" )

Parameters

filename Filename (or directory) to check.

Return Value

Success: | Returns a code string representing a files attributes.
Failure: | Returns "" (blank string) and sets @error to 1.

Remarks

String returned could contain a combination of these letters "RASHNDOCT":
"R" = READONLY
"A" = ARCHIVE
"S" = SYSTEM
"H" = HIDDEN
"N" = NORMAL
"D" = DIRECTORY
"O" = OFFLINE
"C" = COMPRESSED (NTFS compression, not ZIP compression)
"T" = TEMPORARY

Related

FileGetTime, FileSetAttrib, FileExists, FileGetSize, FileSetTime

Example

$attrib = FileGetAttrib("c:\boot.ini")
If @error Then
MsgBox(4096,"Error", "Could not obtain attributes.")
Exit
Else
If StringInStr($attrib, "R") Then
MsgBox(4096,"", "File is read-only.")
EndIf
EndIf

; Display full attribute information in text form
; Arrays rely upon the fact that each capital letter is unique
; Figuring out how this works is a good string exercise...
$input = StringSplit("R,A,S,H,N,D,O,C,T",",")
$output = StringSplit("Read-only /, Archive /, System /, Hidden /" & _
", Normal /, Directory /, Offline /, Compressed /, Temporary /", ",")
For $i = 1 to 9
$attrib = StringReplace($attrib, $input[$i], $output[$i], 0, 1)
; last parameter in StringReplace means case-sensitivity
Next
$attrib = StringTrimRight($attrib, 2) ;remove trailing slash
MsgBox(0,"Full file attributes:", $attrib)


Function FileGetEncoding

Function Reference

FileGetEncoding

Determines the text encoding used in a file.

FileGetEncoding ( "filehandle/filename" [, mode] )

Parameters

filehandle/filename | The handle of a file, as returned by a previous call to FileOpen. Alternatively you may use a string filename as the first parameter.
mode | [optional] The UTF8 detection mode to use. 1 = Check entire file for UTF8 sequences (default) 2 = Check first part of file for UTF8 sequences (the same as FileOpen uses by default)

Return Value

Success: | Returns the file encoding using similar values to the FileOpen function:
 | 0 = ANSI
 | 32 = UTF16 Little Endian.
 | 64 = UTF16 Big Endian.
 | 128 = UTF8 (with BOM).
 | 256 = (without BOM).
Failure: | Returns -1.

Remarks

If a filename is given rather than a file handle - the file will be opened and closed during the function call.
Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Use either filehandles or filenames in your routines, not both!

If a file handle is used then the "mode" parameter has no effect - the mode used for FileOpen takes precedence.

Related

FileOpen, FileRead, FileReadLine, FileWrite, FileWriteLine


Function FileGetLongName

Function Reference

FileGetLongName

Returns the long path+name of the path+name passed.

FileGetLongName ( "file" [, flag] )

Parameters

file | full path and file name to convert
flag | [optional] if 1 file can have relative dir, e.g. "..\file.txt"

Return Value

Success: | Returns the long path+name of the path+name passed.
Failure: | Returns the parameter and sets @error to 1.

Remarks

None.

Related

FileGetShortName

Example

$a = FileGetLongName(@HomeDrive & "\PROGRA~1\")
msgbox(0,"long file name", $a)
;$a is probably "x:\Program Files"


Function FileGetPos

Function Reference

FileGetPos

Retrieves the current file position.

FileGetPos ( handle )

Parameters

handle A handle to a file previously opened with FileOpen().

Return Value

Success: | Returns the position offset from the beginning of the file (First index is 0).
Failure: | Returns 0 and sets @error.

Remarks

Failure returns 0 but 0 is also a valid file position so check @error to determine error conditions.

Related

FileSetPos, FileRead, FileReadLine, FileWrite, FileWriteLine, FileOpen

Example

#include <Constants.au3>

Local Const $sFile = "test.txt"
Local $hFile = FileOpen($sFile, 2)

; Check if file opened for writing OK
If $hFile = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

; Write something to the file.
FileWriteLine($hFile, "Line1")
FileWriteLine($hFile, "Line2")
FileWriteLine($hFile, "Line3")

; Flush the file to disk.
FileFlush($hFile)

; Check file position and try to read contents for current position.
MsgBox(0, "", "Position: " & FileGetPos($hFile) & @CRLF & "Data: " & @CRLF & FileRead($hFile))

; Now, adjust the position to the beginning.
Local $n = FileSetPos($hFile, 0, $FILE_BEGIN)

; Check file position and try to read contents for current position.
MsgBox(0, "", "Position: " & FileGetPos($hFile) & @CRLF & "Data: " & @CRLF & FileRead($hFile))

; Close the handle.
FileClose($hFile)

; Clean up the temporary file.
FileDelete($sFile)


Function FileGetShortcut

Function Reference

FileGetShortcut

Retrieves details about a shortcut.

FileGetShortcut ( "lnk" )

Parameters

lnk Full path and file name of the shortcut.

Return Value

Success: | Returns an array that contains the shortcut information. See Remarks.
Failure: | Sets @error to 1 if the shortcut could not be accessed.

Remarks

The array returned from this function is a single dimension array containing the following elements:
$array[0] = Shortcut target path
$array[1] = Working directory
$array[2] = Arguments
$array[3] = Description
$array[4] = Icon filename
$array[5] = Icon index
$array[6] = The shortcut state (@SW_SHOWNORMAL, @SW_SHOWMINNOACTIVE, @SW_SHOWMAXIMIZED)

Related

FileCreateShortcut

Example

; Sets a shortcut with ctrl+alt+t hotkey
FileCreateShortcut(@WindowsDir & "\Explorer.exe",@DesktopDir & "\Shortcut Test.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "15", @SW_MINIMIZE)

; Read in the path of a shortcut
$details = FileGetShortcut(@DesktopDir & "\Shortcut Test.lnk")
MsgBox(0, "Path:", $details[0])


Function FileGetShortName

Function Reference

FileGetShortName

Returns the 8.3 short path+name of the path+name passed.

FileGetShortName ( "file" [, flag] )

Parameters

file | full path and file name to convert
flag | [optional] if 1 file can have relative dir, e.g. "..\file.txt"

Return Value

Success: | Returns the 8.3 short path+name of the path+name passed.
Failure: | Returns the parameter and sets @error to 1.

Remarks

The file need to exist as there is no way to known the exact ~i if several file have the same 8 first characters.

Related

FileGetLongName

Example

$a = FileGetShortName(@HomeDrive & "\Program Files")
msgbox(0,"long file name", $a)
;$a is probably "x:\PROGRA~1"


Function FileGetSize

Function Reference

FileGetSize

Returns the size of a file in bytes.

FileGetSize ( "filename" )

Parameters

filename Filename to check.

Return Value

Success: | Returns the size of the file in bytes.
Failure: | Returns 0 and set the @error to 1.

Remarks

Does not work on directories.
Divide result by 1024 to get kilobyte equivalent, or divide by 1048576 to get megabyte equivalent.

Related

FileGetAttrib, FileGetTime, DriveSpaceTotal, FileGetVersion

Example

$size = FileGetSize("AutoIt.exe")


Function FileGetTime

Function Reference

FileGetTime

Returns the time and date information for a file.

FileGetTime ( "filename" [, option [, format]] )

Parameters

filename | Filename to check.
option | [optional] Flag to indicate which timestamp 0 = Modified (default) 1 = Created 2 = Accessed
format | [optional] to specify type of return 0 = return an array (default) 1 = return a string YYYYMMDDHHMMSS

Return Value

Success: | Returns an array or string that contains the file time information. See Remarks.
Failure: | Returns 0 and sets @error to 1.

Remarks

The array is a single dimension array containing six elements:
$array[0] = year (four digits)
$array[1] = month (range 01 - 12)
$array[2] = day (range 01 - 31)
$array[3] = hour (range 00 - 23)
$array[4] = min (range 00 - 59)
$array[5] = sec (range 00 - 59)
Notice that return values are zero-padded.

Related

FileGetSize, FileGetAttrib, FileGetVersion, FileSetTime, FileSetAttrib

Example

$t = FileGetTime(@Windowsdir & "\Notepad.exe", 1)

If Not @error Then
$yyyymd = $t[0] & "/" & $t[1] & "/" & $t[2]
MsgBox(0, "Creation date of notepad.exe", $yyyymd)
EndIf


Function FileGetVersion

Function Reference

FileGetVersion

Returns the "File" version information.

FileGetVersion ( "filename" [,"stringname"] )

Parameters

filename | Filename to check.
stringname | [optional] name of the field to be retrieved from the header version file info.

Return Value

Success: | Returns a string containing the version information, e.g. "3.0.81.0".
Failure: | Returns "0.0.0.0" if no version information (or other error) or "" when retrieving a stringname, and sets @error to 1.

Remarks

stringname can be the basic one as :
Comments, InternalName, ProductName, CompanyName, LegalCopyright, ProductVersion,
FileDescription, LegalTrademarks, PrivateBuild, FileVersion, OriginalFilename, SpecialBuild

Or a special one "CompiledScript" which is set for a compiled script. FileGetVersion(@AutoItExe, "CompiledScript") will return "AutoIt v3 Script : 3, 2, 1, 2".

Another special stringname is "DefaultLangCodepage" can be used to retrieve the default language and codepage.

The language and codepage can be used if needed to differentiate the "stringname" i.e. "080904b0\Comments" (see MSDN StringFileInfo in VerQueryValue function).

Related

FileGetSize, FileGetTime

Example

$ver = FileGetVersion("Explorer.exe")
MsgBox(0, "Explorer version", $ver)


Function FileInstall

Function Reference

FileInstall

Include and install a file with the compiled script.

FileInstall ( "source", "dest" [, flag] )

Parameters

source | The source path of the file to compile. This must be a literal string; it cannot be a variable or the result of a function call. It can be a relative path (using .\ or ..\ in the path) to the source file (.au3).
dest | The destination path of the file with trailing backslash if only the directory is used. This can be a variable.
flag | [optional] this flag determines whether to overwrite files if they already exist: 0 = (default) do not overwrite existing files 1 = overwrite existing files

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

The FileInstall function is designed to include files into a compiled AutoIt script. These included files can then be "extracted" during execution of the compiled script if the statement is executed. Keep in mind that files such as images can greatly increase the size of a compiled script.
The source file must be specified using a string literal and can not be a variable, a calculation nor function call. The file must be able to be found during compiling, however variables, calculations and function calls do not get resolved until the script itself is running, long after compiling, making them unsuitable to define the source file.
The source cannot contain wildcards.

When this function is used from a non-compiled script, a copy operation is performed instead (to allow for easy testing pre-compilation).
Files maintain their original creation/modification timestamps when installed.

The destination directory path must already exist before this function is called, or the FileInstall will fail, returning 0 and not creating the file, nor path. See DirCreate() for information about creating the directory path.

The file attributes on an existing file may prevent the file from being overwritten. Use FileDelete() or FileSetAttrib() to ensure the file can be installed without issue.

Related

DirCreate, FileDelete, FileSetAttrib

Example

; Include a bitmap found in "C:\test.bmp" with the compiled program and put it in "D:\mydir\test.bmp" when it is run
$b = True
If $b = True Then FileInstall("C:\test.bmp", "D:\mydir\test.bmp")


Function FileMove

Function Reference

FileMove

Moves one or more files

FileMove ( "source", "dest" [, flag] )

Parameters

source | The source path and filename of the file to move. (* wildcards are supported)
dest | The destination path and filename of the moved file. (* wildcards are supported)
flag | [optional] this flag determines whether to overwrite files if they already exist: Can be a combination of the following: 0 = (default) do not overwrite existing files 1 = overwrite existing files 8 = Create destination directory structure if it doesn't exist (See Remarks).

Return Value

Success: | Returns 1.
Failure: | Returns 0 if source cannot be moved or if dest already exists and flag=0.

Remarks

If the source and destination paths are on different volumes a copy and delete operation is performed rather than a move.

Because AutoIt lacks a "FileRename" function, use FileMove to rename a file!

The destination directory must already exist, except using with flag value '8'.
For instance the combined flag '9' (1 + 8) overwrites the target file and prechecks for the destination directory structure and if it doesn't exist creates it automatically.

Some file attributes can make the overwriting impossible.

Related

FileCopy, FileDelete, FileRecycle, DirMove

Example

FileMove("C:\foo.au3", "D:\mydir\bak.au3")

; Second example:
; uses flags '1' (owerwriting) and '8' (autocreating target dir structure) together
; moves all txt-files from temp to txtfiles and prechecks if
; target directory structure exists, if not then automatically creates it
FileMove(@TempDir & "\*.txt", @TempDir & "\TxtFiles\", 9)


Function FileOpen

Function Reference

FileOpen

Opens a text file for reading or writing.

FileOpen ( "filename" [, mode ] )

Parameters

filename | Filename of the text file to open.
mode | [optional] Mode to open the file in. Can be a combination of the following: 0 = Read mode (default) 1 = Write mode (append to end of file) 2 = Write mode (erase previous contents) 8 = Create directory structure if it doesn't exist (See Remarks). 16 = Force binary mode (See Remarks). 32 = Use Unicode UTF16 Little Endian reading and writing mode. Reading does not override existing BOM. 64 = Use Unicode UTF16 Big Endian reading and writing mode. Reading does not override existing BOM. 128 = Use Unicode UTF8 (with BOM) reading and writing mode. Reading does not override existing BOM. 256 = Use Unicode UTF8 (without BOM) reading and writing mode. 16384 = When opening for reading and no BOM is present, use full file UTF8 detection. If this is not used then only the initial part of the file is checked for UTF8. The folder path must already exist (except using mode '8' - See Remarks).

Return Value

Success: | Returns a file "handle" for use with subsequent file functions.
Failure: | Returns -1 if error occurs.

Remarks

  • The file handle must be closed with the FileClose() function.

  • A file may fail to open due to access rights or attributes.

  • The default mode when writing text is ANSI - use the unicode flags to change this. When writing unicode files the Windows default mode (and the fastest in AutoIt due to the least conversion) is UTF16 Little Endian (mode 32).

  • Opening a file in write mode creates the file if it does not exist. Directories are not created unless the correct flag is used.

  • When reading and writing via the same file handle, the FileSetPos() function must be used to update the current file position.

Related

FileClose, FileFlush, FileRead, FileReadLine, FileWrite, FileWriteLine, FileGetPos, FileSetPos

Example

$file = FileOpen("test.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

FileClose($file)

; Another sample which automatically creates the directory structure
$file = FileOpen("test.txt", 10) ; which is similar to 2 + 8 (erase + create dir)

If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

FileClose($file)


Function FileOpenDialog

Function Reference

FileOpenDialog

Initiates a Open File Dialog.

FileOpenDialog ( "title", "init dir", "filter" [, options [, "default name" [, hwnd]]] )

Parameters

title | Title text of the Dialog GUI.
init dir | Initial directory selected in the GUI file tree.
filter | File type single filter such as "All (*.*)" or "Text files (*.txt)" or multiple filter groups such as "All (*.*)|Text files (*.txt)" (See Remarks).
options | [optional] Dialog Options: To use more than one option, add the required values together. 1 = File Must Exist (if user types a filename) 2 = Path Must Exist (if user types a path, ending with a backslash) 4 = Allow MultiSelect 8 = Prompt to Create New File (if does not exist)
default name | [optional] Suggested file name for the user to open. Default is blank ("").
hwnd | [optional] The window handle to use as the parent for this dialog.

Return Value

Success: | Returns the full path of the file(s) chosen. Results for multiple selections are "Directory|file1|file2|..."
Failure: | Sets @error
@error: | 1 - File selection failed.
 | 2 - Bad file filter

Remarks

Separate the file filters with a semicolon as shown in the example.
Multiple groups of filters are separated by a pipe "|".

If default name is given, options must also be given. If none of the options are wanted, use 0 for options.

Special Windows folders (such as "My Documents") can sometimes be set as the init dir; see Appendix.

@WorkingDir is changed on successful return.

Related

FileSaveDialog, FileSelectFolder, StringSplit

Example

$message = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.bmp)", 1 + 4 )

If @error Then
MsgBox(4096,"","No File(s) chosen")
Else
$var = StringReplace($var, "|", @CRLF)
MsgBox(4096,"","You chose " & $var)
EndIf

; Multiple filter group
$message = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($message, @WindowsDir & "", "Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)", 1 + 4 )

If @error Then
MsgBox(4096,"","No File(s) chosen")
Else
$var = StringReplace($var, "|", @CRLF)
MsgBox(4096,"","You chose " & $var)
EndIf


Function FileRead

Function Reference

FileRead

Read in a number of characters from a previously opened text file.

FileRead ( "filehandle/filename" [, count] )

Parameters

filehandle/filename | The handle of a file, as returned by a previous call to FileOpen. Alternatively you may use a string filename as the first parameter.
count | [optional] The number of characters to read. Default read the entire file.

Return Value

Success: | Returns the binary/string read. @extended is set to the number of bytes/characters returned.
Special: | Sets @error to -1 if end-of-file is reached.
Failure: | Sets @error to 1 if file not opened in read mode or other error.

Remarks

If a filename is given rather than a file handle - the file will be opened and closed during the function call - for parsing large text files this will be much slower than using filehandles.
Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Use either filehandles or filenames in your routines, not both!

Both ANSI and UTF16/UTF8 text formats can be read - AutoIt will automatically determine the type.

A file can be read as binary(byte) data by using FileOpen with the binary flag - in this case count is in bytes rather than characters.

Related

FileOpen, FileReadLine, FileWrite, FileWriteLine, String, FileSetPos, FileGetPos

Example

$file = FileOpen("test.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

; Read in 1 character at a time until the EOF is reached
While 1
$chars = FileRead($file, 1)
If @error = -1 Then ExitLoop
MsgBox(0, "Char read:", $chars)
Wend

FileClose($file)


Function FileReadLine

Function Reference

FileReadLine

Read in a line of text from a previously opened text file.

FileReadLine ( "filehandle/filename" [, line] )

Parameters

filehandle/filename | The handle of a file, as returned by a previous call to FileOpen. Alternatively you may use a string filename as the first parameter.
line | [optional] The line number to read. The first line of a text file is line 1 (not zero), last line is -1.

Return Value

Success: | Returns a line of text.
Special: | Sets @error to -1 if end-of-file is reached.
Failure: | Sets @error to 1 if file not opened in read mode or other error.

Remarks

Returns the text of the line read, any newline characters ( CHR(10) or @LF ) at the end of a line read in are automatically stripped.
If no line number to read is given, the "next" line will be read. ("Next" for a newly opened file is initially the first line.)
If a filename is given rather than a file handle - the file will be opened and closed during the function call - for parsing large text files this will be much slower than using filehandles.
Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Use either filehandles or filenames in your routines, not both!

From a performance standpoint it is a bad idea to read line by line specifying "line" parameter whose value is incrementing by one. This forces AutoIt to reread the file from the beginning until it reach the specified line.

Both ANSI and UTF16/UTF8 text formats can be read - AutoIt will automatically determine the type.

Related

IniRead, FileOpen, FileRead, FileWrite, FileWriteLine, FileSetPos, FileGetPos

Example

$file = FileOpen("test.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
MsgBox(0, "Line read:", $line)
Wend

FileClose($file)


Function FileRecycle

Function Reference

FileRecycle

Sends a file or directory to the recycle bin.

FileRecycle ( "source" )

Parameters

source The source path of the file(s) or directory to Recycle. Wildcards are supported.

Return Value

Success: | Returns 1.
Failure: | Returns 0 (typically meaning the file is in use or does not exist).

Remarks

See FileFindFirstFile for a discussion of wildcards.
To remove a directory, simply give the path without a trailing backslash.

Related

FileDelete, FileRecycleEmpty, DirRemove, FileMove

Example

FileRecycle("C:\*.tmp")


Function FileRecycleEmpty

Function Reference

FileRecycleEmpty

Empties the recycle bin.

FileRecycleEmpty ( ["source"] )

Parameters

source [optional] The rootpath to empty - if omitted the recycle bin for all drives is emptied.

Return Value

Success: | Returns 1.
Failure: | Returns 0 (the recycle bin cannot be emptied - see below).

Remarks

For this function to work IE4+ must be available.

Related

FileDelete, FileRecycle

Example

FileRecycleEmpty("C:\")


Function FileSaveDialog

Function Reference

FileSaveDialog

Initiates a Save File Dialog.

FileSaveDialog ( "title", "init dir", "filter" [, options [, "default name" [, hwnd]]] )

Parameters

title | Title text of the Dialog GUI.
init dir | Initial directory selected in the GUI file tree.
filter | File type single filter such as "All (*.*)" or "Text files (*.txt)" or multiple filter groups such as "All (*.*)|Text files (*.txt)" (See Remarks).
options | [optional] 2 = Path Must Exist (if user types a path, ending with a backslash) 16 = Prompt to OverWrite File
default name | [optional] File name to suggest to the user to save the file with. Default is blank ("").
hwnd | [optional] The window handle to use as the parent for this dialog.

Return Value

Success: | Returns the full path of the file chosen. Results for multiple selections are "Directory|file1|file2|..."
Failure: | Sets @error
@error: | 1 - File selection failed.
 | 2 - Bad file filter

Remarks

Separate the file filters with a semicolon as shown in the example.
Multiple groups of filters are separated by a pipe "|".

If default name is given, options must also be given. If none of the options are wanted, use 0 for options.

Special Windows folders (such as "My Documents") can sometimes be set as the init dir; see Appendix.

@WorkingDir is changed on successful return.

Related

FileOpenDialog, FileSelectFolder

Example

$MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"

$var = FileSaveDialog( "Choose a name.", $MyDocsFolder, "Scripts (*.aut;*.au3)", 2)
; option 2 = dialog remains until valid path/file selected

If @error Then
MsgBox(4096,"","Save cancelled.")
Else
MsgBox(4096,"","You chose " & $var)
EndIf

; Multiple filter group
$var = FileSaveDialog( "Choose a name.", $MyDocsFolder, "Scripts (*.aut;*.au3)|Text files (*.ini;*.txt)", 2)
; option 2 = dialog remains until valid path/file selected

If @error Then
MsgBox(4096,"","Save cancelled.")
Else
MsgBox(4096,"","You chose " & $var)
EndIf


Function FileSelectFolder

Function Reference

FileSelectFolder

Initiates a Browse For Folder dialog.

FileSelectFolder ( "dialog text", "root dir" [, flag [, "initial dir" [, hwnd]]] )

Parameters

dialog text | Text greeting in dialog.
root dir | Root directory of GUI file tree. Use "" for Desktop to be root.
flag | [optional] 1 = Show Create Folder Button (requires IE6.0 or later) 2 = Use New Dialog Style (requires IE5.0 or later) 4 = Show Edit Control (to type a foldername)
initial dir | [optional] Initial/start directory that will be selected if exist. Default is blank ("").
hwnd | [optional] The window handle to use as the parent for this dialog.

Return Value

Success: | Returns full path of the folder chosen.
Failure: | Returns "" (blank string) and sets @error to 1 if user cancels/closes the window.

Remarks

The root dir will be chosen if the initial dir (if given) does not exist.
A nonexistent root dir will also cause the Desktop folder to be root.
The "Create Folder Button" option may require Windows XP with IE6 in order to work.
Special Windows folders (such as "My Documents") can be set as root by using the right CLSID detailed in the Appendix.
UNC paths are not supported. If you think that user's may choose files on a UNC path then the path needs to be mapped as a drive first.

Related

FileSaveDialog, FileOpenDialog

Example

$var = FileSelectFolder("Choose a folder.", "")


Function FileSetAttrib

Function Reference

FileSetAttrib

Sets the attributes of one or more files.

FileSetAttrib ( "file pattern", "+-RASHNOT" [, recurse] )

Parameters

file pattern | File(s) to change, e.g. C:\*.au3, C:\Dir
+-RASHNOT | Attribute(s) to set/clear. e.g. "+A", "+RA-SH"
recurse | [optional] If this is set to 1, then directories are recursed into. Default is 0 (no recursion).

Return Value

Success: | Returns 1.
Failure: | Returns 0 if encountered any errors.

Remarks

The file pattern cannot contain spaces!
The attributes that can be modified with the function are + or -:
"R" = READONLY
"A" = ARCHIVE
"S" = SYSTEM
"H" = HIDDEN
"N" = NORMAL
"O" = OFFLINE
"T" = TEMPORARY

(Note that you cannot set the compressed/directory attributes with this function.)

Related

FileGetAttrib, FileGetTime, FileSetTime

Example

;mark all .au3 files in current directory as read-only and system
If Not FileSetAttrib("*.au3", "+RS") Then
MsgBox(4096,"Error", "Problem setting attributes.")
EndIf

;make all .bmp files in C:\ and sub-directories writable and archived
If Not FileSetAttrib("C:\*.bmp", "-R+A", 1) Then
MsgBox(4096,"Error", "Problem setting attributes.")
EndIf


Function FileSetPos

Function Reference

FileSetPos

Sets the current file position.

FileSetPos ( handle, offset, origin )

Parameters

handle | A handle to a file previously opened with FileOpen().
offset | The offset to move from the origin. This value may be positive or negative. Negative values move backwards from the origin.
origin | Must be one of the following: 0 - Beginning of the file ($FILE_BEGIN from Constants.au3). 1 - Current position ($FILE_CURRENT from Constants.au3). 2 - End of the file ($FILE_END from Constants.au3).

Return Value

Success: | True if the operation succeeded.
Failure: | False.

Remarks

Include Constants.au3 in your script to use the symbolic name in parentheses to specify the origin.
Using FileSetPos() it is possible to both read and write to the same file. When attempting to read and write to the same file, always call FileFlush() between each write and read operation.
Moving the pointer to the middle of the data can be used to overwrite data.

Related

FileGetPos, FileFlush, FileRead, FileReadLine, FileWrite, FileWriteLine, FileOpen

Example

#include <Constants.au3>

Local Const $sFile = "test.txt"
Local $hFile = FileOpen($sFile, 2)

; Check if file opened for writing OK
If $hFile = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

; Write something to the file.
FileWriteLine($hFile, "Line1")
FileWriteLine($hFile, "Line2")
FileWriteLine($hFile, "Line3")

; Flush the file to disk.
FileFlush($hFile)

; Check file position and try to read contents for current position.
MsgBox(0, "", "Position: " & FileGetPos($hFile) & @CRLF & "Data: " & @CRLF & FileRead($hFile))

; Now, adjust the position to the beginning.
Local $n = FileSetPos($hFile, 0, $FILE_BEGIN)

; Check file position and try to read contents for current position.
MsgBox(0, "", "Position: " & FileGetPos($hFile) & @CRLF & "Data: " & @CRLF & FileRead($hFile))

; Close the handle.
FileClose($hFile)

; Clean up the temporary file.
FileDelete($sFile)


Function FileSetTime

Function Reference

FileSetTime

Sets the timestamp of one of more files.

FileSetTime ( "file pattern", "time" [, type [, recurse] ] )

Parameters

file pattern | File(s) to change, e.g. C:\*.au3, C:\Dir
time | The new time to set in the format "YYYYMMDDHHMMSS" (Year, month, day, hours (24hr clock), seconds). If the time is blank "" then the current time is used.
type | [optional] The timestamp to change: 0 = Modified (default), 1 = Created, 2 = Accessed
recurse | [optional] If this is set to 1, then directories are recursed into. Default is 0 (no recursion).

Return Value

Success: | Returns 1.
Failure: | Returns 0 if error changing timestamp(s).

Remarks

Using a date earlier than 1980-01-01 will have no effect.
Trying to change a timestamp on read-only files will result in a error.

Related

FileGetTime, FileGetAttrib, FileSetAttrib

Example

;change file.au3's "modified" timestamp to 1st Nov 2003 and current time
$var = FileSetTime("file.au3", "20031101")


Function FileWrite

Function Reference

FileWrite

Append a text/data to the end of a previously opened file.

FileWrite ( "filehandle/filename", "text/data" )

Parameters

filehandle/filename | The handle of a file, as returned by a previous call to FileOpen. Alternatively, you may use a string filename as the first parameter.
text/data | The text/data to write to the file. The text is written as is - no @CR or @LF characters are added. See remark for data type.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if file not opened in writemode, file is read only, or file cannot otherwise be written to.

Remarks

The file must be opened in write mode or the FileWrite command will fail.

If a filename is given rather than a file handle, the file will be opened and closed during the function call. For parsing large text files this will be much slower than using filehandles. However, filename will be created if it does not already exist.

Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Either use filehandles or filenames in your routines, not both.

When writing text AutoIt will write using ANSI by default. To write in Unicode mode the file must be opened with FileOpen() and the relevant flags.

If the data is a binary type variant (and not text) it will be written to the file byte by byte. Binary operation can also be forced by using Fileopen with the binary flag.

Related

FileFlush, FileOpen, FileRead, FileReadLine, FileWriteLine, Binary, FileSetPos, FileGetPos

Example

$file = FileOpen("test.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

FileWrite($file, "Line1")
FileWrite($file, "Still Line1" & @CRLF)
FileWrite($file, "Line2")

FileClose($file)


Function FileWriteLine

Function Reference

FileWriteLine

Append a line of text to the end of a previously opened text file.

FileWriteLine ( "filehandle/filename", "line" )

Parameters

filehandle/filename | The handle of a file, as returned by a previous call to FileOpen. Alternatively, you may use a string filename as the first parameter.
line | The line of text to write to the text file. If the line does NOT end in @CR or @LF then a DOS linefeed (@CRLF) will be automatically added.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if file not opened in writemode, file is read only, or file cannot otherwise be written to.

Remarks

The text file must be opened in write mode or the FileWriteLine command will fail.

If a filename is given rather than a file handle, the file will be opened and closed during the function call. For parsing large text files this will be much slower than using filehandles. However, filename will be created if it does not already exist.

Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Either use filehandles or filenames in your routines, not both.

When writing text AutoIt will write using ANSI by default. To write in Unicode mode the file must be opened with FileOpen() and the relevant flags.

The text to write cannot contain Chr(0) characters as the output is truncated. FileWrite() using a file opened in binary mode must be used to write such characters.

Related

FileFlush, FileOpen, FileRead, FileReadLine, FileWrite, FileSetPos, FileGetPos

Example

$file = FileOpen("test.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

FileWriteLine($file, "Line1")
FileWriteLine($file, "Line2" & @CRLF)
FileWriteLine($file, "Line3")

FileClose($file)


Function IniDelete

Function Reference

IniDelete

Deletes a value from a standard format .ini file.

IniDelete ( "filename", "section" [, "key"] )

Parameters

filename | The filename of the .ini file.
section | The section name in the .ini file.
key | [optional] The key name in the .ini file to delete. If the key name is not given the entire section is deleted. The Default keyword may also be used which will cause the section to be deleted.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if the INI file does not exist or if the file is read-only.

Remarks

A standard ini file looks like:
[SectionName]
Key=Value

Related

IniRead, IniWrite, IniReadSection, IniReadSectionNames, IniRenameSection, IniWriteSection

Example

IniDelete("C:\Temp\myfile.ini", "section2", "key")


Function IniRead

Function Reference

IniRead

Reads a value from a standard format .ini file.

IniRead ( "filename", "section", "key", "default" )

Parameters

filename | The filename of the .ini file.
section | The section name in the .ini file.
key | The key name in the in the .ini file.
default | The default value to return if the requested key is not found.

Return Value

Success: | Returns the requested key value.
Failure: | Returns the default string if requested key not found.

Remarks

A standard ini file looks like:
[SectionName]
Key=Value

Related

IniDelete, IniWrite, FileReadLine, IniReadSection, IniReadSectionNames, IniRenameSection, IniWriteSection

Example

$var = IniRead("C:\Temp\myfile.ini", "section2", "key", "NotFound")
MsgBox(4096, "Result", $var)


Function IniReadSection

Function Reference

IniReadSection

Reads all key/value pairs from a section in a standard format .ini file.

IniReadSection ( "filename", "section" )

Parameters

filename | The filename of the .ini file.
section | The section name in the .ini file.

Return Value

Success: | Returns a 2 dimensional array where element[n][0] is the key and element[n][1] is the value.
Failure: | Sets @error=1 if unable to read the section (The INI file may not exist or the section may not exist)

Remarks

A standard ini file looks like:
[SectionName]
Key=Value

The number of elements returned will be in $result[0][0]. If an @error occurs, no array is created.
Only the first 32767 chars are taken in account in an section due to Win9x compatibility.

Related

IniDelete, IniWrite, IniRead, IniReadSectionNames, IniRenameSection, IniWriteSection

Example

$var = IniReadSection("C:\Temp\myfile.ini", "section2")
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $i = 1 To $var[0][0]
MsgBox(4096, "", "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$i][1])
Next
EndIf


Function IniReadSectionNames

Function Reference

IniReadSectionNames

Reads all sections in a standard format .ini file.

IniReadSectionNames ( "filename" )

Parameters

filename The filename of the .ini file.

Return Value

Success: | Returns an array of all section names in the INI file.
Failure: | Sets @error on failure.

Remarks

A standard ini file looks like:
[SectionName]
Key=Value

The number of elements returned will be in $result[0]. If an @error occurs, no array is created.
Only the first 32767 chars are taken in account in an section due to Win9x compatibility.

Related

IniDelete, IniWrite, IniRead, IniReadSection, IniRenameSection, IniWriteSection

Example

$var = IniReadSectionNames(@WindowsDir & "\win.ini")
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $i = 1 To $var[0]
MsgBox(4096, "", $var[$i])
Next
EndIf


Function IniRenameSection

Function Reference

IniRenameSection

Renames a section in a standard format .ini file.

IniRenameSection ( "filename", "section", "new section" [, flag] )

Parameters

filename | The filename of the .ini file.
section | The section name in the .ini file.
new section | The new section name.
flag | [optional] 0 (Default) - Fail if "new section" already exists. 1 - Overwrite "new section". This will erase any existing keys in "new section"

Return Value

Success: | Non-zero.
Failure: | 0 and may set @error if the section couldn't be overwritten (flag = 0 only).

Remarks

A standard ini file looks like:
[SectionName]
Key=Value

Related

IniRead, IniDelete, IniWrite, IniReadSection, IniReadSectionNames, IniWriteSection

Example

$res = IniRenameSection(@ScriptDir & "My.ini", "MySection", "MyNewSection")


Function IniWrite

Function Reference

IniWrite

Writes a value to a standard format .ini file.

IniWrite ( "filename", "section", "key", "value" )

Parameters

filename | The filename of the .ini file.
section | The section name in the .ini file.
key | The key name in the in the .ini file.
value | The value to write/change.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if file is read-only.

Remarks

A standard ini file looks like:
[SectionName]
Key=Value
If file does not exist, it is created. Any directories that do not exist, will not be created. Keys and/or sections are added to the end and are not sorted in any way."?
When writing a value that is quoted, the quotes are stripped. In order to write the quote marks to the value, you must double up the quoting. For example: ""This is a test"" will produce "This is a test" in the file.
Leading and trailing whitespace is stripped. In order to preserve the whitespace, the string must be quoted. For example, " this is a test" will preserve the whitespace but per above, the quotation marks are stripped.
Multi-line values are not possible.

Related

IniDelete, IniRead, IniReadSection, IniReadSectionNames, IniWriteSection, IniRenameSection

Example

IniWrite("C:\Temp\myfile.ini", "section2", "key", "this is a new value")


Function IniWriteSection

Function Reference

IniWriteSection

Writes a section to a standard format .ini file.

IniWriteSection ( "filename", "section", "data" [, index ] )

Parameters

filename | The filename of the .ini file.
section | The section name in the .ini file.
data | The data to write. The data can either be a string or an array. If the data is a string, then each key=value pair must be delimited by @LF. If the data is an array, the array must be 2-dimensional and the second dimension must be 2 elements.
index | [optional] If an array is passed as data, this specifies the index to start writing from. By default, this is 1 so that the return value of IniReadSection() can be used immediately. For manually created arrays, this value may need to be different depending on how the array was created. This parameter is ignored if a string is passed as data.

Return Value

Success: | Returns 1.
Failure: | Returns 0. The function will set @error to 1 if the data format is invalid.

Remarks

A standard ini file looks like:
[SectionName]
Key=Value
If file does not exist, it is created. Any directories that do not exist, will not be created. Keys and/or sections are added to the end and are not sorted in any way."?
If the section being written already exists, it's contents will be overwritten.

Related

IniDelete, IniRead, IniReadSection, IniReadSectionNames, IniWrite, IniRenameSection

Example

; This is the INI file we will write to. It will be created on the Desktop.
$sIni = @DesktopDir & "\AutoIt-Test.ini"

; Demonstrate creating a new section using a string as input.
$sData = "Key1=Value1" & @LF & "Key2=Value2" & @LF & "Key3=Value3"
IniWriteSection($sIni, "Section1", $sData)

; Demonstrate creating a new section using an array as input.
$aData1 = IniReadSection($sIni, "Section1") ; Read in what we just wrote above.
For $i = 1 To UBound($aData1) - 1
$aData1[$i][1] &= "-" & $i ; Change the data some
Next

IniWriteSection($sIni, "Section2", $aData1) ; Write to a new section.

; Demonstrate creating an array manually and using it as input.
Dim $aData2[3][2] = [ [ "FirstKey", "FirstValue" ], [ "SecondKey", "SecondValue" ], [ "ThirdKey", "ThirdValue" ] ]
; Since the array we made starts at element 0, we need to tell IniWriteSection() to start writing from element 0.
IniWriteSection($sIni, "Section3", $aData2, 0)


Functions

Graphic and Sound functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
Beep | Plays back a beep to the user.
PixelChecksum | Generates a checksum for a region of pixels.
PixelGetColor | Returns a pixel color according to x,y pixel coordinates.
PixelSearch | Searches a rectangle of pixels for the pixel color provided.
SoundPlay | Play a sound file.
SoundSetWaveVolume | Sets the system wave volume by percent.


Function Beep

Function Reference

Beep

Plays back a beep to the user.

Beep ( [ Frequency [, Duration ]] )

Parameters

Frequency | [optional] The frequency of the beep in hertz. Can be anywhere from 37 through 32,767 (0x25 through 0x7FFF). Default is 500 Hz.
Duration | [optional] The length of the beep in milliseconds. Default = 1000 ms.

Return Value

Always returns 1 regardless of success.

Remarks

None.

Related

SoundPlay

Example

; plays back a beep noise, at the frequency 500 for 1 second

Beep(500, 1000)


Function PixelChecksum

Function Reference

PixelChecksum

Generates a checksum for a region of pixels.

PixelChecksum ( left, top, right, bottom [, step [, hwnd [, mode]]] )

Parameters

left | left coordinate of rectangle.
top | top coordinate of rectangle.
right | right coordinate of rectangle.
bottom | bottom coordinate of rectangle.
step | [optional] Instead of checksumming each pixel use a value larger than 1 to skip pixels (for speed). E.g. A value of 2 will only check every other pixel. Default is 1. It is not recommended to use a step value greater than 1.
hwnd | [optional] Window handle to be used.
mode | [optional] default 0 ADLER checksum, 1 CRC32 Checksum.

Return Value

Success: | Returns the checksum value of the region.
Failure: | Returns 0.

Remarks

A checksum only allows you to see if "something" has changed in a region - it does not tell you exactly what has changed.

Previous versions were extremely slow, however the function is now significantly faster. Using the step parameter is no longer recommended. The performance gain from using a larger step is not nearly as noticeable since the function is faster all around. Also, the larger the step, the less reliable the checksum becomes when used to detect small changes in the region.

CRC32 checksum is a little slower than ADLDER but detect better pixel variation.

Related

PixelGetColor, PixelCoordMode (Option), PixelSearch

Example

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum
$checksum = PixelChecksum(0,0, 50,50)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(0,0, 50, 50)
Sleep(100)
WEnd

MsgBox(0, "", "Something in the region has changed!")


Function AutoItSetOption

Function Reference

AutoItSetOption

Changes the operation of various AutoIt functions/parameters.

AutoItSetOption ( "option" [, param] )

Parameters

option | The option to change. See Remarks.
param | [optional] The value to assign to the option. The type and meaning vary by option. See remarks below. If the param is not provided, then the function just returns the value already assigned to the option. The keyword Default can be used for the parameter to reset the option to its default value.

Return Value

Success: | Returns the value of the previous setting for the option.
Failure: | Sets @error to non-zero. Failure will occur if the parameters are invalid (such as an option that doesn't exist).

Remarks

You may use Opt() as an alternative to AutoItSetOption().

Options are as follows:

Option | Param
CaretCoordMode | Sets the way coords are used in the caret functions, either absolute coords or coords relative to the current active window: 0 = relative coords to the active window 1 = absolute screen coordinates (default) 2 = relative coords to the client area of the active window
ExpandEnvStrings | Changes how literal strings and % symbols are interpreted. By default strings are treated literally, this option allows you to use %environment% variables inside strings, e.g., "The temp directory is: %temp%". 1 = expand environment variables (similar to AutoIt v2) 0 = do not expand environment variables (default) Without this option the usual way would be: "The temp directory is: " & EnvGet("temp")
ExpandVarStrings | Changes how literal strings and variable/macro ($ and @) symbols are interpreted. By default strings are treated literally, this option allows you to use variables and macros inside strings, e.g., "The value of var1 is $var1$". 1 = expand variables (when in this mode and you want to use a literal $ or @ then double it up: "This is a single dollar $$ sign". 0 = do not expand variables (default)
GUICloseOnESC | When ESC is pressed on a GUI the $GUI_EVENT_CLOSE message is sent. This option toggles this behavior on and off. 1 = Send the $GUI_EVENT_CLOSE message when ESC is pressed (default). 0 = Don't send the $GUI_EVENT_CLOSE message when ESC is pressed.
GUICoordMode | Alters the position of a control defined by GUICtrlSetPos. 1 = absolute coordinates (default) still relative to the dialog box. 0 = relative position to the start of the last control (upper left corner). 2 = cell positionining relative to current cell. A -1 for left or top parameter don't increment the start. So next line is -1,offset; next cell is offset,-1; current cell is -1,-1.
 | Obviously "offset" cannot be -1 which reserved to indicate the no increment. But if you can use a multiple of the width you choose to skip or go back.
GUIDataSeparatorChar | Define the character which delimits subitems in GUICtrlSetData. The default character is '|'.
GUIOnEventMode | Enable/disable OnEvent functions notifications. 0 = (default) disable. 1 = enable.
GUIResizeMode | Change default resizing for a control. 0 = (default) keep default control resizing. <1024 = anytype of resizing see GUICtrlSetResizing.
GUIEventOptions | Change special event behavior or GUI function return values. 0 = (default) Windows behavior on click on Minimize,Restore, Maximize, Resize. 1 = suppress windows behavior on minimize, restore or maximize click button or window resize. Just sends the notification.
MouseClickDelay | Alters the length of the brief pause in between mouse clicks. Time in milliseconds to pause (default=10).
MouseClickDownDelay | Alters the length a click is held down before release. Time in milliseconds to pause (default=10).
MouseClickDragDelay | Alters the length of the brief pause at the start and end of a mouse drag operation. Time in milliseconds to pause (default=250).
MouseCoordMode | Sets the way coords are used in the mouse functions, either absolute coords or coords relative to the current active window: 0 = relative coords to the active window 1 = absolute screen coordinates (default) 2 = relative coords to the client area of the active window
MustDeclareVars | If this option is used then all variables must be pre-declared with Dim, Local or Global before they can be used - removes the chance for misspelled variables causing bugs. 1 = Variables must be pre-declared 0 = Variables don't need to be pre-declared (default)
PixelCoordMode | Sets the way coords are used in the pixel functions, either absolute coords or coords relative to the window defined by hwnd (default active window): 0 = relative coords to the defined window 1 = absolute screen coordinates (default) 2 = relative coords to the client area of the defined window
SendAttachMode | Specifies if AutoIt attaches input threads when using Send() function. When not attaching (default mode=0) detecting the state of capslock/scrolllock and numlock can be unreliable under NT4. However, when you specify attach mode=1 the Send("{... down/up}") syntax will not work and there may be problems with sending keys to "hung" windows. ControlSend() ALWAYS attaches and is not affected by this mode. 0 = don't attach (default) 1 = attach
SendCapslockMode | Specifies if AutoIt should store the state of capslock before a Send function and restore it afterwards. 0 = don't store/restore 1 = store and restore (default)
SendKeyDelay | Alters the the length of the brief pause in between sent keystrokes. A value of 0 removes the delay completely. Time in milliseconds to pause (default=5).
SendKeyDownDelay | Alters the length of time a key is held down before being released during a keystroke. For applications that take a while to register keypresses (and many games) you may need to raise this value from the default. A value of 0 removes the delay completely. Time in milliseconds to pause (default=5).
TCPTimeout | Defines the time before TCP functions stop if no communication. Time in milliseconds before timeout (default=100).
TrayAutoPause | Script pauses when click on tray icon. 0 = no pause 1 = pause (default). If there is no DefaultMenu no pause will occurs.
TrayIconDebug | If enabled shows the current script line in the tray icon tip to help debugging. 0 = no debug information (default) 1 = show debug
TrayIconHide | Hides the AutoIt tray icon. Note: The icon will still initially appear ~750 milliseconds. 0 = show icon (default) 1 = hide icon
TrayMenuMode | Extend the behaviour of the script tray icon/menu. This can be done with a combination (adding) of the following values. 0 = default menu items (Script Paused/Exit) are appended to the usercreated menu; usercreated checked items will automatically unchecked; if you double click the tray icon then the controlid is returned which has the "Default"-style (default). 1 = no default menu 2 = user created checked items will not automatically unchecked if you click it 4 = don't return the menuitemID which has the "default"-style in the main contextmenu if you double click the tray icon 8 = turn off auto check of radio item groups
TrayOnEventMode | Enable/disable OnEvent functions notifications for the tray. 0 = (default) disable 1 = enable
WinDetectHiddenText | Specifies if hidden window text can be "seen" by the window matching functions. 0 = Do not detect hidden text (default) 1 = Detect hidden text
WinSearchChildren | Allows the window search routines to search child windows as well as top-level windows. 0 = Only search top-level windows (default) 1 = Search top-level and child windows
WinTextMatchMode | Alters the method that is used to match window text during search operations. 1 = Complete / Slow mode (default) 2 = Quick mode In quick mode AutoIt can usually only "see" dialog text, button text and the captions of some controls. In the default mode much more text can be seen (for instance the contents of the Notepad window). If you are having performance problems when performing many window searches then changing to the "quick" mode may help.
WinTitleMatchMode | Alters the method that is used to match window titles during search operations. 1 = Match the title from the start (default) 2 = Match any substring in the title 3 = Exact title match 4 = Advanced mode, see Window Titles & Text (Advanced) -1 to -4 = force lower case match according to other type of match.
WinWaitDelay | Alters how long a script should briefly pause after a successful window-related operation. Time in milliseconds to pause (default=250).

Related

Many!

Example

; copy any you want to change ;default value is listed first

Opt("CaretCoordMode", 1) ;1=absolute, 0=relative, 2=client
Opt("ExpandEnvStrings", 0) ;0=don't expand, 1=do expand
Opt("ExpandVarStrings", 0) ;0=don't expand, 1=do expand
Opt("GUICloseOnESC", 1) ;1=ESC closes, 0=ESC won't close
Opt("GUICoordMode", 1) ;1=absolute, 0=relative, 2=cell
Opt("GUIDataSeparatorChar","|") ;"|" is the default
Opt("GUIOnEventMode", 0) ;0=disabled, 1=OnEvent mode enabled
Opt("GUIResizeMode", 0) ;0=no resizing, <1024 special resizing
Opt("GUIEventOptions",0) ;0=default, 1=just notification, 2=GuiCtrlRead tab index
Opt("MouseClickDelay", 10) ;10 milliseconds
Opt("MouseClickDownDelay", 10) ;10 milliseconds
Opt("MouseClickDragDelay", 250) ;250 milliseconds
Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client
Opt("MustDeclareVars", 0) ;0=no, 1=require pre-declare
Opt("PixelCoordMode", 1) ;1=absolute, 0=relative, 2=client
Opt("SendAttachMode", 0) ;0=don't attach, 1=do attach
Opt("SendCapslockMode", 1) ;1=store and restore, 0=don't
Opt("SendKeyDelay", 5) ;5 milliseconds
Opt("SendKeyDownDelay", 1) ;1 millisecond
Opt("TCPTimeout",100) ;100 milliseconds
Opt("TrayAutoPause",1) ;0=no pause, 1=Pause
Opt("TrayIconDebug", 0) ;0=no info, 1=debug line info
Opt("TrayIconHide", 0) ;0=show, 1=hide tray icon
Opt("TrayMenuMode",0) ;0=append, 1=no default menu, 2=no automatic check, 4=menuitemID not return
Opt("TrayOnEventMode",0) ;0=disable, 1=enable
Opt("WinDetectHiddenText", 0) ;0=don't detect, 1=do detect
Opt("WinSearchChildren", 1) ;0=no, 1=search children also
Opt("WinTextMatchMode", 1) ;1=complete, 2=quick
Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Opt("WinWaitDelay", 250) ;250 milliseconds


Function PixelGetColor

Function Reference

PixelGetColor

Returns a pixel color according to x,y pixel coordinates.

PixelGetColor ( x , y [, hwnd] )

Parameters

x | x coordinate of pixel.
y | y coordinate of pixel.
hwnd | [optional] Window handle to be used.

Return Value

Success: | Returns decimal value of pixel's color.
Failure: | Returns -1 if invalid coordinates.

Remarks

None

Related

PixelSearch, PixelCoordMode (Option), MouseGetPos, PixelChecksum

Example

$var = PixelGetColor( 10 , 100 )
MsgBox(0,"The decimal color is", $var)
MsgBox(0,"The hex color is", Hex($var, 6))


Function PixelSearch

Function Reference

PixelSearch

Searches a rectangle of pixels for the pixel color provided.

PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] )

Parameters

left | left coordinate of rectangle.
top | top coordinate of rectangle.
right | right coordinate of rectangle.
bottom | bottom coordinate of rectangle.
color | Colour value of pixel to find (in decimal or hex).
shade-variation | [optional] A number between 0 and 255 to indicate the allowed number of shades of variation of the red, green, and blue components of the colour. Default is 0 (exact match).
step | [optional] Instead of searching each pixel use a value larger than 1 to skip pixels (for speed). E.g. A value of 2 will only check every other pixel. Default is 1.
hwnd | [optional] Window handle to be used.

Return Value

Success: | Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y).
Failure: | Sets @error to 1 if color is not found.

Remarks

The search direction varies as follows:
Left-to-Right - left < right
Right-to-Left - right < left
Top-to-Bottom - top < bottom
Bottom-to-Top - bottom < top
Changing the search direction can be a useful optimization if the color being searched for frequently appears in in a specific quandrat of the search area since less searching is done if the search starts in the most common quadrant.

Remember, a typical display at 1024 x 768 has 786432 pixels. Although PixelSearch is optimized, narrowing the search area helps speed up the result.

Related

PixelChecksum, PixelGetColor, PixelCoordMode (Option)

Example

; Find a pure red pixel in the range 0,0-20,300
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )
If Not @error Then
MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf

; Find a pure red pixel or a red pixel within 10 shades variations of pure red
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )
If Not @error Then
MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf


Function SoundPlay

Function Reference

SoundPlay

Play a sound file.

SoundPlay ( "filename" [, wait] )

Parameters

filename | Name of the file to be played (typically a WAV or MP3)
wait | [optional] This flag determines if the script should wait for the sound to finish before continuing: 1 = wait until sound has finished 0 = continue script while sound is playing (default)

Return Value

None. (Always returns 1 regardless of success.)

Remarks

Terminating the script will stop the sound (if it is still playing).
Calling SoundPlay("") can be used to stop a currently playing sound. This has the side effect of also closing the open handle.
If you need to delete a sound file which you have played in the script, you should call SoundPlay("") first to ensure the handle is closed.

Related

SoundSetWaveVolume, Beep

Example

SoundPlay(@WindowsDir & "\media\tada.wav",1)


Function SoundSetWaveVolume

Function Reference

SoundSetWaveVolume

Sets the system wave volume by percent.

SoundSetWaveVolume ( percent )

Parameters

percent percentage number between 0 and 100

Return Value

Success: | Returns 1.
Failure: | Returns 0 and sets @error to 1 if percent is invalid.

Remarks

This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status.

On Windows Vista, there is no system-wide wave volume. This function only changes the wave volume for the script. It can not be used to change the wave volume of other programs.

Related

SoundPlay

Example

SoundSetWaveVolume(50)


Functions

GUI functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

See Gui Constants include files if you need to use the related controls Constants .

Function | Description
GUICreate | Create a GUI window.
GUIDelete | Deletes a GUI window and all controls that it contains.
GUICtrlGetHandle | Returns the handle for a control and some special (item) handles (Menu, ContextMenu, TreeViewItem).
GUICtrlGetState | Gets the current state of a control
GUICtrlRead | Read state or data of a control.
GUICtrlRecvMsg | Send a message to a control and retrieve information in lParam.
GUICtrlSendMsg | Send a message to a control.
GUICtrlSendToDummy | Sends a message to a Dummy control.
GUIGetCursorInfo | Gets the mouse cursor position relative to GUI window.
GUIGetMsg | Polls the GUI to see if any events have occurred.
GUIGetStyle | Retrieves the styles of a GUI window.
GUIRegisterMsg | Register a user defined function for a known Windows Message ID (WM_MSG).
GUIStartGroup | Defines that any subsequent controls that are created will be "grouped" together.
GUISwitch | Switches the current window used for GUI functions.


Function GUICreate

Function Reference

GUICreate

Create a GUI window.

GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] )

Parameters

title | The title of the dialog box.
width | [optional] The width of the window.
height | [optional] The height of the window.
left | [optional] The left side of the dialog box. By default (-1), the window is centered. If defined, top must also be defined.
top | [optional] The top of the dialog box. Default (-1) is centered
style | [optional] defines the style of the window. See GUI Control Styles Appendix. Use -1 for the default style which includes a combination of $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU styles. Some styles are always included: $WS_CLIPSIBLINGS, and $WS_SYSMENU if $WS_MAXIMIZEBOX or $WS_SIZEBOX is specified.
exStyle | [optional] defines the extended style of the window. See the Extended Style Table below. -1 is the default.
parent | [optional] The handle of another previously created window - this new window then becomes a child of that window.

Return Value

Success: | Returns a windows handle.
Failure: | Returns 0 if the window cannot be created and sets @error to 1.

Remarks

By default the dialog box is non sizable and non maximizable. So WS_SIZEBOX or WS_MAXIMIZEBOX can be used in the style parameter.
As defining only one style just set this style don't forget to combine it with default ones, i.e. just defining WS_SIZEBOX will not set WS_MINIMIZEBOX, WS_CAPTION, WS_POPUP, WS_SYSMENU. So the best method to define a resizeable window is to use WS_OVERLAPPEDWINDOW.
When using $WS_EX_MDICHILD the position is relative to client area of the parent window. With $WS_EX_LAYERED it is possible to have a transparent pic on a background pic defined in the parent window.
Adding $WS_CLIPCHILDREN style can avoid some flickering when resizing GUI containing Edit control for example.
You can enable window draging for GUI without $WS_CAPTION by using $WS_EX_CONTROLPARENT in the exStyle parameter.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_GUI, newstyle,...).
The size specified is the size of the client area of the window. The border and title bar will make the window slightly larger than specified. Using menu controls will also change the windows height.

Extended Style table
Extended Style | result
$WS_EX_ACCEPTFILES | Allow an edit or input control within the created GUI window to receive filenames via drag and drop. The control must have also the $GUI_DROPACCEPTED state set by GUICtrlSetState. for other controls the drag&drop info can be retrieved with @GUI_DRAGID, @GUI_DRAGFILE, @GUIDROPID.
$WS_EX_APPWINDOW | Forces a top-level window onto the taskbar when the window is visible.
$WS_EX_CLIENTEDGE | Specifies that a window has a border with a sunken edge.
$WS_EX_CONTEXTHELP | Includes a question mark in the title bar of the window. Cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX.
$WS_EX_DLGMODALFRAME | Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the style parameter.
$WS_EX_MDICHILD | Create a child window included in its parent window (simulation not real MDI).
$WS_EX_OVERLAPPEDWINDOW | Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.
$WS_EX_STATICEDGE | Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.
$WS_EX_TOPMOST | Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated.
$WS_EX_TRANSPARENT | The window appears transparent because the bits of underlying sibling windows have already been painted.
$WS_EX_TOOLWINDOW | Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog box that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by typing ALT+SPACE.
$WS_EX_WINDOWEDGE | Specifies that a window has a border with a raised edge.
$WS_EX_LAYERED | Creates a layered window. Note that this cannot be used for child windows.

To use the values specified above you must #include <WindowsConstants.au3> in your script.

Note: The handle returned from this function is a real windows handle, which means it can be used in the same way as the result of WinGetHandle.

Related

GUISetParameters..., GUICtrlCreate..., GUIGetMsg, GUISwitch, GUIGetStyle, GUIDelete, WinGetHandle, GUICtrlSetDefBkColor, GUICtrlSetDefColor, GUIGetCursorInfo

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example1()
Example2()

; example 1
Func Example1()
Local $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered
GUISetState(@SW_SHOW) ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()
EndFunc ;==>Example1

; example 2
Func Example2()
Local $gui, $background, $pic, $basti_stay, $msg
Local $sFile = "..\GUI\logo4.gif"

$gui = GUICreate("Background", 400, 100)
; background picture
$background = GUICtrlCreatePic("..\GUI\msoobe.jpg", 0, 0, 400, 100)

GUISetState(@SW_SHOW)

; transparent MDI child window
$pic = GUICreate("", 169, 68, 20, 20, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $gui)
; transparent pic
$basti_stay = GUICtrlCreatePic($sFile, 0, 0, 169, 68)
GUISetState(@SW_SHOW)

Do
$msg = GUIGetMsg()

Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example2


Functions

GUI Control creation functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

See Gui Constants include files if you need to use the related controls Constants .

Function | Description
GUICtrlCreateAvi | Creates an AVI video control for the GUI.
GUICtrlCreateButton | Creates a Button control for the GUI.
GUICtrlCreateCheckbox | Creates a Checkbox control for the GUI.
GUICtrlCreateCombo | Creates a ComboBox control for the GUI.
GUICtrlCreateContextMenu | Creates a context menu for a control or entire GUI window.
GUICtrlCreateDate | Creates a date control for the GUI.
GUICtrlCreateDummy | Creates a Dummy control for the GUI.
GUICtrlCreateEdit | Creates an Edit control for the GUI.
GUICtrlCreateGraphic | Creates a Graphic control for the GUI.
GUICtrlCreateGroup | Creates a Group control for the GUI.
GUICtrlCreateIcon | Creates an Icon control for the GUI.
GUICtrlCreateInput | Creates an Input control for the GUI.
GUICtrlCreateLabel | Creates a static Label control for the GUI.
GUICtrlCreateList | Creates a List control for the GUI.
GUICtrlCreateListView | Creates a ListView control for the GUI.
GUICtrlCreateListViewItem | Creates a ListView item.
GUICtrlCreateMenu | Creates a Menu control for the GUI.
GUICtrlCreateMenuItem | Creates a MenuItem control for the GUI.
GUICtrlCreateMonthCal | Creates a month calendar control for the GUI.
GUICtrlCreateObj | Creates an ActiveX control in the GUI.
GUICtrlCreatePic | Creates a Picture control for the GUI.
GUICtrlCreateProgress | Creates a Progress control for the GUI.
GUICtrlCreateRadio | Creates a Radio button control for the GUI.
GUICtrlCreateSlider | Creates a Slider control for the GUI.
GUICtrlCreateTab | Creates a Tab control for the GUI.
GUICtrlCreateTabItem | Creates a TabItem control for the GUI.
GUICtrlCreateTreeView | Creates a TreeView control for the GUI.
GUICtrlCreateTreeViewItem | Creates a TreeViewItem control for the GUI.
GUICtrlCreateUpdown | Creates an UpDown control for the GUI.
GUICtrlDelete | Deletes a control.


Function GUICtrlCreateAvi

Function Reference

GUICtrlCreateAvi

Creates an AVI video control for the GUI.

GUICtrlCreateAvi ( filename, subfileid, left, top [, width [, height [, style [, exStyle]]]] )

Parameters

filename | The filename of the video. Only .avi files are supported.
subfileid | id of the subfile to be used. If the file only contains one video then use -1.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $ACS_TRANSPARENT $ACS_TRANSPARENT is always used unless $ACS_NONTRANSPARENT is specified.
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

To start the video as soon as the control is created use the $ACS_AUTOPLAY style.
You can can start and stop the animation by setting the state to 1 or 0 with GUICtrlSetState. See example.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_AVI, newstyle,...).

To use the values specified above you must #include <AVIConstants.au3> in your script.

Default resizing is $GUI_DOCKSIZE.

Related

GUICoordMode (option), GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $ani1, $buttonstart, $buttonstop, $msg

GUICreate("My GUI Animation", 300, 200)
$ani1 = GUICtrlCreateAvi(@SystemDir & "\shell32.dll", 165, 50, 10)

$buttonstart = GUICtrlCreateButton("start", 50, 150, 70, 22)
$buttonstop = GUICtrlCreateButton("stop", 150, 150, 70, 22)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop

Case $msg = $buttonstart
GUICtrlSetState($ani1, 1)

Case $msg = $buttonstop
GUICtrlSetState($ani1, 0)

EndSelect
WEnd
EndFunc ;==>Example


Function GUICtrlCreateButton

Function Reference

GUICtrlCreateButton

Creates a Button control for the GUI.

GUICtrlCreateButton ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the button control.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default text autofit in width).
height | [optional] The height of the control (default text autofit in height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : none. forced styles : $WS_TABSTOP
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To set or change information in the control see GUICtrlUpdate....

A Button control can display an icon or image by using the $BS_ICON or $BS_BITMAP style. Use GUICtrlSetImage to specify the picture to use.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_BUTTON, newstyle,...).

To use the values specified above you must #include <ButtonConstants.au3> in your script.

Default resizing is $GUI_DOCKSIZE

Related

GUICoordMode (Option), GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $Button_1, $Button_2, $msg
GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered

Opt("GUICoordMode", 2)
$Button_1 = GUICtrlCreateButton("Run Notepad", 10, 30, 100)
$Button_2 = GUICtrlCreateButton("Button Test", 0, -1)

GUISetState() ; will display an dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
Run('Notepad.exe') ; Will Run/Open Notepad
Case $msg = $Button_2
MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed
EndSelect
WEnd
EndFunc ;==>Example


Function GUICtrlCreateCheckbox

Function Reference

GUICtrlCreateCheckbox

Creates a Checkbox control for the GUI.

GUICtrlCreateCheckbox ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the control checkbox.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default text autofit in width).
height | [optional] The height of the control (default text autofit in height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : $BS_AUTOCHECKBOX. forced styles : $WS_TABSTOP, and $BS_AUTOCHECKBOX if no checkbox style defined.
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

A Checkbox control can display an icon or image by using the $BS_ICON or $BS_BITMAP style. Use GUICtrlSetImage to specify the picture to use.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_CHECKBOX, newstyle,...).

To use the values specified above you must #include <ButtonConstants.au3> in your script.

Default resizing is $GUI_DOCKHEIGHT.

Related

GUICoordMode (Option), GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $checkCN, $msg
GUICreate("My GUI Checkbox") ; will create a dialog box that when displayed is centered

$checkCN = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20)

GUISetState() ; will display an dialog box with 1 checkbox

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlCreateCombo

Function Reference

GUICtrlCreateCombo

Creates a ComboBox control for the GUI.

GUICtrlCreateCombo ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text which will appear in the combo control.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL forced style : $WS_TABSTOP
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

Under Windows XP/2003 Windows will adjust the size of the opened combo. On other Windows versions you can define this size with the "height" parameter if the default value is not BIG enough to contain at least one line.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_COMBO, newstyle,...).

To use the values specified above you must #include <ComboConstants.au3> in your script.

Default resizing is $GUI_DOCKHEIGHT.

Related

GUICoordMode (Option), GUICtrlSetData, GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg
GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered

GUICtrlCreateCombo("item1", 10, 10) ; create first item
GUICtrlSetData(-1, "item2|item3", "item3") ; add other item snd set a new default

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlCreateContextMenu

Function Reference

GUICtrlCreateContextMenu

Creates a context menu for a control or entire GUI window.

GUICtrlCreateContextMenu ( [controlID] )

Parameters

controlID [optional] Control identifier as returned by GUICtrlCreate...

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

After creating the context menu main control with this function, each menu item can be created by using GUICtrlCreateMenuItem.
Sub-menus can be created using GUICtrlCreateMenu.

If you use no parameters or -1 in this function then the context menu that is created is associated with the entire GUI window rather than an individual control.

Only one context menu per control is possible. If you wish to create a new context menu one you have to delete the existing menu first.

Note: You can't create context menus for controls that already have system context menus, i.e. edit or input controls.

Related

GUICtrlCreateMenuItem, GUICtrlCreateMenu, GUICtrlGetHandle, GUICtrlSetState, GUICtrlDelete

Example

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)

Example1()
Example2()

; ****************
; * First sample *
; ****************
Func Example1()
Local $contextmenu, $button, $buttoncontext, $buttonitem, $msg
Local $newsubmenu, $textitem, $fileitem, $saveitem, $infoitem

;right click on gui to bring up context Menu.
;right click on the "ok" button to bring up a controll specific context menu.

GUICreate("My GUI Context Menu", 300, 200)

$contextmenu = GUICtrlCreateContextMenu()

$button = GUICtrlCreateButton("OK", 100, 100, 70, 20)
$buttoncontext = GUICtrlCreateContextMenu($button)
$buttonitem = GUICtrlCreateMenuItem("About button", $buttoncontext)

$newsubmenu = GUICtrlCreateMenu("new", $contextmenu)
$textitem = GUICtrlCreateMenuItem("text", $newsubmenu)

$fileitem = GUICtrlCreateMenuItem("Open", $contextmenu)
$saveitem = GUICtrlCreateMenuItem("Save", $contextmenu)
GUICtrlCreateMenuItem("", $contextmenu) ; separator

$infoitem = GUICtrlCreateMenuItem("Info", $contextmenu)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()
EndFunc ;==>Example1

; *****************
; * Second sample *
; *****************
Func Example2()
Local $hGui, $OptionsBtn, $OptionsDummy, $OptionsContext, $OptionsCommon, $OptionsFile, $msg
Local $OptionsExit, $HelpBtn, $HelpDummy, $HelpContext, $HelpWWW, $HelpAbout
$hGui = GUICreate("My GUI", 170, 40)

$OptionsBtn = GUICtrlCreateButton("&Options", 10, 10, 70, 20, $BS_FLAT)

; At first create a dummy control for the options and a contextmenu for it
$OptionsDummy = GUICtrlCreateDummy()
$OptionsContext = GUICtrlCreateContextMenu($OptionsDummy)
$OptionsCommon = GUICtrlCreateMenuItem("Common", $OptionsContext)
$OptionsFile = GUICtrlCreateMenuItem("File", $OptionsContext)
GUICtrlCreateMenuItem("", $OptionsContext)
$OptionsExit = GUICtrlCreateMenuItem("Exit", $OptionsContext)

$HelpBtn = GUICtrlCreateButton("&Help", 90, 10, 70, 20, $BS_FLAT)

; Create a dummy control and a contextmenu for the help too
$HelpDummy = GUICtrlCreateDummy()
$HelpContext = GUICtrlCreateContextMenu($HelpDummy)
$HelpWWW = GUICtrlCreateMenuItem("Website", $HelpContext)
GUICtrlCreateMenuItem("", $HelpContext)
$HelpAbout = GUICtrlCreateMenuItem("About...", $HelpContext)

GUISetState()

While 1
$msg = GUIGetMsg()

Switch $msg
Case $OptionsExit, $GUI_EVENT_CLOSE
ExitLoop

Case $OptionsBtn
ShowMenu($hGui, $msg, $OptionsContext)

Case $HelpBtn
ShowMenu($hGui, $msg, $HelpContext)

Case $HelpAbout
MsgBox(64, "About...", "GUICtrlGetHandle-Sample")
EndSwitch
WEnd
GUIDelete()
EndFunc ;==>Example2

; Show a menu in a given GUI window which belongs to a given GUI ctrl
Func ShowMenu($hWnd, $CtrlID, $nContextID)
Local $arPos, $x, $y
Local $hMenu = GUICtrlGetHandle($nContextID)

$arPos = ControlGetPos($hWnd, "", $CtrlID)

$x = $arPos[0]
$y = $arPos[1] + $arPos[3]

ClientToScreen($hWnd, $x, $y)
TrackPopupMenu($hWnd, $hMenu, $x, $y)
EndFunc ;==>ShowMenu

; Convert the client (GUI) coordinates to screen (desktop) coordinates
Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
Local $stPoint = DllStructCreate("int;int")

DllStructSetData($stPoint, 1, $x)
DllStructSetData($stPoint, 2, $y)

DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

$x = DllStructGetData($stPoint, 1)
$y = DllStructGetData($stPoint, 2)
; release Struct not really needed as it is a local
$stPoint = 0
EndFunc ;==>ClientToScreen

; Show at the given coordinates (x, y) the popup menu (hMenu) which belongs to a given GUI window (hWnd)
Func TrackPopupMenu($hWnd, $hMenu, $x, $y)
DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0)
EndFunc ;==>TrackPopupMenu


Function GUICtrlCreateDate

Function Reference

GUICtrlCreateDate

Creates a date control for the GUI.

GUICtrlCreateDate ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The preselected date (always as "yyyy/mm/dd").
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $DTS_LONGDATEFORMAT forced style : $WS_TABSTOP
exStyle | [optional] Defines the extended style of the control. See Extended Style Table. default (-1) : WS_EX_CLIENTEDGE

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_DATE, newstyle,...).

To Format the date/time see example 3 to understand how to use a GuiCtrlSendMsg with a $DTM_SETFORMAT.

To use the values specified above you must #include <DateTimeConstants.au3> in your script.

Default resizing is $GUI_DOCKHEIGHT.

Related

GUICoordMode (Option), GUICtrlSetState, GUIGetMsg, GUICtrlRead

Example

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>

Opt('MustDeclareVars', 1)

Example1()
Example2()
Example3()
Example4()

; example1
Func Example1()
Local $date, $msg

GUICreate("My GUI get date", 200, 200, 800, 200)
$date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
GUISetState()

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

MsgBox(0, "Date", GUICtrlRead($date))
GUIDelete()
EndFunc ;==>Example1

; example2
Func Example2()
Local $n, $msg

GUICreate("My GUI get date", 200, 200, 800, 200)
$n = GUICtrlCreateDate("", 10, 10, 100, 20, $DTS_SHORTDATEFORMAT)
GUISetState()

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

MsgBox(0, "Date", GUICtrlRead($n))
GUIDelete()
EndFunc ;==>Example2

; example3
Func Example3()
Local $date, $DTM_SETFORMAT_, $style

GUICreate("My GUI get date", 200, 200, 800, 200)
$date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)

; to select a specific default format
$DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW
$style = "yyyy/MM/dd HH:mm:ss"
GUICtrlSendMsg($date, $DTM_SETFORMAT_, 0, $style)

GUISetState()
While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

MsgBox(0, "Time", GUICtrlRead($date))
EndFunc ;==>Example3

; example4
Func Example4()
Local $n, $msg

GUICreate("My GUI get time", 200, 200, 800, 200)
$n = GUICtrlCreateDate("", 20, 20, 100, 20, $DTS_TIMEFORMAT)
GUISetState()

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

MsgBox(0, "Time", GUICtrlRead($n))
GUIDelete()
EndFunc ;==>Example4


Function GUICtrlCreateDummy

Function Reference

GUICtrlCreateDummy

Creates a Dummy control for the GUI.

GUICtrlCreateDummy ( )

Parameters

None.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

This control can receive messages through a GUICtrlSendToDummy call. The control will "notify" as normal and the value sent with GUISendToDummy can be read with GUICtrlRead.

Related

GUICtrlSendToDummy, GUICtrlSetOnEvent, GUICtrlRead, GUICtrlSetData

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $user, $button, $cancel, $msg

GUICreate("GUICtrlCreateDummy", 250, 200, 100, 200)
GUISetBkColor(0x00E0FFFF) ; will change background color

$user = GUICtrlCreateDummy()
$button = GUICtrlCreateButton("event", 75, 170, 70, 20)
$cancel = GUICtrlCreateButton("Cancel", 150, 170, 70, 20)
GUISetState()

Do
$msg = GUIGetMsg()

Select
Case $msg = $button
GUICtrlSendToDummy($user)
Case $msg = $cancel
GUICtrlSendToDummy($user)
Case $msg = $user
; special action before closing
; ...
Exit
EndSelect
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example


Function GUICtrlCreateEdit

Function Reference

GUICtrlCreateEdit

Creates an Edit control for the GUI.

GUICtrlCreateEdit ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the control.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : $ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL forced styles : $ES_MULTILINE, $WS_TABSTOP only if not $ES_READONLY
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_EDIT, newstyle,...).

If you want to drag & drop a filename onto this control just add the WS_EX_ACCEPTFILES extended style on the GUICreate() and set the state to $GUI_DROPACCEPTED.
Multiple selected files will be dropped as separate lines.

To use the values specified above you must #include <EditConstants.au3> in your script.

Default resizing is $GUI_DOCKAUTO size and position will occur.

Creating a RichEdit control is too complex so it will not be included as a basic control.
You have to use the GuiCtrlCreateObj. See the second example if you need to have a RichEdit control.

Related

GUICoordMode (Option), GUICtrlSetData, GUICtrlSetState, GUICtrlSetLimit, GUIGetMsg, GUICtrlRead

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Global $oMyError

Example()
RichEditExample()

Func Example()
Local $myedit, $msg

GUICreate("My GUI edit") ; will create a dialog box that when displayed is centered

$myedit = GUICtrlCreateEdit("First line" & @CRLF, 176, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL)

GUISetState()

Send("{END}")

; will be append dont' forget 3rd parameter
GUICtrlSetData($myedit, "Second line", 1)

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()
EndFunc ;==>Example

; Rich edit control EXAMPLE using GUICtrlCreateObj

; Author: Kåre Johansson
; AutoIt Version: 3.1.1.55
; Description: Very Simple example: Embedding RICHTEXT object
; Needs: MSCOMCT2.OCX in system32 but it's probably already there
; Date: 3 jul 2005
Func RichEditExample()
Local $oRP, $TagsPageC, $AboutC, $PrefsC, $StatC, $GUIActiveX, $msg

$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

$oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")

GUICreate("Embedded RICHTEXT control Test", 320, 200, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
$TagsPageC = GUICtrlCreateLabel('Visit Tags Page', 5, 180, 100, 15, $SS_CENTER)
GUICtrlSetFont($TagsPageC, 9, 400, 4)
GUICtrlSetColor($TagsPageC, 0x0000ff)
GUICtrlSetCursor($TagsPageC, 0)
$AboutC = GUICtrlCreateButton('About', 105, 177, 70, 20)
$PrefsC = GUICtrlCreateButton('FontSize', 175, 177, 70, 20)
$StatC = GUICtrlCreateButton('Plain Style', 245, 177, 70, 20)

$GUIActiveX = GUICtrlCreateObj($oRP, 10, 10, 400, 260)
GUICtrlSetPos($GUIActiveX, 10, 10, 300, 160)

With $oRP; Object tag pool
.OLEDrag()
.Font = 'Arial'
.text = "Hello - Au3 supports ActiveX components like the RICHTEXT thanks to SvenP" & @CRLF & 'Try write some text and quit to reload'
;.FileName = @ScriptDir & '\RichText.rtf'
;.BackColor = 0xff00
EndWith

GUISetState();Show GUI

While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
$oRP.SaveFile(@ScriptDir & "\RichText.rtf", 0)
ExitLoop
Case $msg = $TagsPageC
Run(@ComSpec & ' /c start http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid={3B7C8860-D78F-101B-B9B5-04021C009402}', '', @SW_HIDE)
Case $msg = $AboutC
$oRP.AboutBox()
Case $msg = $PrefsC
$oRP.SelFontSize = 12
Case $msg = $StatC
$oRP.SelBold = False
$oRP.SelItalic = False
$oRP.SelUnderline = False
$oRP.SelFontSize = 8
EndSelect
WEnd
GUIDelete()
EndFunc ;==>RichEditExample

Func MyErrFunc()

MsgBox(0, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext _
, 5)
; Will automatically continue after 5 seconds

Local $err = $oMyError.number
If $err = 0 Then $err = -1

SetError($err) ; to check for after this function returns
EndFunc ;==>MyErrFunc


Function GUICtrlCreateGraphic

Function Reference

GUICtrlCreateGraphic

Creates a Graphic control for the GUI.

GUICtrlCreateGraphic ( left, top [, width [, height [, style]]] )

Parameters

left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : $SS_NOTIFY.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To draw in the control see GUICtrlSetGraphic.

The border and background color can be set with GUICtrlSetBkColor and GUICtrlSetColor.

Graphic control can be clicked so they should not overlap with other controls. If overlap is needed it is important to disable the graphic control : GuiCtrlSetState(-1,$GUI_DISABLE).

This control cannot be resized due to fix graphic relative addressing creation but can be dock with GUICtrlSetResizing().

Related

GUICtrlSetGraphic, GUICtrlSetBkColor, GUICtrlSetColor, GUICtrlDelete, GUICoordMode (Option), GUICtrlSetStyle, GUICtrlSetResizing, GUIGetMsg

Example

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Global $MAXGr = 6, $del
Global $a[$MAXGr + 1] ; 0 and $MAXGr entries not used to allow GUICtrlDelete result

Example()

Func Example()
Local $msg, $inc, $i

CreateChild()

$i = 1
$inc = 1
Do
$msg = GUIGetMsg()

If $msg = $del Then
GUICtrlDelete($a[$i])
$i = $i + $inc
If $i < 0 Or $i > $MAXGr Then Exit
EndIf
If $msg > 0 Then MsgBox(0, "clicked", $msg & @LF & $a[5], 2)
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example

Func CreateChild()
Local $child
$child = GUICreate("My Draw")
$del = GUICtrlCreateButton("Delete", 50, 165, 50)

$a[1] = GUICtrlCreateGraphic(20, 50, 100, 100)
GUICtrlSetBkColor(-1, 0xffffff)
GUICtrlSetColor(-1, 0)

GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 58, 50, 40, -60, 90)

GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 100, 100, 50, 80)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xc0c0ff)
GUICtrlSetGraphic(-1, $GUI_GR_RECT, 350, 200, 50, 80)
GUICtrlCreateLabel("label", 65, 100, 30)
GUICtrlSetColor(-1, 0xff)

$a[2] = GUICtrlCreateGraphic(220, 50, 100, 100)
GUICtrlSetStyle(-1, $SS_NOTIFY)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 58, 50, 40, -60, 90)

$a[3] = GUICtrlCreateGraphic(220, 150, 100, 100, 0)
GUICtrlSetBkColor(-1, 0xf08080)
GUICtrlSetColor(-1, 0xff)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00)
GUICtrlSetGraphic(-1, $GUI_GR_RECT, 50, 50, 80, 80)

$a[4] = GUICtrlCreateGraphic(20, 200, 80, 80)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetBkColor(-1, 0xffffff)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 10, 10)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 30, 40)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 70, 70)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 10, 50)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xffff00)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 10, 10)

$a[5] = GUICtrlCreateGraphic(150, 10, 50, 50, 0)
GUICtrlSetBkColor(-1, 0xa0ffa0)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 20, 20) ; start point
; it is better to draw line and after point
; to avoid to switch color at each drawing
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000ff)
GUICtrlSetGraphic(-1, $GUI_GR_DOT, 30, 30)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 20, 40)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000)
GUICtrlSetGraphic(-1, $GUI_GR_DOT, 25, 25)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 40, 40)
GUICtrlSetGraphic(-1, $GUI_GR_DOT, 40, 40)

GUISetState()
EndFunc ;==>CreateChild


Function GUICtrlCreateGroup

Function Reference

GUICtrlCreateGroup

Creates a Group control for the GUI.

GUICtrlCreateGroup ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the control.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : none. forced styles : $WS_GROUP, $BS_GROUPBOX.
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

A group control is the thin line you see around controls (usually only Radio button) that visually groups them together. Only one Radio button within a Group can be selected at once.
If you want to have multiple groups without the visible line then you must use GUIStartGroup() to group your Radio buttons.

To use the values specified above you must #include <ButtonConstants.au3> in your script.

Default resizing is $GUI_DOCKAUTO size and position will occur.

Related

GUICoordMode (Option), GUIStartGroup

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $radio_1, $radio_2, $msg

GUICreate("My GUI group") ; will create a dialog box that when displayed is centered

GUICtrlCreateGroup("Group 1", 190, 60, 90, 140)
$radio_1 = GUICtrlCreateRadio("Radio 1", 210, 90, 50, 20)
$radio_2 = GUICtrlCreateRadio("Radio 2", 210, 110, 60, 50)
GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlCreateIcon

Function Reference

GUICtrlCreateIcon

Creates an Icon control for the GUI.

GUICtrlCreateIcon ( filename, iconName, left, top [, width [, height [, style [, exStyle]]]] )

Parameters

filename | filename of the icon to be loaded.
iconName | Icon name if the file contain multiple icon. Can be an ordinal name if negative number. Otherwise -1.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is 32).
height | [optional] The height of the control (default is 32).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : $SS_NOTIFY forced styles : $WS_TABSTOP, $SS_ICON
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To set or change information in the control see GUICtrlUpdate....

To update the icon after the dialog box is displayed use GUICtrlSetImage

iconID can reference the icon group number. Use a resource hacker to know the value.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_ICON, newstyle,...).

To use the values specified above you must #include <StaticConstants.au3> in your script.

Default resizing is $GUI_DOCKSIZE.

Passing a positive number will reference the string equivalent icon name.
Passing a negative number causes 1-based "index" behaviour. Some Dll can have icon extracted just with negative numbers.

Related

GUICoordMode (Option), GUICtrlSetImage, GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example1()
Example2()

;example1 ---------------------------
Func Example1()
Local $icon, $n1, $n2, $msg

GUICreate(" My GUI Icons", 250, 250)

$icon = GUICtrlCreateIcon("shell32.dll", 10, 20, 20)
$n1 = GUICtrlCreateIcon(@WindowsDir & "\cursors\horse.ani", -1, 20, 40, 32, 32)
$n2 = GUICtrlCreateIcon("shell32.dll", 7, 20, 75, 32, 32)
GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()
EndFunc ;==>Example1

; example2 ---------------------------
Func Example2()
Local $iOldOpt, $n1, $n2, $a, $b
$iOldOpt = Opt("GUICoordMode", 1)

GUICreate("My GUI icon Race", 350, 74, -1, -1)
GUICtrlCreateLabel("", 331, 0, 1, 74, 5)
$n1 = GUICtrlCreateIcon(@WindowsDir & "\cursors\dinosaur.ani", -1, 0, 0, 32, 32)
$n2 = GUICtrlCreateIcon(@WindowsDir & "\cursors\horse.ani", -1, 0, 40, 32, 32)

GUISetState(@SW_SHOW)

Dim $a = 0, $b = 0
While ($a < 300) And ($b < 300)
$a = $a + Int(Random(0, 1) + 0.5)
$b = $b + Int(Random(0, 1) + 0.5)
GUICtrlSetPos($n1, $a, 0)
GUICtrlSetPos($n2, $b, 40)
Sleep(20)
WEnd
Sleep(1000)
Opt("GUICoordMode", $iOldOpt)
EndFunc ;==>Example2


Function GUICtrlCreateInput

Function Reference

GUICtrlCreateInput

Creates an Input control for the GUI.

GUICtrlCreateInput ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the control.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : $ES_LEFT, $ES_AUTOHSCROLL forced styles : $WS_TABSTOP only if no $ES_READONLY. $ES_MULTILINE is always reset.
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

For defining an input control for entering passwords (input is hidden with an asterisk) use the $ES_PASSWORD style.

If you want to drag & drop a filename onto this control just add the WS_EX_ACCEPTFILES extended style on the GUICreate() and set the state to $GUI_DROPACCEPTED.
After multiple drag and drop files on this control, you can retrieve the files name which are separated by "|" with GuiCtrlRead.

To use the values specified above you must #include <EditConstants.au3> in your script.

Default resizing is $GUI_DOCKHEIGHT.

Related

GUICoordMode (Option), GUICtrlUpdate..., GUIGetMsg, GUICtrlRead, GUICtrlCreateUpdown, GUICtrlSetLimit

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $file, $btn, $msg

GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES
$file = GUICtrlCreateInput("", 10, 5, 300, 20)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlCreateInput("", 10, 35, 300, 20) ; will not accept drag&drop files
$btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20)

GUISetState()

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
Case $msg = $btn
ExitLoop
EndSelect
WEnd

MsgBox(4096, "drag drop file", GUICtrlRead($file))
EndFunc ;==>Example


Function GUICtrlCreateLabel

Function Reference

GUICtrlCreateLabel

Creates a static Label control for the GUI.

GUICtrlCreateLabel ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the control.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default text autofit in width).
height | [optional] The height of the control (default text autofit in height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix.
 | default ( -1) : none. forced styles : $SS_NOTIFY, $SS_LEFT
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To set or change information in the control see GUICtrlUpdate....

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_LABEL, newstyle,...).

To use the values specified above you must #include <StaticConstants.au3> in your script.

Default resizing is $GUI_DOCKAUTO size and position will occur.

The extended style $GUI_WS_EX_PARENTDRAG can be used to allow the dragging of the parent window for windows that don't have a titlebar (no $WS_CAPTION style in GUICreate).

To set the background to transparent, use GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT).

Related

GUICoordMode (Option), GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $widthCell, $msg, $iOldOpt

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUISetHelp("notepad") ; will run notepad if F1 is typed
$iOldOpt = Opt("GUICoordMode", 2)

$widthCell = 70
GUICtrlCreateLabel("Line 1 Cell 1", 10, 30, $widthCell) ; first cell 70 width
GUICtrlCreateLabel("Line 2 Cell 1", -1, 0) ; next line
GUICtrlCreateLabel("Line 3 Cell 2", 0, 0) ; next line and next cell
GUICtrlCreateLabel("Line 3 Cell 3", 0, -1) ; next cell same line
GUICtrlCreateLabel("Line 4 Cell 1", -3 * $widthCell, 0) ; next line Cell1

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

$iOldOpt = Opt("GUICoordMode", $iOldOpt)
EndFunc ;==>Example


Function GUICtrlCreateList

Function Reference

GUICtrlCreateList

Creates a List control for the GUI.

GUICtrlCreateList ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the control.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : $LBS_SORT, $WS_BORDER, $WS_VSCROLL forced styles : $WS_TABSTOP, $LBS_NOTIFY
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

The different list entries that can be selected can be set with GUICtrlSetData

To limit horizontal scrolling use GUICtrlSetLimit

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_LIST, newstyle,...).

To use the values specified above you must #include <ListBoxConstants.au3> in your script.

Default resizing is $GUI_DOCKAUTO size and position will occur.

Related

GUICoordMode (Option), GUICtrlSetData, GUICtrlSetLimit, GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $MESSAGE = "The following buttons have been clicked"
Local $add, $clear, $mylist, $close, $msg

GUICreate("My GUI list") ; will create a dialog box that when displayed is centered

$add = GUICtrlCreateButton("Add", 64, 32, 75, 25)
$clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25)
$mylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97)
GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
GUICtrlSetData(-1, $MESSAGE)
$close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25)

GUISetState()

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()

Select
Case $msg = $add
GUICtrlSetData($mylist, "You clicked button No1|")
Case $msg = $clear
GUICtrlSetData($mylist, "")
Case $msg = $close
MsgBox(0, "", "the closing button has been clicked", 2)
Exit
EndSelect
WEnd
EndFunc ;==>Example


Function GUICtrlCreateListView

Function Reference

GUICtrlCreateListView

Creates a ListView control for the GUI.

GUICtrlCreateListView ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | definition of columns heading. Each of them are separated with Opt("GUIDataSeparatorChar").
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $LVS_SHOWSELALWAYS, $LVS_SINGLESEL forced style : $LVS_REPORT
exStyle | [optional] Defines the extended style of the control. See Extended Style Table or ListView Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To add items to a ListView control use GUICtrlCreateListViewItem

The ListView will appear by default as in the Explorer view "Details" (LVS_REPORT style is forced).
You can control initial column size by padding blanks to the column heading definition. The column can be extend during the GUICtrlCreateListViewItem according to item size. Size of a column will be up to around 25 characters. No resizing will be done during an update by GUICtrlSetData.

To create a ListView with Icon-, SmallIcon- or List-style just use after creation:
GUICtrlSetStyle with the styles $LVS_ICON, $LVS_LIST or $LVS_SMALLICON.

Sorting the list by clicking the column name (as in Explorer) is not currently implemented.

To have the entire line visually selected use the extended style LVS_EX_FULLROWSELECT.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_LISTVIEW, newstyle,...).

To use the values specified above you must #include <ListViewConstants.au3> in your script.

The special flag $GUI_BKCOLOR_LV_ALTERNATE can be used with Listview control to give alternate background of the ListviewItems lines.
The odd lines will get the color set by GUICtrlSetBkColor of the Listview control.
The even lines will get the color set by GUICtrlSetBkColor of the ListviewItem control.

Related

GUICtrlCreateListViewItem, GUICtrlRegisterListViewSort, GUICoordMode (Option), GUICtrlSetData, GUIGetMsg, GUIDataSeparatorChar (Option)

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $listview, $button, $item1, $item2, $item3, $input1, $msg

GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)
GUISetBkColor(0x00E0FFFF) ; will change background color

$listview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
$button = GUICtrlCreateButton("Value?", 75, 170, 70, 20)
$item1 = GUICtrlCreateListViewItem("item2|col22|col23", $listview)
$item2 = GUICtrlCreateListViewItem("item1|col12|col13", $listview)
$item3 = GUICtrlCreateListViewItem("item3|col32|col33", $listview)
$input1 = GUICtrlCreateInput("", 20, 200, 150)
GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping
GUISetState()
GUICtrlSetData($item2, "ITEM1")
GUICtrlSetData($item3, "||COL33")
GUICtrlDelete($item1)

Do
$msg = GUIGetMsg()

Select
Case $msg = $button
MsgBox(0, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)
Case $msg = $listview
MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
EndSelect
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example


Function GUICtrlCreateListViewItem

Function Reference

GUICtrlCreateListViewItem

Creates a ListView item.

GUICtrlCreateListViewItem ( "text", listviewID )

Parameters

text | subitemtext separated with Opt("GUIDataSeparatorChar").
listviewID | controlID of the ListView control holding the item.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

This function creates the individual ListView items that can be selected. The items function as normal controls and can be set with GUICtrlSetData.
Items can be deleted as with any other control by using GUICtrlDelete.
ListView items can be dragged and drop into an Edit or Input control with a $GUI_DROPACCEPTED state.
See GUICtrlCreateListView about resizing of the column.

The special flag $GUI_BKCOLOR_LV_ALTERNATE can be used with Listview control to give alternate background of the ListviewItems lines.
The odd lines will get the color set by GUICtrlSetBkColor of the Listview control.
The even lines will get the color set by GUICtrlSetBkColor of the ListviewItem control.

Related

GUICtrlCreateListView, GUICtrlSetData, GUICtrlSetState, GUICtrlDelete, GUIGetMsg, GUICtrlRead, GUIDataSeparatorChar (Option)

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $listview, $button, $item1, $item2, $item3, $input1, $msg

GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)
GUISetBkColor(0x00E0FFFF) ; will change background color

$listview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
$button = GUICtrlCreateButton("Value?", 75, 170, 70, 20)
$item1 = GUICtrlCreateListViewItem("item2|col22|col23", $listview)
$item2 = GUICtrlCreateListViewItem("............item1|col12|col13", $listview)
$item3 = GUICtrlCreateListViewItem("item3|col32|col33", $listview)
$input1 = GUICtrlCreateInput("", 20, 200, 150)
GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping
GUISetState()
GUICtrlSetData($item2, "|ITEM1")
GUICtrlSetData($item3, "||COL33")
GUICtrlDelete($item1)

Do
$msg = GUIGetMsg()

Select
Case $msg = $button
MsgBox(0, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)
Case $msg = $listview
MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
EndSelect
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example


Function GUICtrlCreateMenu

Function Reference

GUICtrlCreateMenu

Creates a Menu control for the GUI.

GUICtrlCreateMenu ( "submenutext" [, menuID [, menuentry]] )

Parameters

submenutext | The submenu text.
menuID | [optional] If defined, allows you to create a submenu in the referenced menu. If equal -1 it refers to first level menu.
menuentry | [optional] Allows you to define the entry number to be created. The entries are numbered starting at 0.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To set or change information in the control see GUICtrlUpdate....

Related

GUICtrlSetState, GUIGetMsg, GUICtrlCreateMenuItem, GUICtrlGetHandle, GUICtrlCreateContextMenu

Example

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $defaultstatus = "Ready", $status, $filemenu, $fileitem
Local $helpmenu, $saveitem, $infoitem, $exititem, $recentfilesmenu
Local $separator1, $viewmenu, $viewstatusitem, $okbutton, $cancelbutton
Local $statuslabel, $msg, $file

GUICreate("My GUI menu", 300, 200)

$filemenu = GUICtrlCreateMenu("&File")
$fileitem = GUICtrlCreateMenuItem("Open", $filemenu)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
$helpmenu = GUICtrlCreateMenu("?")
$saveitem = GUICtrlCreateMenuItem("Save", $filemenu)
GUICtrlSetState(-1, $GUI_DISABLE)
$infoitem = GUICtrlCreateMenuItem("Info", $helpmenu)
$exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
$recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu, 1)

$separator1 = GUICtrlCreateMenuItem("", $filemenu, 2) ; create a separator line

$viewmenu = GUICtrlCreateMenu("View", -1, 1) ; is created before "?" menu
$viewstatusitem = GUICtrlCreateMenuItem("Statusbar", $viewmenu)
GUICtrlSetState(-1, $GUI_CHECKED)
$okbutton = GUICtrlCreateButton("OK", 50, 130, 70, 20)
GUICtrlSetState(-1, $GUI_FOCUS)
$cancelbutton = GUICtrlCreateButton("Cancel", 180, 130, 70, 20)

$statuslabel = GUICtrlCreateLabel($defaultstatus, 0, 165, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN))

GUISetState()
While 1
$msg = GUIGetMsg()

If $msg = $fileitem Then
$file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu)
EndIf
If $msg = $viewstatusitem Then
If BitAND(GUICtrlRead($viewstatusitem), $GUI_CHECKED) = $GUI_CHECKED Then
GUICtrlSetState($viewstatusitem, $GUI_UNCHECKED)
GUICtrlSetState($statuslabel, $GUI_HIDE)
Else
GUICtrlSetState($viewstatusitem, $GUI_CHECKED)
GUICtrlSetState($statuslabel, $GUI_SHOW)
EndIf
EndIf
If $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton Or $msg = $exititem Then ExitLoop
If $msg = $infoitem Then MsgBox(0, "Info", "Only a test...")
WEnd
GUIDelete()
EndFunc ;==>Example


Function GUICtrlCreateMenuItem

Function Reference

GUICtrlCreateMenuItem

Creates a MenuItem control for the GUI.

GUICtrlCreateMenuItem ( "text", menuID [, menuentry [, menuradioitem]] )

Parameters

text | The text of the control.
menuID | Allows you to create a submenu in the referenced menu. If equal -1 it refers to the first level menu.
menuentry | [optional] Allows you to define the entry number to be created. The entries are numbered starting at 0.
menuradioitem | [optional] 0 (default) = create a normal menuitem, 1 = create a menuradioitem

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To set or change information in the control see GUICtrlUpdate....

If the Text parameter is a "" then a separator line is created. GUICtrlSetState can be used as for other controls. See example.

Related

GUICtrlUpdate..., GUIGetMsg, GUICtrlCreateMenu, GUICtrlCreateContextMenu

Example

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $defaultstatus, $status, $filemenu, $fileitem, $helpmenu, $saveitem
Local $infoitem, $exititem, $recentfilesmenu, $separator1, $viewmenu
Local $viewstatusitem, $okbutton, $cancelbutton, $statuslabel, $msg, $file

GUICreate("My GUI menu", 300, 200)

Global $defaultstatus = "Ready"
Global $status

$filemenu = GUICtrlCreateMenu("&File")
$fileitem = GUICtrlCreateMenuItem("Open", $filemenu)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
$helpmenu = GUICtrlCreateMenu("?")
$saveitem = GUICtrlCreateMenuItem("Save", $filemenu)
GUICtrlSetState(-1, $GUI_DISABLE)
$infoitem = GUICtrlCreateMenuItem("Info", $helpmenu)
$exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
$recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu, 1)

$separator1 = GUICtrlCreateMenuItem("", $filemenu, 2) ; create a separator line

$viewmenu = GUICtrlCreateMenu("View", -1, 1) ; is created before "?" menu
$viewstatusitem = GUICtrlCreateMenuItem("Statusbar", $viewmenu)
GUICtrlSetState(-1, $GUI_CHECKED)
$okbutton = GUICtrlCreateButton("OK", 50, 130, 70, 20)
GUICtrlSetState(-1, $GUI_FOCUS)
$cancelbutton = GUICtrlCreateButton("Cancel", 180, 130, 70, 20)

$statuslabel = GUICtrlCreateLabel($defaultstatus, 0, 165, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN))

GUISetState()
While 1
$msg = GUIGetMsg()

If $msg = $fileitem Then
$file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu)
EndIf
If $msg = $viewstatusitem Then
If BitAND(GUICtrlRead($viewstatusitem), $GUI_CHECKED) = $GUI_CHECKED Then
GUICtrlSetState($viewstatusitem, $GUI_UNCHECKED)
GUICtrlSetState($statuslabel, $GUI_HIDE)
Else
GUICtrlSetState($viewstatusitem, $GUI_CHECKED)
GUICtrlSetState($statuslabel, $GUI_SHOW)
EndIf
EndIf
If $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton Or $msg = $exititem Then ExitLoop
If $msg = $infoitem Then MsgBox(0, "Info", "Only a test...")
WEnd
GUIDelete()
EndFunc ;==>Example


Function GUICtrlCreateMonthCal

Function Reference

GUICtrlCreateMonthCal

Creates a month calendar control for the GUI.

GUICtrlCreateMonthCal ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The preselected date (always as "yyyy/mm/dd").
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : none. forced style : $WS_TABSTOP
exStyle | [optional] Defines the extended style of the control. See Extended Style Table. default (-1) : WS_EX_CLIENTEDGE

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.

Default resizing is $GUI_DOCKSIZE.

Related

GUICoordMode (Option), GUIGetMsg, GUICtrlRead

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $Date, $msg
GUICreate("Get date", 210, 190)

$Date = GUICtrlCreateMonthCal("1953/03/25", 10, 10)
GUISetState()

; Run the GUI until the dialog is closed or timeout

Do
$msg = GUIGetMsg()
If $msg = $Date Then MsgBox(0, "debug", "calendar clicked")
Until $msg = $GUI_EVENT_CLOSE

MsgBox(0, $msg, GUICtrlRead($Date), 2)
EndFunc ;==>Example


Function GUICtrlCreateObj

Function Reference

GUICtrlCreateObj

Creates an ActiveX control in the GUI.

GUICtrlCreateObj ( ObjectVar, left, top [, width [, height ]] )

Parameters

ObjectVar | A variable pointing to a previously opened object
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

This function attempts to embed an 'ActiveX Control' or a 'Document Object' inside the GUI.
Not every control can be embedded. They must at least support an 'IDispatch' interface.

'Document Objects' will only be visible if the Windows style $WS_CLIPCHILDREN has been used in GUICreate().

The GUI functions GUICtrlRead and GUICtrlSet have no effect on this control. The object can only be controlled using 'methods' or 'properties' on the $ObjectVar.

Related

ObjCreate, ObjGet, ObjEvent, IsObj

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

; Simple example: Embedding an Internet Explorer Object inside an AutoIt GUI
;
; See also: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objects/internetexplorer.asp
Func Example()
Local $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward
Local $GUI_Button_Home, $GUI_Button_Stop, $msg

$oIE = ObjCreate("Shell.Explorer.2")

; Create a simple GUI for our output
GUICreate("Embedded Web control Test", 640, 580, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
$GUIActiveX = GUICtrlCreateObj ($oIE, 10, 40, 600, 360)
$GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
$GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("Stop", 330, 420, 100, 30)

GUISetState() ;Show GUI

$oIE.navigate("http://www.autoitscript.com")

; Waiting for user to close the window
While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
$oIE.navigate("http://www.autoitscript.com")
Case $msg = $GUI_Button_Back
$oIE.GoBack
Case $msg = $GUI_Button_Forward
$oIE.GoForward
Case $msg = $GUI_Button_Stop
$oIE.Stop
EndSelect

WEnd

GUIDelete()
EndFunc ;==>Example


Function GUICtrlCreatePic

Function Reference

GUICtrlCreatePic

Creates a Picture control for the GUI.

GUICtrlCreatePic ( filename, left, top [, width [, height [, style [, exStyle]]]] )

Parameters

filename | filename of the picture to be loaded : supported types BMP, JPG, GIF(but not animated).
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $SS_NOTIFY forced style : $SS_BITMAP
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0 if picture cannot be created.

Remarks

To set or change information in the control see GUICtrlUpdate....

To update the picture after the dialog box is displayed just use GUICtrlSetImage

If you want to have a picture having the same size as the file content just use width=height=0.

To have a transparent picture it is needed to create the GUI window with WS_EX_LAYERED extended style. The left-top pixel will be used as the transparency color. If several pictures are created the last picture is defining the transparent color. See example 2.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_PIC, newstyle,...).

To use the values specified above you must #include <StaticConstants.au3> in your script.

Default resizing is $GUI_DOCKSIZE.

If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls: GuiCtrlSetState(-1,$GUI_DISABLE). This is not enough for Tab or Listview control which behave differently. In this case you need to create the picture with the $WS_CLIPSIBLINGS style, GuiCtrlSetState(-1,$GUI_ONTOP) is necessary for the Tab, TreeView or Listview control.

The extended style $GUI_WS_EX_PARENTDRAG can be used to allow the dragging of the parent window for windows that don't have a titlebar (no $WS_CAPTION style in GUICreate).

The background is always set to transparent. GUICtrlSetBkColor() has not effect on pic control.

PNG can be used with GDI+. See example 3.

Related

GUICoordMode (Option), GUICtrlSetImage, GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Global $gui, $guiPos, $pic, $picPos

Example1()
Example2()

;----- example 1 ----
Func Example1()
Local $n, $msg

GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; will create a dialog box that when displayed is centered

GUISetBkColor(0xE0FFFF)
$n = GUICtrlCreatePic("..\GUI\mslogo.jpg", 50, 50, 200, 50)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

; resize the control
$n = GUICtrlSetPos($n, 50, 50, 200, 100)
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

GUIDelete()
EndFunc ;==>Example1

;----- example 2
Func Example2()
Local $msg

$gui = GUICreate("test transparentpic", 200, 100)
$pic = GUICreate("", 68, 71, 10, 20, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $gui)
GUICtrlCreatePic("..\GUI\merlin.gif", 0, 0, 0, 0)

GUISetState(@SW_SHOW, $pic)
GUISetState(@SW_SHOW, $gui)

HotKeySet("{ESC}", "main")
HotKeySet("{LEFT}", "left")
HotKeySet("{RIGHT}", "right")
HotKeySet("{DOWN}", "down")
HotKeySet("{UP}", "up")
$picPos = WinGetPos($pic)
$guiPos = WinGetPos($gui)

Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example2

Func main()
$guiPos = WinGetPos($gui)
WinMove($gui, "", $guiPos[0] + 10, $guiPos[1] + 10)
EndFunc ;==>main

Func left()
$picPos = WinGetPos($pic)
WinMove($pic, "", $picPos[0] - 10, $picPos[1])
EndFunc ;==>left

Func right()
$picPos = WinGetPos($pic)
WinMove($pic, "", $picPos[0] + 10, $picPos[1])
EndFunc ;==>right

Func down()
$picPos = WinGetPos($pic)
WinMove($pic, "", $picPos[0], $picPos[1] + 10)
EndFunc ;==>down

Func up()
$picPos = WinGetPos($pic)
WinMove($pic, "", $picPos[0], $picPos[1] - 10)
EndFunc ;==>up

;----- example 3 PNG work araund by Zedna
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>

Global $hGUI, $hImage, $hGraphic, $hImage1

; Create GUI
$hGUI = GUICreate("Show PNG", 250, 250)

; Load PNG image
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile("..\GUI\Torus.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)

GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT")
GUISetState()

; Loop until user exits
do
until GUIGetMsg() = $GUI_EVENT_CLOSE

; Clean up resources
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_ShutDown()

; Draw PNG image
Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam)
_WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
_WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE)
Return $GUI_RUNDEFMSG
EndFunc


Function GUICtrlCreateProgress

Function Reference

GUICtrlCreateProgress

Creates a Progress control for the GUI.

GUICtrlCreateProgress ( left, top [, width [, height [, style [, exStyle]]]] )

Parameters

left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix.
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

To update the bar position just use GUICtrlSetData.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_PROGRESS, newstyle,...).

To use the values specified above you must #include <ProgressConstants.au3> in your script.

Default resizing is $GUI_DOCKAUTO size and position will occur.

Related

GUICoordMode (Option), GUICtrlSetData, GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $progressbar1, $progressbar2, $button, $wait, $s, $msg, $m

GUICreate("My GUI Progressbar", 220, 100, 100, 200)
$progressbar1 = GUICtrlCreateProgress(10, 10, 200, 20)
GUICtrlSetColor(-1, 32250); not working with Windows XP Style
$progressbar2 = GUICtrlCreateProgress(10, 40, 200, 20, $PBS_SMOOTH)
$button = GUICtrlCreateButton("Start", 75, 70, 70, 20)
GUISetState()

$wait = 20; wait 20ms for next progressstep
$s = 0; progressbar-saveposition
Do
$msg = GUIGetMsg()
If $msg = $button Then
GUICtrlSetData($button, "Stop")
For $i = $s To 100
If GUICtrlRead($progressbar1) = 50 Then MsgBox(0, "Info", "The half is done...", 1)
$m = GUIGetMsg()

If $m = -3 Then ExitLoop

If $m = $button Then
GUICtrlSetData($button, "Next")
$s = $i;save the current bar-position to $s
ExitLoop
Else
$s = 0
GUICtrlSetData($progressbar1, $i)
GUICtrlSetData($progressbar2, (100 - $i))
Sleep($wait)
EndIf
Next
If $i > 100 Then
; $s=0
GUICtrlSetData($button, "Start")
EndIf
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example


Function GUICtrlCreateRadio

Function Reference

GUICtrlCreateRadio

Creates a Radio button control for the GUI.

GUICtrlCreateRadio ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text | The text of the control.
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default text autofit in width).
height | [optional] The height of the control (default text autofit in height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : none. forced styles : $BS_AUTORADIOBUTTON and $WS_TABSTOP if first radio in the group.
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_RADIO, newstyle,...).

To use the values specified above you must #include <ButtonConstants.au3> in your script.

Default resizing is $GUI_DOCKHEIGHT.

Related

GUICoordMode (Option), GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $radio1, $radio2, $msg
GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered

$radio1 = GUICtrlCreateRadio("Radio 1", 10, 10, 120, 20)
$radio2 = GUICtrlCreateRadio("Radio 2", 10, 40, 120, 20)
GUICtrlSetState($radio2, $GUI_CHECKED)

GUISetState() ; will display an dialog box with 1 checkbox

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
MsgBox(64, 'Info:', 'You clicked the Radio 1 and it is Checked.')
Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
MsgBox(64, 'Info:', 'You clicked on Radio 2 and it is Checked.')
EndSelect
WEnd
EndFunc ;==>Example


Function GUICtrlCreateSlider

Function Reference

GUICtrlCreateSlider

Creates a Slider control for the GUI.

GUICtrlCreateSlider ( left, top [, width [, height [, style [, exStyle]]]] )

Parameters

left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $TBS_AUTOTICKS
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlUpdate....

To update the bar position just use GUICtrlSetData.
To set the min and max value use GUICtrlSetLimit.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_SLIDER, newstyle,...).

To use the values specified above you must #include <SliderConstants.au3> in your script.

Default resizing is $GUI_DOCKAUTO size and position will occur.

Related

GUICoordMode (Option), GUICtrlSetData, GUICtrlSetLimit, GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $slider1, $button, $msg

GUICreate("slider", 220, 100, 100, 200)
GUISetBkColor(0x00E0FFFF) ; will change background color

$slider1 = GUICtrlCreateSlider(10, 10, 200, 20)
GUICtrlSetLimit(-1, 200, 0) ; change min/max value
$button = GUICtrlCreateButton("Value?", 75, 70, 70, 20)
GUISetState()
GUICtrlSetData($slider1, 45) ; set cursor

Do
$msg = GUIGetMsg()

If $msg = $button Then
MsgBox(0, "slider1", GUICtrlRead($slider1), 2)
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example


Function GUICtrlCreateTab

Function Reference

GUICtrlCreateTab

Creates a Tab control for the GUI.

GUICtrlCreateTab ( left, top [, width [, height [, style [, exStyle]]]] )

Parameters

left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : none. forced styles : $WS_TABSTOP, $WS_CLIPSIBLINGS
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

This control is just a control in which the tabitem controls will be created and after the specific control related to a specific tabitem will be created with GUICtrlCreate... controls.

To set or change information in the control see GUICtrlUpdate....

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_TAB, newstyle,...).

To use the value specified above you must #include <TabConstants.au3> in your script.

Default resizing is $GUI_DOCKSIZE.

ONLY one Tab control can be created by window. But a script can creates several windows having a tab in.

Related

GUICtrlCreateTabItem, GUICoordMode (Option), GUICtrlCreate..., GUICtrlUpdate..., GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $tab, $tab0, $tab0OK, $tab0input
Local $tab1, $tab1combo, $tab1OK
Local $tab2, $tab2OK, $msg

GUICreate("My GUI Tab") ; will create a dialog box that when displayed is centered

GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)

$tab = GUICtrlCreateTab(10, 10, 200, 100)

$tab0 = GUICtrlCreateTabItem("tab0")
GUICtrlCreateLabel("label0", 30, 80, 50, 20)
$tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
$tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)

$tab1 = GUICtrlCreateTabItem("tab----1")
GUICtrlCreateLabel("label1", 30, 80, 50, 20)
$tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon
$tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

$tab2 = GUICtrlCreateTabItem("tab2")
GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
GUICtrlCreateLabel("label2", 30, 80, 50, 20)
$tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

GUICtrlCreateTabItem("") ; end tabitem definition

GUICtrlCreateLabel("label3", 20, 130, 50, 20)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlCreateTabItem

Function Reference

GUICtrlCreateTabItem

Creates a TabItem control for the GUI.

GUICtrlCreateTabItem ( "text" )

Parameters

text The text of the control.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

For setting more information see GUICtrlUpdate....

To select a specific tabitem to be shown when the dialog box open just issue a GUICtrlSetState(-1,$GUI_SHOW) see example.

To terminate the tab control just create a last "tabitem" control with a null text "". The "tabitem" control cannot be painted (too much code ...).

When advanced mode is used, GUICtrlRead($tab,1) will return the controlID instead of index of the clicked tab item.

To create a new control on an existing tabitem use GUISwitch($hWin,$tabitem) to select it and just create your new control. Don't forget to close your tabitem creation with GUICtrlCreateTabItem("").

Related

GUICtrlSetState, GUISwitch, GUIGetMsg, GUICtrlRead, GUIEventOptions (Option), GUICtrlCreateTab

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $tab, $tab0, $tab0OK, $tab0input
Local $tab1, $tab1combo, $tab1OK
Local $tab2, $tab2OK, $msg

GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered

GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)

$tab = GUICtrlCreateTab(10, 10, 200, 100)

$tab0 = GUICtrlCreateTabItem("tab0")
GUICtrlCreateLabel("label0", 30, 80, 50, 20)
$tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
$tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)

$tab1 = GUICtrlCreateTabItem("tab----1")
GUICtrlCreateLabel("label1", 30, 80, 50, 20)
$tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
$tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

$tab2 = GUICtrlCreateTabItem("tab2")
GUICtrlSetState(-1, $GUI_SHOW); will be display first
GUICtrlCreateLabel("label2", 30, 80, 50, 20)
$tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

GUICtrlCreateTabItem(""); end tabitem definition

GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg = $tab Then
; display the clicked tab
WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))
EndIf
WEnd
EndFunc ;==>Example


Function GUICtrlCreateTreeView

Function Reference

GUICtrlCreateTreeView

Creates a TreeView control for the GUI.

GUICtrlCreateTreeView ( left, top [, width [, height [, style [, exStyle]]]] )

Parameters

left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS forced style : $WS_TABSTOP
exStyle | [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To set or change information in the control see GUICtrlUpdate....

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_TREEVIEW, newstyle,...).

To use the values specified above you must #include <TreeViewConstants.au3> in your script.

Related

GUICtrlCreateTreeViewItem, GUICoordMode (Option), GUICtrlUpdate..., GUIGetMsg, GUICtrlRead

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $treeview, $generalitem, $displayitem, $aboutitem, $compitem
Local $useritem, $resitem, $otheritem, $startlabel, $aboutlabel, $compinfo
Local $togglebutton, $infobutton, $statebutton, $cancelbutton
Local $msg, $item, $hItem, $text

GUICreate("My GUI with treeview", 350, 215)

$treeview = GUICtrlCreateTreeView(6, 6, 100, 150, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$generalitem = GUICtrlCreateTreeViewItem("General", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$displayitem = GUICtrlCreateTreeViewItem("Display", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$aboutitem = GUICtrlCreateTreeViewItem("About", $generalitem)
$compitem = GUICtrlCreateTreeViewItem("Computer", $generalitem)
$useritem = GUICtrlCreateTreeViewItem("User", $generalitem)
$resitem = GUICtrlCreateTreeViewItem("Resolution", $displayitem)
$otheritem = GUICtrlCreateTreeViewItem("Other", $displayitem)

$startlabel = GUICtrlCreateLabel("TreeView Demo", 190, 90, 100, 20)
$aboutlabel = GUICtrlCreateLabel("This little scripts demonstates the using of a treeview-control.", 190, 70, 100, 60)
GUICtrlSetState(-1, $GUI_HIDE) ; Hides the "aboutlabel"-text during initialization
$compinfo = GUICtrlCreateLabel("Name:" & @TAB & @ComputerName & @LF & "OS:" & @TAB & @OSVersion & @LF & "SP:" & @TAB & @OSServicePack, 120, 30, 200, 80)
GUICtrlSetState(-1, $GUI_HIDE) ; Hides the "compinfo"-text during initialization

GUICtrlCreateLabel("", 0, 170, 350, 2, $SS_SUNKEN)
$togglebutton = GUICtrlCreateButton("&Toggle", 35, 185, 70, 20)
$infobutton = GUICtrlCreateButton("&Info", 105, 185, 70, 20)
$statebutton = GUICtrlCreateButton("Col./Exp.", 175, 185, 70, 20)
$cancelbutton = GUICtrlCreateButton("&Cancel", 245, 185, 70, 20)

GUICtrlSetState($generalitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "General"-item and paint in bold
GUICtrlSetState($displayitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "Display"-item and paint in bold

GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $cancelbutton Or $msg = $GUI_EVENT_CLOSE
ExitLoop

Case $msg = $togglebutton ; Toggle the bold painting
If BitAND(GUICtrlRead($generalitem), $GUI_DEFBUTTON) Then
GUICtrlSetState($generalitem, 0)
GUICtrlSetState($displayitem, 0)
Else
GUICtrlSetState($generalitem, $GUI_DEFBUTTON)
GUICtrlSetState($displayitem, $GUI_DEFBUTTON)
EndIf

Case $msg = $infobutton
$item = GUICtrlRead($treeview) ; Get the controlID of the current selected treeview item
If $item = 0 Then
MsgBox(64, "TreeView Demo", "No item currently selected")
Else
$text = GUICtrlRead($item, 1) ; Get the text of the treeview item
If $text == "" Then
MsgBox(16, "Error", "Error while retrieving infos about item")
Else
MsgBox(64, "TreeView Demo", "Current item selected is: " & $text) ; $advmsg[0] contains the text and $advmsg[1] the state value of the treeview item
EndIf
EndIf

Case $msg = $statebutton
$item = GUICtrlRead($treeview)
If $item > 0 Then
$hItem = GUICtrlGetHandle($item)
GUICtrlSendMsg($treeview, $TVM_EXPAND, $TVE_TOGGLE, $hItem)
EndIf

; The following items will hide the other labels (1st and 2nd parameter) and then show the 'own' labels (3rd and 4th parameter)
Case $msg = $generalitem
GUIChangeItems($aboutlabel, $compinfo, $startlabel, $startlabel)

Case $msg = $aboutitem
GUICtrlSetState($compinfo, $GUI_HIDE)
GUIChangeItems($startlabel, $startlabel, $aboutlabel, $aboutlabel)

Case $msg = $compitem
GUIChangeItems($startlabel, $aboutlabel, $compinfo, $compinfo)
EndSelect
WEnd

GUIDelete()
EndFunc ;==>Example

Func GUIChangeItems($hidestart, $hideend, $showstart, $showend)
Local $idx

For $idx = $hidestart To $hideend
GUICtrlSetState($idx, $GUI_HIDE)
Next
For $idx = $showstart To $showend
GUICtrlSetState($idx, $GUI_SHOW)
Next
EndFunc ;==>GUIChangeItems


Function GUICtrlCreateTreeViewItem

Function Reference

GUICtrlCreateTreeViewItem

Creates a TreeViewItem control for the GUI.

GUICtrlCreateTreeViewItem ( "text", treeviewID )

Parameters

text | The text of the control.
treeviewID | treeview identifier as return by treeview or treeviewitem creation if subtree is created.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

For setting more information see GUICtrlUpdate....

To paint a treeview item in bold (to show as default) use GuiCtrlSetState($treeviewItem, $GUI_DEFBUTTON),
to turn off this behaviour use GUICtrlSetState() with another value but $GUI_DEFBUTTON, for instance GuiCtrlSetState($treeviewItem, 0).

To expand a treeview item use GuiCtrlSetState($treeviewItem, $GUI_EXPAND).

To select a specific treeview item use GuiCtrlSetState($treeviewItem, $GUI_FOCUS).

Related

GUICtrlCreateTreeView, GUICtrlUpdate..., GUIGetMsg, GUICtrlRead, GUICtrlGetHandle

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $treeview, $generalitem, $displayitem, $aboutitem, $compitem
Local $useritem, $resitem, $otheritem, $startlabel, $aboutlabel
Local $compinfo, $togglebutton, $infobutton, $statebutton, $cancelbutton
Local $msg, $item, $text, $hItem

GUICreate("My GUI with treeview", 350, 215)

$treeview = GUICtrlCreateTreeView(6, 6, 100, 150, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$generalitem = GUICtrlCreateTreeViewItem("General", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$displayitem = GUICtrlCreateTreeViewItem("Display", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$aboutitem = GUICtrlCreateTreeViewItem("About", $generalitem)
$compitem = GUICtrlCreateTreeViewItem("Computer", $generalitem)
$useritem = GUICtrlCreateTreeViewItem("User", $generalitem)
$resitem = GUICtrlCreateTreeViewItem("Resolution", $displayitem)
$otheritem = GUICtrlCreateTreeViewItem("Other", $displayitem)

$startlabel = GUICtrlCreateLabel("TreeView Demo", 190, 90, 100, 20)
$aboutlabel = GUICtrlCreateLabel("This little scripts demonstates the using of a treeview-control.", 190, 70, 100, 60)
GUICtrlSetState(-1, $GUI_HIDE) ; Hides the "aboutlabel"-text during initialization
$compinfo = GUICtrlCreateLabel("Name:" & @TAB & @ComputerName & @LF & "OS:" & @TAB & @OSVersion & @LF & "SP:" & @TAB & @OSServicePack, 120, 30, 200, 80)
GUICtrlSetState(-1, $GUI_HIDE) ; Hides the "compinfo"-text during initialization

GUICtrlCreateLabel("", 0, 170, 350, 2, $SS_SUNKEN)
$togglebutton = GUICtrlCreateButton("&Toggle", 35, 185, 70, 20)
$infobutton = GUICtrlCreateButton("&Info", 105, 185, 70, 20)
$statebutton = GUICtrlCreateButton("Col./Exp.", 175, 185, 70, 20)
$cancelbutton = GUICtrlCreateButton("&Cancel", 245, 185, 70, 20)

GUICtrlSetState($generalitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "General"-item and paint in bold
GUICtrlSetState($displayitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "Display"-item and paint in bold

GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $cancelbutton Or $msg = $GUI_EVENT_CLOSE
ExitLoop

Case $msg = $togglebutton ; Toggle the bold painting
If BitAND(GUICtrlRead($generalitem), $GUI_DEFBUTTON) Then
GUICtrlSetState($generalitem, 0)
GUICtrlSetState($displayitem, 0)
Else
GUICtrlSetState($generalitem, $GUI_DEFBUTTON)
GUICtrlSetState($displayitem, $GUI_DEFBUTTON)
EndIf

Case $msg = $infobutton
$item = GUICtrlRead($treeview) ; Get the controlID of the current selected treeview item
If $item = 0 Then
MsgBox(64, "TreeView Demo", "No item currently selected")
Else
$text = GUICtrlRead($item, 1) ; Get the text of the treeview item
If $text == "" Then
MsgBox(16, "Error", "Error while retrieving infos about item")
Else
MsgBox(64, "TreeView Demo", "Current item selected is: " & $text)
EndIf
EndIf

Case $msg = $statebutton
$item = GUICtrlRead($treeview)
If $item > 0 Then
$hItem = GUICtrlGetHandle($item)
DllCall("user32.dll", "int", "SendMessage", "hwnd", GUICtrlGetHandle($treeview), "int", $TVM_EXPAND, "int", $TVE_TOGGLE, "hwnd", $hItem)
EndIf

; The following items will hide the other labels (1st and 2nd parameter) and then show the 'own' labels (3rd and 4th parameter)
Case $msg = $generalitem
GUIChangeItems($aboutlabel, $compinfo, $startlabel, $startlabel)

Case $msg = $aboutitem
GUICtrlSetState($compinfo, $GUI_HIDE)
GUIChangeItems($startlabel, $startlabel, $aboutlabel, $aboutlabel)

Case $msg = $compitem
GUIChangeItems($startlabel, $aboutlabel, $compinfo, $compinfo)
EndSelect
WEnd

GUIDelete()
EndFunc ;==>Example

Func GUIChangeItems($hidestart, $hideend, $showstart, $showend)
Local $idx

For $idx = $hidestart To $hideend
GUICtrlSetState($idx, $GUI_HIDE)
Next
For $idx = $showstart To $showend
GUICtrlSetState($idx, $GUI_SHOW)
Next
EndFunc ;==>GUIChangeItems


Function GUICtrlCreateUpdown

Function Reference

GUICtrlCreateUpdown

Creates an UpDown control for the GUI.

GUICtrlCreateUpdown ( inputcontrolID [,style] )

Parameters

inputcontrolID | The controlID of the input control in which the updown control will be created.
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $UDS_ALIGNRIGHT. forced style : $UDS_SETBUDDYINT and $UDS_ALIGNRIGHT if no align defined.

Return Value

Success: | Returns the identifier (controlID) of the new control.
Failure: | Returns 0.

Remarks

To use the values specified above you must #include <UpDownConstants.au3> in your script.

Max and min value can be set with GUICtrlSetLimit.
By default Windows increases the value when clicking the upper arrow button.

Default height resizing is done according to the one of the related input control.

Related

GUICtrlCreateInput, GUICtrlSetData, GUICtrlSetLimit

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $title, $input, $updown, $msg

$title = "My GUI UpDown"
GUICreate($title, -1, -1, -1, -1, $WS_SIZEBOX)

$input = GUICtrlCreateInput("2", 10, 10, 50, 20)
$updown = GUICtrlCreateUpdown($input)

; Attempt to resize input control
GUICtrlSetPos($input, 10, 10, 100, 40)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

MsgBox(0, "Updown", GUICtrlRead($input))
EndFunc ;==>Example


Function GUICtrlDelete

Function Reference

GUICtrlDelete

Deletes a control.

GUICtrlDelete ( controlID )

Parameters

controlID The control identifier (controlID) as returned by a GUICtrlCreate... function.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

For context menu controls see GUICtrlCreateContextMenu remarks.

Related

GUICreate, GUICtrlCreate..., GUICtrlCreateContextMenu

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $date, $del, $msg

GUICreate("My GUI delete control", 200, 200, 800, 200)
$date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
$del = GUICtrlCreateButton("Delete control", 50, 50, 70, 20)
GUISetState()

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
If $msg = $del Then
GUICtrlDelete($date)
GUICtrlDelete($del)
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example


Functions

GUI Control update functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

See Gui Constants include files if you need to use the related controls Constants .

Function | Description
GUICtrlRegisterListViewSort | Register a user defined function for an internal listview sorting callback function.
GUICtrlSetBkColor | Sets the background color of a control.
GUICtrlSetColor | Sets the text color of a control.
GUICtrlSetCursor | Sets the mouse cursor icon for a particular control.
GUICtrlSetData | Modifies the data for a control.
GUICtrlSetDefBkColor | Sets the default background color of all the controls of the GUI window.
GUICtrlSetDefColor | Sets the default text color of all the controls of the GUI window.
GUICtrlSetFont | Sets the font for a control.
GUICtrlSetGraphic | Modifies the data for a control.
GUICtrlSetImage | Sets the bitmap or icon image to use for a control.
GUICtrlSetLimit | Limits the number of characters/pixels for a control.
GUICtrlSetOnEvent | Defines a user-defined function to be called when a control is clicked.
GUICtrlSetPos | Changes the position of a control within the GUI window.
GUICtrlSetResizing | Defines the resizing method used by a control.
GUICtrlSetState | Changes the state of a control.
GUICtrlSetStyle | Changes the style of a control.
GUICtrlSetTip | Sets the tip text associated with a control.


Function GUICtrlRegisterListViewSort

Function Reference

GUICtrlRegisterListViewSort

Register a user defined function for an internal listview sorting callback function.

GUICtrlRegisterListViewSort ( controlID, "function" )

Parameters

controlID | The listview controlID for which the user function should proceed.
function | The name of the user function to call when the sorting callback runs.

Return Value

Success: | 1
Failure: | 0

Remarks

!!! To make the user function workable you have to define it with maximum 4 function parameters otherwise the function won't be called !!!
i.e:
Func MySortFunction($nListViewID, $LParam1, $LParam2, $nColumn)
...
EndFunc

Or

Func MySortFunction($nListViewID, $LParam1, $LParam2)
...
EndFunc

When the user function is called then these 4 parameters have the following values:
Position | Parameter | Meaning
1 | controlID | The controlID of the listview control for which the callback function is used.
2 | lParam1 | The lParam value of the first item (by default the item controlID).
3 | lParam2 | The lParam value of the second item (by default the item controlID).
4 | column | The column that was clicked for sorting (the first column number is 0).

The following values have to be Returned to change the behaviour of the sorting callback:
Return value | Meaning
-1 | 1st item should precede the 2nd.
0 | No Change.
1 | 1st item should follow the 2nd.

See also examples for sorting with selfcreated GUI listview items.

Related

GUICtrlCreateListView

Example

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>

Opt('MustDeclareVars', 1)

Global $nCurCol = -1
Global $nSortDir = 1
Global $bSet = 0
Global $nCol = -1

Example1()
Example2()

; *******************************************************
; Example 1 - sorting 3 column's different
; *******************************************************
Func Example1()
Local $hGUI, $lv, $lvi1, $lvi2, $lvi3, $msg

$hGUI = GUICreate("Test", 300, 200)

$lv = GUICtrlCreateListView("Column1|Col2|Col3", 10, 10, 280, 180)
GUICtrlRegisterListViewSort(-1, "LVSort") ; Register the function "SortLV" for the sorting callback

$lvi1 = GUICtrlCreateListViewItem("ABC|666|10.05.2004", $lv)
GUICtrlSetImage(-1, "shell32.dll", 7)
$lvi2 = GUICtrlCreateListViewItem("DEF|444|11.05.2005", $lv)
GUICtrlSetImage(-1, "shell32.dll", 12)
$lvi3 = GUICtrlCreateListViewItem("CDE|444|12.05.2004", $lv)
GUICtrlSetImage(-1, "shell32.dll", 3)

GUISetState()

While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ExitLoop

Case $lv
$bSet = 0
$nCurCol = $nCol
GUICtrlSendMsg($lv, $LVM_SETSELECTEDCOLUMN, GUICtrlGetState($lv), 0)
DllCall("user32.dll", "int", "InvalidateRect", "hwnd", GUICtrlGetHandle($lv), "int", 0, "int", 1)
EndSwitch
WEnd

GUIDelete()
EndFunc ;==>Example1

; Our sorting callback funtion
Func LVSort($hWnd, $nItem1, $nItem2, $nColumn)
Local $nSort, $val1, $val2, $nResult

; Switch the sorting direction
If $nColumn = $nCurCol Then
If Not $bSet Then
$nSortDir = $nSortDir * - 1
$bSet = 1
EndIf
Else
$nSortDir = 1
EndIf
$nCol = $nColumn

$val1 = GetSubItemText($hWnd, $nItem1, $nColumn)
$val2 = GetSubItemText($hWnd, $nItem2, $nColumn)

; If it is the 3rd colum (column starts with 0) then compare the dates
If $nColumn = 2 Then
$val1 = StringRight($val1, 4) & StringMid($val1, 4, 2) & StringLeft($val1, 2)
$val2 = StringRight($val2, 4) & StringMid($val2, 4, 2) & StringLeft($val2, 2)
EndIf

$nResult = 0 ; No change of item1 and item2 positions

If $val1 < $val2 Then
$nResult = -1 ; Put item2 before item1
ElseIf $val1 > $val2 Then
$nResult = 1 ; Put item2 behind item1
EndIf

$nResult = $nResult * $nSortDir

Return $nResult
EndFunc ;==>LVSort

; Retrieve the text of a listview item in a specified column
Func GetSubItemText($nCtrlID, $nItemID, $nColumn)
Local $stLvfi = DllStructCreate("uint;ptr;int;int[2];int")
Local $nIndex, $stBuffer, $stLvi, $sItemText

DllStructSetData($stLvfi, 1, $LVFI_PARAM)
DllStructSetData($stLvfi, 3, $nItemID)

$stBuffer = DllStructCreate("char[260]")

$nIndex = GUICtrlSendMsg($nCtrlID, $LVM_FINDITEM, -1, DllStructGetPtr($stLvfi));

$stLvi = DllStructCreate("uint;int;int;uint;uint;ptr;int;int;int;int")

DllStructSetData($stLvi, 1, $LVIF_TEXT)
DllStructSetData($stLvi, 2, $nIndex)
DllStructSetData($stLvi, 3, $nColumn)
DllStructSetData($stLvi, 6, DllStructGetPtr($stBuffer))
DllStructSetData($stLvi, 7, 260)

GUICtrlSendMsg($nCtrlID, $LVM_GETITEMA, 0, DllStructGetPtr($stLvi));

$sItemText = DllStructGetData($stBuffer, 1)

$stLvi = 0
$stLvfi = 0
$stBuffer = 0

Return $sItemText
EndFunc ;==>GetSubItemText

; *******************************************************
; Example 2 - sorting with selfcreated items by DllCall
; *******************************************************
Func Example2()
Local $hGUI, $lv, $msg

$nCurCol = -1
$nSortDir = 1
$bSet = 0
$nCol = -1

$hGUI = GUICreate("Test", 300, 200)

$lv = GUICtrlCreateListView("Column1|Col2|Col3", 10, 10, 280, 180)
GUICtrlRegisterListViewSort(-1, "LVSort2") ; Register the function "SortLV" for the sorting callback

MyGUICtrlCreateListViewItem("ABC|666|10.05.2004", $lv, -1)
MyGUICtrlCreateListViewItem("DEF|444|11.05.2005", $lv, -1)
MyGUICtrlCreateListViewItem("CDE|444|12.05.2004", $lv, -1)

GUISetState()

While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ExitLoop

Case $lv
$bSet = 0
$nCurCol = $nCol
GUICtrlSendMsg($lv, $LVM_SETSELECTEDCOLUMN, GUICtrlGetState($lv), 0)
DllCall("user32.dll", "int", "InvalidateRect", "hwnd", ControlGetHandle($hGUI, "", $lv), "int", 0, "int", 1)
EndSwitch
WEnd
EndFunc ;==>Example2

; Our sorting callback funtion
Func LVSort2($hWnd, $nItem1, $nItem2, $nColumn)
Local $nSort, $val1, $val2, $nResult

; Switch the sorting direction
If $nColumn = $nCurCol Then
If Not $bSet Then
$nSortDir = $nSortDir * - 1
$bSet = 1
EndIf
Else
$nSortDir = 1
EndIf
$nCol = $nColumn

$val1 = GetSubItemText($hWnd, $nItem1, $nColumn)
$val2 = GetSubItemText($hWnd, $nItem2, $nColumn)

; If it is the 3rd colum (column starts with 0) then compare the dates
If $nColumn = 2 Then
$val1 = StringRight($val1, 4) & StringMid($val1, 4, 2) & StringLeft($val1, 2)
$val2 = StringRight($val2, 4) & StringMid($val2, 4, 2) & StringLeft($val2, 2)
EndIf

$nResult = 0 ; No change of item1 and item2 positions

If $val1 < $val2 Then
$nResult = -1 ; Put item2 before item1
ElseIf $val1 > $val2 Then
$nResult = 1 ; Put item2 behind item1
EndIf

$nResult = $nResult * $nSortDir

Return $nResult
EndFunc ;==>LVSort2

; Retrieve the text of a listview item in a specified column
Func GetSubItemText2($nCtrlID, $nItemID, $nColumn)
Local $stLvfi = DllStructCreate("uint;ptr;int;int[2];int")
Local $stBuffer, $nIndex, $stLvi, $sItemText

DllStructSetData($stLvfi, 1, $LVFI_PARAM) ; Find the item by our saved index
DllStructSetData($stLvfi, 3, $nItemID)

$stBuffer = DllStructCreate("char[260]")

$nIndex = GUICtrlSendMsg($nCtrlID, $LVM_FINDITEM, -1, DllStructGetPtr($stLvfi));

$stLvi = DllStructCreate("uint;int;int;uint;uint;ptr;int;int;int;int")

DllStructSetData($stLvi, 1, $LVIF_TEXT)
DllStructSetData($stLvi, 2, $nIndex)
DllStructSetData($stLvi, 3, $nColumn)
DllStructSetData($stLvi, 6, DllStructGetPtr($stBuffer))
DllStructSetData($stLvi, 7, 260)

GUICtrlSendMsg($nCtrlID, $LVM_GETITEMA, 0, DllStructGetPtr($stLvi));

$sItemText = DllStructGetData($stBuffer, 1)

$stLvi = 0
$stLvfi = 0
$stBuffer = 0

Return $sItemText
EndFunc ;==>GetSubItemText2

; Create and insert items directly into the listview
Func MyGUICtrlCreateListViewItem($sText, $nCtrlID, $nIndex)
Local $stLvItem = DllStructCreate("uint;int;int;uint;uint;ptr;int;int;int;int;")
Local $stText = DllStructCreate("char[260]")
Local $arText = StringSplit($sText, "|")

If $nIndex = -1 Then $nIndex = GUICtrlSendMsg($nCtrlID, $LVM_GETITEMCOUNT, 0, 0)

DllStructSetData($stText, 1, $arText[1]) ; Save the item text in the struct

DllStructSetData($stLvItem, 1, BitOR($LVIF_TEXT, $LVIF_PARAM))
DllStructSetData($stLvItem, 2, $nIndex)
DllStructSetData($stLvItem, 6, DllStructGetPtr($stText))
; Set the lParam of the struct to the line index - unique within the listview
DllStructSetData($stLvItem, 9, $nIndex)

$nIndex = GUICtrlSendMsg($nCtrlID, $LVM_INSERTITEMA, 0, DllStructGetPtr($stLvItem))

If $nIndex > -1 Then
; Insert now the rest of the column text
For $i = 2 To $arText[0]
DllStructSetData($stText, 1, $arText[$i])
DllStructSetData($stLvItem, 3, $i - 1) ; Store the subitem index

GUICtrlSendMsg($nCtrlID, $LVM_SETITEMTEXTA, $nIndex, DllStructGetPtr($stLvItem))
Next
EndIf

$stText = 0
$stLvItem = 0

; Change the column width to fit the item text
For $i = 0 To 2
GUICtrlSendMsg($nCtrlID, $LVM_SETCOLUMNWIDTH, $i, -1)
GUICtrlSendMsg($nCtrlID, $LVM_SETCOLUMNWIDTH, $i, -2)
Next
EndFunc ;==>MyGUICtrlCreateListViewItem


Function GUICtrlSetBkColor

Function Reference

GUICtrlSetBkColor

Sets the background color of a control.

GUICtrlSetBkColor ( controlID, backgroundcolor )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
backgroundcolor | The RGB color to use.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Only Button, Label, Checkbox, Group, Radio, Edit, Input, List, Listview, ListviewItem, Treeview, TreeviewItem, Graphic, Progress, Slider and Combo controls can currently be colored.

Progress controls cannot be painted if the "Windows XP style" is used.

Button controls are always painted in "Windows Classic style". They cannot have the $BS_ICON style.

The special flag $GUI_BKCOLOR_TRANSPARENT can be used with Label, Group, Radio, Checkbox controls to give them a transparent background.

The special flag $GUI_BKCOLOR_LV_ALTERNATE can be used with Listview control to give alternate background of the ListviewItems lines.
The odd lines will get the color set by GUICtrlSetBkColor of the Listview control.
The even lines will get the color set by GUICtrlSetBkColor of the ListviewItem control.

Related

GUICtrlCreate..., GUICtrlSetColor, GUICtrlSetDefBkColor

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI background color") ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("my label", 10, 20)
GUICtrlSetBkColor(-1, 0x00ff00) ; Green

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetColor

Function Reference

GUICtrlSetColor

Sets the text color of a control.

GUICtrlSetColor ( controlID, textcolor)

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
textcolor | The RGB color to use.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Only Button, Label, Checkbox, Group, Radio, Edit, Input, List, Listview, ListviewItem, Treeview, TreeviewItem, Graphic, Progress and Combo controls can currently be colored.

Checkbox, Radio, Group or Progress controls cannot be painted if the "Windows XP/Vista style" is used.

Button controls are always painted in "Windows Classic style".

Related

GUICtrlCreate..., GUICtrlSetBkColor, GUICtrlSetDefColor

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI color text") ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("my Red label", 10, 20)
GUICtrlSetColor(-1, 0xff0000) ; Red

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetCursor

Function Reference

GUICtrlSetCursor

Sets the mouse cursor icon for a particular control.

GUICtrlSetCursor ( controlID, cursorID )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
cursorID | cursor ID as used by Windows SetCursor API (use -1 for the default mouse cursor for the control)

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Unlike GUISetCursor which changes the mouse cursor for an entire window, this function sets the mouse cursor that is used when the mouse is hovering over the specified control.

If the cursorID is invalid the standard arrow will be displayed.

For a list of valid cursor IDs see MouseGetCursor.
CursorId = 16 will hide the mouse cursor.

Related

GUISetCursor

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()

GUICreate("put cursor over label", 300, 100)
GUICtrlCreateLabel("label", 125, 40)
GUICtrlSetCursor(-1, 4)
GUISetState()

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd
EndFunc ;==>Example


Function GUICtrlSetData

Function Reference

GUICtrlSetData

Modifies the data for a control.

GUICtrlSetData ( controlID, data [, default] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
data | Combo, List, ListView, ListViewItem: An Opt("GUIDataSeparatorChar",...) separated list of items. Progress: The percentage. Slider: The value. Group, Label, Button, Checkbox, Radio, Combo, List, Input, Edit, TabItem, TreeViewItem: Replaces the text. Date : The date or time depending the style of the control. Dummy: The value.
default | [optional] Combo, List: The default value. Edit, Input: If non-empty (""), the string is inserted at the current insertion point (caret).

Return Value

Success: | Returns 1.
Failure: | Returns 0.
 | Returns -1 in case of invalid data

Remarks

For Combo or List control :
If the "data" corresponds to an already existing entry it is set as the default.
If the "data" starts with GUIDataSeparatorChar or is an empty string "" the previous list is destroyed.

For ListView, ListViewItem controls :
To update a specific column just forget about the others ie "||update" to update 3rd column.
If "update" is empty the column/subitem will be erased. For example "|" will erase the second column/subitem, "" will erase the first.

For Date, Monthcal controls :
The "data" date format is "yyyy/mm/dd".

Related

GUICtrlCreate..., GUICtrlUpdate..., GUICtrlRead, GUIDataSeparatorChar (Option)

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUICtrlCreateCombo("", 10, 10)

GUICtrlSetData(-1, "item1|item2|item3", "item3")

GUISetState() ; will display an empty dialog box with a combo control with focus on

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetDefBkColor

Function Reference

GUICtrlSetDefBkColor

Sets the default background color of all the controls of the GUI window.

GUICtrlSetDefBkColor ( defbkcolor [, winhandle] )

Parameters

defbkcolor | Default background color for all controls.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None

Related

GUICreate, GUICtrlSetDefColor, GUICtrlSetBkColor

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("test GUISetTextColor", 100,100) ; will create a dialog box that when displayed is centered

GUICtrlSetDefBkColor(0xFF0000) ; will change text color for all defined controls

GUICtrlCreateLabel("label", 10,5)

GUICtrlCreateRadio("radio", 10,25,50)
GUICtrlSetBkColor(-1, 0x0000FF) ; will change text color for specified control

GUICtrlCreateButton("button", 10,55)

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetDefColor

Function Reference

GUICtrlSetDefColor

Sets the default text color of all the controls of the GUI window.

GUICtrlSetDefColor ( deftextcolor [, winhandle] )

Parameters

deftextcolor | Default text color for all controls.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None

Related

GUICreate, GUICtrlSetDefBkColor, GUICtrlSetColor

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("test GUISetTextColor", 100,100) ; will create a dialog box that when displayed is centered

GUICtrlSetDefColor(0xFF0000) ; will change text color for all defined controls

GUICtrlCreateLabel("label", 10,5)

GUICtrlCreateRadio("radio", 10,25,50)
GUICtrlSetColor(-1, 0x0000FF) ; will change text color for specified control

GUICtrlCreateButton("button", 10,55)

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetFont

Function Reference

GUICtrlSetFont

Sets the font for a control.

GUICtrlSetFont (controlID, size [, weight [, attribute [, fontname[, quality]]]] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
size | Fontsize (default is 8.5).
weight | [optional] Font weight (default 400 = normal).
attribute | [optional] To define italic:2 underlined:4 strike:8 char format (add together the values of all the styles required, 2+4 = italic and underlined).
fontname | [optional] The name of the font to use.
quality | [optional] Font quality to select (default is PROOF_QUALITY=2).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

By default, controls use the font set by GUISetFont.

Size can contain a decimal as in 8.5.

For some controls such as labels, the default size can be 8.5 instead of 9 according to Windows Theme Values.

See the Appendix for a complete list of Windows fonts and the Windows versions under which they are supported.

For Quality parameter check MSDN, some windows XP installation need CLEARTYPE_QUALITY=5

Related

GUICtrlCreate..., GUISetFont

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $font, $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

$font = "Comic Sans MS"
GUICtrlCreateLabel("underlined label", 10, 20)
GUICtrlSetFont(-1, 9, 400, 4, $font) ; will display underlined characters

GUICtrlCreateLabel("italic label", 10, 40)
GUICtrlSetFont(-1, 9, 400, 2, $font) ; will display italic characters

GUISetFont(9, 400, 8, $font) ; will display strike characters
GUICtrlCreateLabel("strike label", 10, 60)

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetGraphic

Function Reference

GUICtrlSetGraphic

Modifies the data for a control.

GUICtrlSetGraphic ( controlID, type [, par1 [, ... par6]] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreateGraphic function.
type | type of drawing : dot, line, bezier, rect, ellipse, pie.
par1...par6 | See the Graphic Type table below.

Return Value

Success: | Returns 1.
Failure: | Returns 0.
 | Returns -1 in case of invalid data

Remarks

The point position (x,y) is relative to the GUICtrlCreateGraphic coordinates. It can be outside the graphic control but inside of the GUI window.

Graphic Type table
Type | Parameters | result
$GUI_GR_COLOR | Color [,BkColor] | Define the color of the next drawings. When BkColor is equal to $GUI_GR_NOBKCOLOR the drawing will not be filled. It is the default. For Color the default line color is black.
$GUI_GR_MOVE | x,y | Move the current position without drawing.
$GUI_GR_DOT | x,y | Draw a point(smallest square around the point), the next drawing will start from previous position.
$GUI_GR_PIXEL | x,y | Draw a pixel, the next drawing will start from previous position.
$GUI_GR_LINE | x,y | Draw a line.
$GUI_GR_BEZIER | x,y,x1,y1,x2,y2 | Draw a bezier curve with 2 control points.
$GUI_GR_RECT | x,y,w,h | Draw a rectangle. If w=h it will be a square.
$GUI_GR_ELLIPSE | x,y,w,h | Draw an ellipse. If w=h it will be a circle.
$GUI_GR_PIE | x,y,r,sa,wa | Draw a pie radius=r startangle=sa sweepangle=wa. Angles are in degrees.
$GUI_GR_CLOSE |  | to close the current drawing. It has to be added to $GUI_GR_LINE or $GUI_GR_BEZIER to close current drawing. Use alone will be ignored.
$GUI_GR_REFRESH |  | to force refresh after dynamic update of graphics.
$GUI_GR_HINT |  | to display control point and end point of bezier/line curve.
$GUI_GR_PENSIZE | n | set pensize for the next drawings. It has to be defined before $GUI_GR_COLOR to be taken in account.
$GUI_GR_NOBKCOLOR |  | is a dummy BkColor to force closed drawing not to be filled. Just line drawings.

Due to design constraints RECT, ELLIPSE and PIE graphics are drawn first. For example, a LINE will always be drawn over a RECT. If the drawing order is important to the look of the graphic, then it is recommended that multiple graphic controls be used instead of using a single control to do all the drawing.

Related

GUICtrlCreateGraphic

Example

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Global $MAXGr = 6, $del, $child
Global $a[$MAXGr + 1] ; 0 and $MAXGr entries not used to allow GUICtrlDelete result

Example()

Func Example()
Local $msg, $inc, $i, $del1

GUICreate("My Main", -1, -1, 100, 100)
$del1 = GUICtrlCreateButton("Delete", 50, 200, 50)
GUISetState()
CreateChild()

$i = 1
$inc = 1
;$i=5 ; uncomment to delete starting from last define Graphic control
;$inc=-1

Do
$msg = GUIGetMsg()
If $msg = $del1 Then $i = Del($inc)

If $msg = $del Then
GUICtrlDelete($a[$i])
$i = $i + $inc
If $i < 0 Or $i > $MAXGr Then Exit
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example

Func Del($iInc)
GUIDelete($child)
CreateChild()
If $iInc = -1 Then Return 5
Return 1
EndFunc ;==>Del

Func CreateChild()
$child = GUICreate("My Draw")
$del = GUICtrlCreateButton("Delete", 50, 165, 50)

$a[1] = GUICtrlCreateGraphic(20, 50, 100, 100)
GUICtrlSetBkColor(-1, 0xffffff)
GUICtrlSetColor(-1, 0)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 58, 50, 40, -60, 90)

GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 100, 100, 50, 80)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xc0c0ff)
GUICtrlSetGraphic(-1, $GUI_GR_RECT, 350, 200, 50, 80)
GUICtrlCreateLabel("label", 65, 100, 30)
GUICtrlSetColor(-1, 0xff)

$a[2] = GUICtrlCreateGraphic(220, 10, 100, 100)

GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff)
GUICtrlSetGraphic(-1, $GUI_GR_PIE, 58, 50, 40, -60, 90)

$a[3] = GUICtrlCreateGraphic(220, 110, 100, 100)
GUICtrlSetBkColor(-1, 0xf08080)
GUICtrlSetColor(-1, 0xff)
GUICtrlSetGraphic(-1, $GUI_GR_HINT, 1)

GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00)
GUICtrlSetGraphic(-1, $GUI_GR_RECT, 50, 50, 80, 80)

$a[4] = GUICtrlCreateGraphic(20, 200, 80, 80)
GUICtrlSetBkColor(-1, 0xffffff)
GUICtrlSetGraphic(-1, $GUI_GR_HINT, 1)

GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 10, 10)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 30, 40)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 70, 70)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 10, 50)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xffff00)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 10, 10)

$a[5] = GUICtrlCreateGraphic(150, 10, 50, 50)
GUICtrlSetBkColor(-1, 0xa0ffa0)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 20, 20) ; start point
; it is better to draw line and after point
; to avoid to switch color at each drawing
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000ff)
GUICtrlSetGraphic(-1, $GUI_GR_DOT, 30, 30)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 20, 40)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000)
GUICtrlSetGraphic(-1, $GUI_GR_DOT, 25, 25)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 40, 40)
GUICtrlSetGraphic(-1, $GUI_GR_DOT, 30, 40)

$a[6] = GUICtrlCreateGraphic(110, 260, 230, 130)
GUICtrlSetColor(-1, 0) ; to display a black border line
GUICtrlSetBkColor(-1, 0xc0c0ff)
GUICtrlSetGraphic(-1, $GUI_GR_HINT, 3) ; to display control lines and end points

GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff); fill in blue
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 120, 20) ; start point
GUICtrlSetGraphic(-1, $GUI_GR_BEZIER, 120, 100, 200, 20, 200, 100)
GUICtrlSetGraphic(-1, $GUI_GR_BEZIER + $GUI_GR_CLOSE, 100, 40, 40, 100, 40, 20)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 60, 30) ; start point

GUISetState()
EndFunc ;==>CreateChild


Function GUICtrlSetImage

Function Reference

GUICtrlSetImage

Sets the bitmap or icon image to use for a control.

GUICtrlSetImage ( controlID, filename [, iconname [, icontype]] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
filename | The filename containing the picture to be display on the control.
iconname | [optional] Icon name if the file contain multiple icon. Can be an ordinal name if negative number. Otherwise -1.
icontype | [optional] To select a specific icon size : 0 = small, 1 = normal (default). for a TreeViewItem the icon size : 2 = selected, 4 for non-selected item.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Use a resource hacker to know the value of the valid icon name in a file.

If used on a Button control the image will be displayed on the button. Images can also be set for Checkbox controls as long as the $BS_PUSHLIKE style is used. In both case the $BS_ICON or $BS_BITMAP styles are needed to select the type of the picture used. The first icon resolution will be used in a multi icon resolution file. I.E. if a 128x128 is the first resolution and the control is 64x64 the image will be truncated.

!!! If use this command on a TreeViewItem the first time, then all other items will use this icon/image automatically by default !!!
If you use GUICtrlSetImage on a TreeView or ListView then all items of it will change to this icon/image.

Passing a positive number will reference the string equivalent icon name.
Passing a negative number causes 1-based "index" behaviour. Some Dll can have icon extracted just with negative numbers.

Related

GUICtrlCreatePic, GUICtrlCreateIcon, GUICtrlCreateButton, GUICtrlCreateCheckbox

Example

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON)
GUICtrlSetImage(-1, "shell32.dll", 22)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetLimit

Function Reference

GUICtrlSetLimit

Limits the number of characters/pixels for a control.

GUICtrlSetLimit ( controlID, max [, min] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
max | For List controls it is the extent you can scroll horizontally in pixels. For Input/Edit controls it is the max number of characters that can be entered.
min | [optional] For Slider and UpDown controls you can specify a min value. Default = 0

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

GUICtrlCreateList, GUICtrlCreateInput, GUICtrlCreateEdit, GUICtrlCreateSlider, GUICtrlCreateUpdown

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI limit input 3 chars") ; will create a dialog box that when displayed is centered

GUICtrlCreateInput("", 10, 20)
GUICtrlSetLimit(-1, 3) ; to limit the entry to 3 chars

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetOnEvent

Function Reference

GUICtrlSetOnEvent

Defines a user-defined function to be called when a control is clicked.

GUICtrlSetOnEvent ( controlID, "function" )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
function | The name of the user function to call.

Return Value

Success: | Returns 1.
Failure: | Returns 0,

Remarks

OnEvent functions are only called when the option GUIOnEventMode is set to 1 - when in this mode GUIGetMsg is NOT used at all.

Within the called user function the control identifier can be retrieved with @GUI_CTRLID.
If needed the windows handle and the control handle can be retrieved with @GUI_WINHANDLE or @GUI_CTRLHANDLE.

If the function is an empty string "" the previous user-defined is disabled.

Related

GUICtrlCreate..., GUIGetMsg, GUIOnEventMode (Option), GUISetOnEvent, GUICtrlCreateDummy, GUICtrlSendToDummy

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $parent1, $ok1, $cancel1

Opt("GUICoordMode", 2)
Opt("GUIResizeMode", 1)
Opt("GUIOnEventMode", 1)

$parent1 = GUICreate("Parent1")
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")

$ok1 = GUICtrlCreateButton("OK", 10, 30, 50)
GUICtrlSetOnEvent(-1, "OKPressed")

$cancel1 = GUICtrlCreateButton("Cancel", 0, -1)
GUICtrlSetOnEvent(-1, "CancelPressed")

GUISetState(@SW_SHOW)

; Just idle around
While 1
Sleep(10)
WEnd

EndFunc ;==>Example

Func OKPressed()
MsgBox(0, "OK Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle)
EndFunc ;==>OKPressed

Func CancelPressed()
MsgBox(0, "Cancel Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle)
EndFunc ;==>CancelPressed

Func SpecialEvents()
Select
Case @GUI_CtrlId = $GUI_EVENT_CLOSE
MsgBox(0, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)
Exit

Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE
MsgBox(0, "Window Minimized", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

Case @GUI_CtrlId = $GUI_EVENT_RESTORE
MsgBox(0, "Window Restored", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

EndSelect
EndFunc ;==>SpecialEvents


Function GUICtrlSetPos

Function Reference

GUICtrlSetPos

Changes the position of a control within the GUI window.

GUICtrlSetPos ( controlID, left, top [, width [, height]] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
left | The left side of the control.
top | The top of the control.
width | [optional] The width of the control.
height | [optional] The height of the control .

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

GUICtrlCreate...

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $right, $label, $button, $msg

GUICreate("My GUI position") ; will create a dialog box that when displayed is centered

$right = 0
$label = GUICtrlCreateLabel("my moving label", 10, 20)

$button = GUICtrlCreateButton("Click to close", 50, 50)
GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button

GUISetState()

While 1
$msg = GUIGetMsg()

If $msg = $button Or $msg = $GUI_EVENT_CLOSE Then Exit
If $right = 0 Then
$right = 1
GUICtrlSetPos($label, 20, 20)
Else
$right = 0
GUICtrlSetPos($label, 10, 20)
EndIf
Sleep(100)
WEnd
EndFunc ;==>Example


Function GUICtrlSetResizing

Function Reference

GUICtrlSetResizing

Defines the resizing method used by a control.

GUICtrlSetResizing ( controlID, resizing )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
resizing | See the Docking Values table below for values that can be used (add together multiple values if required).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

When a GUI window is resized the controls within react - how they react is determined by this function. To be able to resize a GUI window it needs to have been created with the $WS_SIZEBOX and $WS_SYSMENU styles. See GUICreate.

Docking Values Table
Resizing | Value | No displacement of
$GUI_DOCKAUTO | 1 | resize and reposition according to new window size
$GUI_DOCKLEFT | 2 | Left side
$GUI_DOCKRIGHT | 4 | Right side
$GUI_DOCKHCENTER | 8 | Position will not move relative to horizontal center
$GUI_DOCKTOP | 32 | Top side
$GUI_DOCKBOTTOM | 64 | Bottom side
$GUI_DOCKVCENTER | 128 | Position will not move relative to vertical center
$GUI_DOCKWIDTH | 256 | Width will not change
$GUI_DOCKHEIGHT | 512 | Height will not change
 |  | Composite resizing
$GUI_DOCKSIZE | 768 | (256+512) Size will not change
$GUI_DOCKMENUBAR | 544 | (512+32) so the control will stay at the top of window with no change in Height
$GUI_DOCKSTATEBAR | 576 | (512+64) so the control stay at the bottom of the window with no change in Height
$GUI_DOCKALL | 802 | (2+32+256+512) so the control will not move during resizing
$GUI_DOCKBORDERS | 102 | (2+4+32+64) so the control will grow as the window

The default resizing for a given control is control dependent see the control doc.
A default value for any control can be set with GUIResizeMode (Option).

The automatic resizing event can be disabled if GUIEventOptions (Option) is set to 1.

Related

GUIResizeMode (Option), GUIEventOptions (Option), GUICtrlCreate...

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $nEdit, $nOk, $nCancel, $msg

Opt("GUICoordMode", 2)
GUICreate("My InputBox", 190, 114, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; start the definition
GUISetIcon("Eiffel Tower.ico")

GUISetFont(8, -1, "Arial")

GUICtrlCreateLabel("Prompt", 8, 7) ; add prompt info
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP)

$nEdit = GUICtrlCreateInput("Default", -1, 3, 175, 20, $ES_PASSWORD) ; add the input area
GUICtrlSetState($nEdit, $GUI_FOCUS)
GUICtrlSetResizing($nEdit, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)

$nOk = GUICtrlCreateButton("OK", -1, 3, 75, 24) ; add the button that will close the GUI
GUICtrlSetResizing($nOk, $GUI_DOCKBOTTOM + $GUI_DOCKSIZE + $GUI_DOCKHCENTER)

$nCancel = GUICtrlCreateButton("Annuler", 25, -1) ; add the button that will close the GUI
GUICtrlSetResizing($nCancel, $GUI_DOCKBOTTOM + $GUI_DOCKSIZE + $GUI_DOCKHCENTER)

GUISetState() ; to display the GUI

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetState

Function Reference

GUICtrlSetState

Changes the state of a control.

GUICtrlSetState ( controlID, state )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
state | See the State table below.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

State table
State | Comments
No Change | 0
$GUI_UNCHECKED | Radio, Checkbox or ListViewItem will be unchecked.
$GUI_CHECKED | Radio, Checkbox or ListViewItem will be checked.
$GUI_INDETERMINATE | Checkbox having the tristate attribute will be greyed.
$GUI_AVISTART | Avi control will start playing.
$GUI_AVISTOP | Avi control will stop playing.
$GUI_AVICLOSE | Avi control will stop playing and release resource.
$GUI_DROPACCEPTED | Control will accept drop action : from file or from a drag of another control. See remarks.
$GUI_NODROPACCEPTED | Control will not accept drop action.
$GUI_SHOW | Control will be visible. On Tabitem control will select the first tab to be displayed.
$GUI_HIDE | Control will not be visible.
$GUI_ENABLE | Control will be enabled.
$GUI_DISABLE | Control will be greyed out.
$GUI_FOCUS | Control will be given input/selected focus.
$GUI_NOFOCUS | Listview control will loose focus.
$GUI_DEFBUTTON | Control will be set as the default button on the window. See remark about TreeviewItems.
$GUI_EXPAND | TreeViewItem will expand it's child items.
$GUI_ONTOP | Control will be have the ontop attribute for the window (zOrdering).

State values can be summed up as for example $GUI_DISABLE + $GUI_HIDE sets the control in an disabled and hidden state.

If an AVI control has to be hidden with $GUI_HIDE it should be closed with $GUI_AVICLOSE.

State of a "contextmenu" control cannot be changed.
State of a "listviewitem" control can be changed if the associated "listview" control has been created with an extended style $LVS_EX_CHECKBOXES. $GUI_FOCUS and $GUI_NOFOCUS can be used on specific listviewitem provided listview control style allows to display it : $LVS_SHOWSELALWAYS.
State of a "menu or a ""menuitem" control cannot be hidden.

! Important information for $GUI_EXPAND: this state is only used for TreeViewItems. If you want to use this 'action' then at least 1 Sub-TreeViewItem has to exist/created under this item !
If you want to select another item in a TreeView then you can use $GUI_FOCUS - the parent TreeView gets the window focus and the specified item is marked as selected.
If you want to set a treeview item as a default item which means painting it bold you can use $GUI_DEFBUTTON - to turn it off just use another value but $GUI_DEFBUTTON, for instance 0. This state will not be returned by GUICtrlGetState.

If $GUI_DROPACCEPTED is set to a visible control a drag&drop can be taken in account. The edit/input control will be set with the filename.
For other controls on reception of $GUI_EVENT_DROPPED, @GUI_DRAGID will return the controlID from where the drag start (-1 if from a file, @GUI_DRAGFILE contain the filename being dropped) and @GUI_DROPID returns the controlID of the dropped control.
Only dragging a ListviewItem will start the drag & drop process. The @GUI_DRAGID will be the ListView controlID.

Related

GUICtrlCreate..., GUICtrlGetState

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI state") ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("my disable label", 10, 20)
GUICtrlSetState(-1, $GUI_DISABLE) ; the label is in disable state

GUICtrlCreateButton("my button", 50, 50)
GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetStyle

Function Reference

GUICtrlSetStyle

Changes the style of a control.

GUICtrlSetStyle ( controlID, style [, exStyle] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
style | Defines the style of the control. See GUI Control Styles Appendix.
exStyle | [optional] Defines the extended Style of the control. See Extended Style Table.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Some styles cannot be changed dynamically, check MSDN documentation. $CBS_UPPERCASE combo style is one example.

Related

GUICtrlCreate...

Example

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI style") ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("my label which will split on several lines", 10, 20, 100, 100)
GUICtrlSetStyle(-1, $SS_RIGHT)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUICtrlSetTip

Function Reference

GUICtrlSetTip

Sets the tip text associated with a control.

GUICtrlSetTip ( controlID, tiptext [, "title" [, icon [, options]]]]] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
tiptext | Tip text that will be displayed when the mouse is hovered over the control.
title | [optional] The title for the tooltip Requires IE5+
icon | [optional] Pre-defined icon to show next to the title: Requires IE5+. Requires a title. 0 = No icon, 1 = Info icon, 2 = Warning icon, 3 = Error Icon
options | [optional] Sets different options for how the tooltip will be displayed (Can be added together): 1 = Display as Balloon Tip Requires IE5+ 2 = Center the tip horizontally along the control.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

This tip text is displayed in a tooltip rectangular area.
To skip an optional parameter, leaving it's default value intact, use the Default keyword..
You may use @CR or @LF to create multi-line tooltips.
The title, icon and Balloon Tip option all require Internet Explorer 5.0 or later in order to function.
To display an icon, you must specify a non-empty title. The icon appears on the same row as the title and thus requires a title to be present.

Related

GUICtrlUpdate...

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI control tip") ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("my label", 10, 20)
GUICtrlSetTip(-1, "tip of my label")

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Functions

GUI set parameters functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

See Gui Constants include files if you need to use the related controls Constants .

Function | Description
GUISetAccelerators | Sets the accelerator table to be used in a GUI window.
GUISetBkColor | Sets the background color of the GUI window.
GUISetCoord | Sets absolute coordinates for the next control.
GUISetCursor | Sets the mouse cursor icon for a GUI window.
GUISetFont | Sets the default font for a GUI window.
GUISetHelp | Sets an executable file that will be run when F1 is pressed.
GUISetIcon | Sets the icon used in a GUI window.
GUISetOnEvent | Defines a user function to be called when a system button is clicked.
GUISetState | Changes the state of a GUI window.
GUISetStyle | Changes the styles of a GUI window.


Function GUISetAccelerators

Function Reference

GUISetAccelerators

Sets the accelerator table to be used in a GUI window.

GUISetAccelerators ( accelerators [, winhandle] )

Parameters

accelerators | A 2 dimensional array holding the accelerator table (See remarks).
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

The array passed to this function contains the hotkey and the control ID of the accelerator. The array must be defined as Dim $array[n][2] - where n is the number of accelerator keys to set:

$array[0][0] = Hotkey (in HotKeySet() format) of 1st accelerator
$array[0][1] = Control ID of the 1st accelerator, as returned by GUICtrlCreate...()
$array[1][0] = Hotkey of 2nd accelerator
$array[1][1] = Control ID of the 2nd accelerator
...
$array[n][0] = Hotkey of nth accelerator
$array[n][1] = Control ID of the nth accelerator

Passing this function a non-array will unset all accelerators for the given winhandle.

Related

GUICreate, HotKeySet

Example

; A simple custom messagebox that uses the MessageLoop mode

#include <GUIConstantsEx.au3>

GUICreate("Custom Msgbox", 210, 80)

GUICtrlCreateLabel("Please click a button!", 10, 10)
$YesID = GUICtrlCreateButton("Yes", 10, 50, 50, 20)
$NoID = GUICtrlCreateButton("No", 80, 50, 50, 20)
$ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)

; Set accelerators for Ctrl+y and Ctrl+n
Dim $AccelKeys[2][2]=[["^y", $YesID], ["^n", $NoID]]
GUISetAccelerators($AccelKeys)

GUISetState() ; display the GUI

Do
$msg = GUIGetMsg()

Select
Case $msg = $YesID
MsgBox(0, "You clicked on", "Yes")
Case $msg = $NoID
MsgBox(0, "You clicked on", "No")
Case $msg = $ExitID
MsgBox(0, "You clicked on", "Exit")
Case $msg = $GUI_EVENT_CLOSE
MsgBox(0, "You clicked on", "Close")
EndSelect
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID


Function GUISetBkColor

Function Reference

GUISetBkColor

Sets the background color of the GUI window.

GUISetBkColor ( background [, winhandle] )

Parameters

background | Background color of the dialog box.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None

Related

GUICreate

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUISetBkColor(0xE0FFFF) ; will change background color

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUISetCoord

Function Reference

GUISetCoord

Sets absolute coordinates for the next control.

GUISetCoord ( left, top [, width [, height [, winhandle]]] )

Parameters

left | The left side of the control.
top | The top of the control.
width | [optional] The width of the control (default is the previously used width).
height | [optional] The height of the control (default is the previously used height).
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

To be used specifically in Opt ("GUICoordMode", 2). It allows you to set the current position to a precise point and from that position to create controls by row (x_offset,-1) or by columns (-1, y_offset).

Related

GUICtrlCreate...

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

Opt("GUICoordMode", 2) ; relative to cell mode

GUICreate("My GUI Set Coord", 200, 100)
GUICtrlCreateCheckbox("Check #1", 20, 10, 75)
GUICtrlCreateCheckbox("Notify #2", 10, -1) ; next cell in the line

GUISetCoord(20, 60)

GUICtrlCreateButton("OK #3", -1, -1)
GUICtrlCreateButton("Cancel #4", 10, -1)
GUICtrlSetState(-1, $GUI_FOCUS)

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUISetCursor

Function Reference

GUISetCursor

Sets the mouse cursor icon for a GUI window.

GUISetCursor ( [cursorID [, override [, winhandle]]] )

Parameters

cursorID | [optional] Cursor Id (See Remarks).
override | [optional] Force the requested mouse cursor even when over controls (see below). 0 = (default) Don't override a control's default mouse cursor. 1= override control's default mouse cursor.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used Window).

Return Value

None.

Remarks

If the cursorID is invalid the standard arrow will be displayed.

Usually when you move the mouse cursor over an edit control or other control the mouse cursor changes shape. The "override" option allows you to force the requested mouse cursor to be shown at all times. Note: If you have changed a controls mouse cursor with GUICtrlSetCursor then this control mouse cursor will always be shown.

For a list of valid cursor IDs see MouseGetCursor.
CursorId = 16 will hide the mouse cursor.

Related

GUICtrlSetCursor

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Global $IDC = -1, $newIDC = 0

Example()

Func Example()

HotKeySet("{Esc}", "Increment")

GUICreate("Press Esc to Increment", 400, 400, 0, 0, 0x04CF0000, 0x00000110)

GUISetState()

While GUIGetMsg() <> $GUI_EVENT_CLOSE
If $newIDC <> $IDC Then
$IDC = $newIDC
GUISetCursor($IDC)
EndIf
ToolTip("GUI Cursor #" & $IDC)
WEnd
EndFunc ;==>Example

Func Increment()
$newIDC = $IDC + 1
If $newIDC > 15 Then $newIDC = 0
EndFunc ;==>Increment


Function GUISetFont

Function Reference

GUISetFont

Sets the default font for a GUI window.

GUISetFont (size [, weight [, attribute [, fontname [, winhandle[, quality]]]]] )

Parameters

size | Fontsize (default is 8.5).
weight | [optional] Font weight (default 400 = normal).
attribute | [optional] To define italic:2 underlined:4 strike:8 char format (add together the values of all the styles required, 2+4 = italic and underlined).
fontname | [optional] Font to use. (OS default GUI font is used if the font is "" or is not found).
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).
quality | [optional] Font quality to select (default is PROOF_QUALITY=2).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

See the Appendix for a complete list of Windows fonts and Windows versions under which they are supported.

Size can contain a decimal as in 8.5.

For some control as label ones the default can be 8.5 instead of 9 according to Windows Theme Values.

For Quality parameter check MSDN, some windows XP installation need CLEARTYPE_QUALITY=5

Related

GUICtrlSetFont

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $font, $msg

GUICreate("My GUI default font") ; will create a dialog box that when displayed is centered

$font = "Comic Sans MS"
GUISetFont(9, 400, 4, $font) ; will display underlined characters
GUICtrlCreateLabel("underlined label", 10, 20)

GUISetFont(9, 400, 2, $font) ; will display underlined characters
GUICtrlCreateLabel("italic label", 10, 40)

GUISetFont(9, 400, 8, $font) ; will display underlined characters
GUICtrlCreateLabel("strike label", 10, 60)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUISetHelp

Function Reference

GUISetHelp

Sets an executable file that will be run when F1 is pressed.

GUISetHelp ( helpfile [, winhandle] )

Parameters

helpfile | file that will be run if F1 is pressed when the GUI is active.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

GUICreate

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUISetHelp("notepad") ; will run notepad if F1 is typed

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUISetIcon

Function Reference

GUISetIcon

Sets the icon used in a GUI window.

GUISetIcon ( iconfile [, iconID [, winhandle]] )

Parameters

iconfile | used to display the icon in the title area.
iconID | [optional] The ID of the icon in the iconfile. (Default is -1).
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Passing a positive number will reference the string equivalent icon name.
Passing a negative number causes 1-based "index" behaviour. Some Dll can have icon extracted

just with negative numbers.

Related

GUICreate

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $sFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & "\icons\filetype1.ico"
Local $msg

GUICreate("My GUI new icon") ; will create a dialog box that when displayed is centered

GUISetIcon($sFile) ; will change icon

GUISetState(); will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUISetOnEvent

Function Reference

GUISetOnEvent

Defines a user function to be called when a system button is clicked.

GUISetOnEvent ( specialID, "function" [, winhandle] )

Parameters

specialID | See the Special ID table below.
function | The name of the user function to call.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

OnEvent functions are only called when the option GUIOnEventMode is set to 1 - when in this mode GUIGetMsg is NOT used at all.

If the option GUIEventOptions is set to 1 the minimize, restore and maximize button will not do any action on the window just a simple notification.

If the function is an empty string "" the previous user-defined is disabled.

Special ID table
Special Id | Comments
$GUI_EVENT_CLOSE | dialog box being closed (either by defined button or system menu).
$GUI_EVENT_MINIMIZE | dialog box minimized with Windows title bar button.
$GUI_EVENT_RESTORE | dialog box restored by click on task bar icon.
$GUI_EVENT_MAXIMIZE | dialog box maximized with Windows title bar button.
$GUI_EVENT_MOUSEMOVE | the mouse cursor has moved.
$GUI_EVENT_PRIMARYDOWN | the primary mouse button was pressed.
$GUI_EVENT_PRIMARYUP | the primary mouse button was released.
$GUI_EVENT_SECONDARYDOWN | the secondary mouse button was pressed.
$GUI_EVENT_SECONDARYUP | the secondary mouse button was released.
$GUI_EVENT_RESIZED | dialog box has been resized.
$GUI_EVENT_DROPPED | End of a Drag&Drop action @GUI_DRAGID, @GUI_DRAGFILE and @GUI_DROPID will be used to retrieve the ID's/file corresponding to the involve control.

Related

GUIOnEventMode (Option), GUIEventOptions (Option), GUICtrlSetOnEvent

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $parent1, $ok1, $cancel1

Opt("GUICoordMode", 2)
Opt("GUIResizeMode", 1)
Opt("GUIOnEventMode", 1)

$parent1 = GUICreate("Parent1")
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")

$ok1 = GUICtrlCreateButton("OK", 10, 30, 50)
GUICtrlSetOnEvent(-1, "OKPressed")

$cancel1 = GUICtrlCreateButton("Cancel", 0, -1)
GUICtrlSetOnEvent(-1, "CancelPressed")

GUISetState(@SW_SHOW)

; Just idle around
While 1
Sleep(10)
WEnd
EndFunc ;==>Example

Func OKPressed()
MsgBox(0, "OK Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle)
EndFunc ;==>OKPressed

Func CancelPressed()
MsgBox(0, "Cancel Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle)
EndFunc ;==>CancelPressed

Func SpecialEvents()

Select
Case @GUI_CtrlId = $GUI_EVENT_CLOSE
MsgBox(0, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)
Exit

Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE
MsgBox(0, "Window Minimized", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

Case @GUI_CtrlId = $GUI_EVENT_RESTORE
MsgBox(0, "Window Restored", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

EndSelect

EndFunc ;==>SpecialEvents


Function GUISetState

Function Reference

GUISetState

Changes the state of a GUI window.

GUISetState ( [flag [, winhandle]] )

Parameters

flag | [optional] @SW_SHOW = Shows a previously hidden window (default) @SW_HIDE = Hide window @SW_MINIMIZE = Minimize window @SW_MAXIMIZE = Maximize window @SW_RESTORE = Undoes a window minimization @SW_DISABLE = Disables the window @SW_ENABLE = Enables the window @SW_LOCK = Lock the window to avoid repainting. @SW_UNLOCK = Unlock windows to allow painting.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

When windows are created they are initially hidden so you must use this function to display them (@SW_SHOW).

Only one window can be locked with @SW_LOCK. Any other @SW_LOCK will lock the requested window.
@SW_UNLOCK just ignored the "winhandle" to unlock any locked window.

Related

GUICreate

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI") ; start the definition

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example


Function GUISetStyle

Function Reference

GUISetStyle

Changes the styles of a GUI window.

GUISetStyle ( Style [,ExStyle [, winhandle]] )

Parameters

style | defines the style of the window. See GUI Control Styles Appendix. Use -1 to leave it unchanged.
exStyle | [optional] defines the extended style of the window. See the Extended Style Table below. -1 is the default. Use -1 to leave it unchanged.
winhandle | [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

No checking is done on style value, neither non interaction with already defined control. It is the designer responsability to take care of this compatibility.

Related

GUIGetStyle

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $NewStyle = False, $hWnd, $Style, $Msg

$hWnd = GUICreate("Gui Style", 260, 100)
$Style = GUICtrlCreateButton("Set Style", 45, 50, 150, 20)
GUISetState()

While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Style
If Not $NewStyle Then
GUISetStyle(BitOR($WS_POPUPWINDOW, $WS_THICKFRAME), BitOR($WS_EX_CLIENTEDGE, $WS_EX_TOOLWINDOW))
GUICtrlSetData($Style, 'Undo Style')
$NewStyle = True
Else
GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU), 0)
GUICtrlSetData($Style, 'Set Style')
$NewStyle = False
EndIf
Case Else
EndSwitch
WEnd
EndFunc ;==>Example


Function GUIDelete

Function Reference

GUIDelete

Deletes a GUI window and all controls that it contains.

GUIDelete ( [winhandle] )

Parameters

winhandle [optional] Windows handle as returned by GUICreate (default is the previous used).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

GUICreate, GUISwitch

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $msg

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

GUIDelete(); ; will return 1
EndFunc ;==>Example


Function GUICtrlGetHandle

Function Reference

GUICtrlGetHandle

Returns the handle for a control and some special (item) handles (Menu, ContextMenu, TreeViewItem).

GUICtrlGetHandle ( controlID )

Parameters

controlID Control identifier as returned by GUICtrlCreate...

Return Value

Success: | Returns the handle of the given control ID.
Failure: | Returns 0.

Remarks

! These controls are not supported: Dummy, Graphic, Object, ListViewItem and TabItem !

ListViewItems and TabItems are managed through indexes.
To get the index of these items use DllCall() and DllStructCreate().

Related

IsHWnd

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $hGui, $FileMenu, $OpenItem, $SaveItem, $OptionsMenu
Local $ViewItem, $ToolsItem, $ExitItem, $HelpMenu, $AboutItem
Local $EndBtn, $Msg

$hGui = GUICreate("My GUI", 300, 200)

$FileMenu = GUICtrlCreateMenu("&File")
$OpenItem = GUICtrlCreateMenuItem("&Open", $FileMenu)
$SaveItem = GUICtrlCreateMenuItem("&Save", $FileMenu)
GUICtrlCreateMenuItem("", $FileMenu)

$OptionsMenu = GUICtrlCreateMenu("O&ptions", $FileMenu)
$ViewItem = GUICtrlCreateMenuItem("View", $OptionsMenu)
GUICtrlCreateMenuItem("", $OptionsMenu)
$ToolsItem = GUICtrlCreateMenuItem("Tools", $OptionsMenu)

GUICtrlCreateMenuItem("", $FileMenu)
$ExitItem = GUICtrlCreateMenuItem("&Exit", $FileMenu)

$HelpMenu = GUICtrlCreateMenu("&?")
$AboutItem = GUICtrlCreateMenuItem("&About", $HelpMenu)

$EndBtn = GUICtrlCreateButton("End", 110, 140, 70, 20)

SetMenuColor($FileMenu, 0xEEBB99) ; BGR color value
SetMenuColor($OptionsMenu, 0x66BB99); BGR color value
SetMenuColor($HelpMenu, 0x99BBEE) ; BGR color value

GUISetState()

While 1
$Msg = GUIGetMsg()

Switch $Msg
Case $ExitItem, $EndBtn, $GUI_EVENT_CLOSE
ExitLoop

Case $AboutItem
MsgBox(64, "About...", "Colored menu sample")
EndSwitch
WEnd
EndFunc ;==>Example

; Apply the color to the menu
Func SetMenuColor($nMenuID, $nColor)
Local $hMenu, $hBrush, $stMenuInfo
Local Const $MIM_APPLYTOSUBMENUS = 0x80000000
Local Const $MIM_BACKGROUND = 0x00000002

$hMenu = GUICtrlGetHandle($nMenuID)

$hBrush = DllCall("gdi32.dll", "hwnd", "CreateSolidBrush", "int", $nColor)
$hBrush = $hBrush[0]

$stMenuInfo = DllStructCreate("dword;dword;dword;uint;dword;dword;ptr")
DllStructSetData($stMenuInfo, 1, DllStructGetSize($stMenuInfo))
DllStructSetData($stMenuInfo, 2, BitOR($MIM_APPLYTOSUBMENUS, $MIM_BACKGROUND))
DllStructSetData($stMenuInfo, 5, $hBrush)

DllCall("user32.dll", "int", "SetMenuInfo", "hwnd", $hMenu, "ptr", DllStructGetPtr($stMenuInfo))

; release Struct not really needed as it is a local
$stMenuInfo = 0
EndFunc ;==>SetMenuColor


Function GUICtrlGetState

Function Reference

GUICtrlGetState

Gets the current state of a control

GUICtrlGetState ( [controlID] )

Parameters

controlID [optional] The control identifier (controlID) as returned by a GUICtrlCreate... function.

Return Value

Success: | Returns the state. See GUICtrlSetState for values.
Failure: | Returns -1 if control is not defined.

Remarks

As opposed to GUICtrlRead this function returns ONLY the state of a control enabled/disabled/hidden/show/dropaccepted

Exceptions:
For ListView controls it returns the number of the clicked column.

Related

GUICtrlRead, GUICtrlSetState

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $n, $msg

GUICreate("My GUI (GetControlState)")
$n = GUICtrlCreateCheckbox("checkbox", 10, 10)
GUICtrlSetState(-1, 1) ; checked

GUISetState() ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

MsgBox(0, "state", StringFormat("GUICtrlRead=%d\nGUICtrlGetState=%d", GUICtrlRead($n), GUICtrlGetState($n)))
EndFunc ;==>Example


Function GUICtrlRead

Function Reference

GUICtrlRead

Read state or data of a control.

GUICtrlRead ( controlID [, advanced] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
advanced | [optional] returns extended information of a control. 0 = (Default) Returns a value with state or data of a control. 1 = Returns extended information of a control (see Remarks).

Return Value

Success: | Returns depending the control (see below).
Failure: | Returns 0.
Type | Value
Checkbox, Radio | state of the button. See State table
Combo, List | The value selected
Input, Edit | The text entered
Button | The display text
Date | The selected date
Progress | Current percentage
Slider | Current value
Tab | The number or the controlID of the tabitem selected depending of the advanced parameter value.
Menu, MenuItem | State of the menu/item. See State table
TreeView | Control identifier (controlID) of the selected TreeViewItem
TreeViewItem | State of the TreeViewItem
ListView | Control identifier (controlID) of the selected ListViewItem. 0 means no item is selected
Dummy | The value set by GUICtrlSendToDummy or GUICtrlSetData

Remarks

In 'advanced' mode the return value contains additional data of the control (see below).

Note: not for all known controls there is additional data available!

Type | Additional Value
Checkbox, Radio | The text of the control.
Menu, MenuItem | The text of the control.
TreeView | The text of the current selected TreeViewItem.
TreeViewItem | The text of the TreeViewItem.
ListViewItem | The state of the ListViewItem if $LVS_EX_CHECKBOXES exStyle used in advanced mode. See State table
Tab | The controlID of the tabitem selected

For Checkbox, Radio control several states can be returned as $GUI_FOCUS and $GUI_CHECKED,. So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the control is checked.

For Listview items several states can be returned as $GUI_CHECKED and $GUI_UNCHECKED (only for listview controls with LVS_EX_CHECKBOXES-exstyle and on 'advanced' return) . So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the item is checked.

For Treeview items several states can be returned as $GUI_FOCUS, $GUI_EXPAND and $GUI_CHECKED, $GUI_UNCHECKED (only for treeview controls with TVS_CHECKBOXES-style . So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the item is checked.

Related

GUICtrlUpdate..., GUIGetMsg, GUICtrlSetData, GUIEventOptions (Option), GUICtrlCreate..., GUICtrlGetState, GUICtrlSendToDummy, GUICtrlSendMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $menu1, $n1, $n2, $msg, $menustate, $menutext

GUICreate("My GUICtrlRead") ; will create a dialog box that when displayed is centered

$menu1 = GUICtrlCreateMenu("File")

$n1 = GUICtrlCreateList("", 10, 10, -1, 100)
GUICtrlSetData(-1, "item1|item2|item3", "item2")

$n2 = GUICtrlCreateButton("Read", 10, 110, 50)
GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button

GUISetState() ; will display an empty dialog box
; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
If $msg = $n2 Then
MsgBox(0, "Selected listbox entry", GUICtrlRead($n1)) ; display the selected listbox entry
$menustate = GUICtrlRead($menu1) ; return the state of the menu item
$menutext = GUICtrlRead($menu1, 1) ; return the text of the menu item
MsgBox(0, "State and text of the menuitem", "state:" & $menustate & @LF & "text:" & $menutext)
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example


Function GUICtrlRecvMsg

Function Reference

GUICtrlRecvMsg

Send a message to a control and retrieve information in lParam.

GUICtrlRecvMsg ( controlID , msg [, wParam [, lParamType]] )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
msg | type of message to be send to the control as defined in the Windows controls documentation.
wParam | [optional] An integer first param to be send to the control.
lParamType | [optional] Define the type of lParam that will be returned: 0 (default) for wParam and lParam, 1 for lParam String, 2 for lParam RECT struct.

Return Value

Success: | Returns the value returned by the SendMessage Windows API.
Failure: | Returns 0.

Remarks

This function allows the sending of special Windows messages directly to the control using the SendMessage API. It is used to enable special control features not available with the simple GUICtrlRead() and GUICtrlUpdate...() range of functions.

If the wParam and lParamType parameters are not specified then an array of two elements is returned (LPwParam, LPlParam).

The RECT is returned in an array of 4 elements (Left, Top, Right, Bottom).

Related

GUICtrlSendMsg, GUICtrlUpdate...

Example

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

$nEdit = GUICtrlCreateEdit ("line 0", 10,10)
GUICtrlCreateButton ("Ok", 20,200,50)

GUISetState ()

For $n=1 To 5
GUICtrlSetData ($nEdit, @CRLF & "line "& $n)
Next

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
If $msg >0 Then
$a=GUICtrlRecvMsg($nEdit, $EM_GETSEL)
GUICtrlSetState($nEdit,$GUI_FOCUS) ; set focus back on edit control

; will display the wParam and lParam values return by the control
MsgBox(0,"Current selection",StringFormat("start=%d end=%d", $a[0], $a[1]))
EndIf
Until $msg = $GUI_EVENT_CLOSE


Function GUICtrlSendMsg

Function Reference

GUICtrlSendMsg

Send a message to a control.

GUICtrlSendMsg ( controlID, msg , wParam, lParam )

Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function.
msg | type of message to be send to the control as defined in the Windows control documentation.
wParam | The first param to send to the control.
lParam | The second param to send to the control.

Return Value

Success: | Returns the value returned by the SendMessage Windows API.
Failure: | Returns 0.

Remarks

This function allows the sending of special Windows messages directly to the control using the SendMessage API. It is used to enable special control features not available with the simple GUICtrlRead() and GUICtrlUpdate...() range of functions.

The parameters (wParam and lParam) can be an integer or a string.

GUICtrlSendMsg should be used for messages that have no special return types. For more advanced messages where you must be able to receive extra data you must use GUICtrlRecvMsg().

Related

GUICtrlRecvMsg, GUICtrlCreate..., GUICtrlUpdate..., GUIGetMsg, GUICtrlRead

Example

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

$nEdit = GUICtrlCreateEdit ("line 0", 10,10)
GUICtrlCreateButton ("Ok", 20,200,50)
GUISetState ()

For $n=1 To 5
GUICtrlSetData ($nEdit,@CRLF & "line "& $n)
Next

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
If $msg >0 Then
$n=GUICtrlSendMsg ($nEdit, $EM_LINEINDEX,-1,0)
$nline=GUICtrlSendMsg( $nEdit, $EM_LINEFROMCHAR,$n,0)
GUICtrlSetState ($nEdit,$GUI_FOCUS) ; set focus

MsgBox (0,"Currentline",$nLine)
EndIf
Until $msg = $GUI_EVENT_CLOSE


Function GUICtrlSendToDummy

Function Reference

GUICtrlSendToDummy

Sends a message to a Dummy control.

GUICtrlSendToDummy ( controlID [, state] )

Parameters

controlID | The control identifier (controlID) as returned by GUICtrlCreateDummy
state | [optional] value that can be retrieved later on by GUICtrlRead

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

When this function is called a notification that can be handled through the message loop or with a OnEvent function is generated (as if the control had been "clicked" on).

Related

GUICtrlCreateDummy, GUICtrlSetOnEvent, GUICtrlRead

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Global $user

Example()

Func Example()
Local $iOldOpt, $button
$iOldOpt = Opt("GUIOnEventMode", 1)

GUICreate("GUISendToDummy", 220, 200, 100, 200)
GUISetBkColor(0x00E0FFFF) ; will change background color
GUICtrlSetOnEvent($GUI_EVENT_CLOSE, "OnClick") ; to handle click on button

$user = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "Onexit") ; to handle click on button
$button = GUICtrlCreateButton("event", 75, 170, 70, 20)
GUICtrlSetOnEvent(-1, "OnClick") ; to handle click on button
GUISetState()

While 1
Sleep(100)
WEnd

Opt("GUIOnEventMode", $iOldOpt)

EndFunc ;==>Example

Func OnClick()
GUICtrlSendToDummy($user) ; fired dummy control
EndFunc ;==>OnClick

Func OnExit()
; special action before exiting
Exit
EndFunc ;==>OnExit


Function GUIGetCursorInfo

Function Reference

GUIGetCursorInfo

Gets the mouse cursor position relative to GUI window.

GUIGetCursorInfo ( [winhandle] )

Parameters

winhandle [optional] The handle of the window to use. If omitted the "current" window will be used.

Return Value

Success: | returns a five-element array that containing the mouse cursor information:
 | $array[0] = X coord (horizontal)
 | $array[1] = Y coord (vertical)
 | $array[2] = Primary down (1 if pressed, 0 if not pressed)
 | $array[3] = Secondary down (1 if pressed, 0 if not pressed)
 | $array[4] = ID of the control that the mouse cursor is hovering over (or 0 if none)
Failure: | 0 and set @error to 1

Remarks

The coordinates given are relative to the GUI window (known as client coords).

If the "winhandle" parameter is used then the specified window becomes the new "current" window.

The mouse cursor position is successful only on an window created by a GUICreate. When no winhandle it will be successful if the GUI Windows is active.

ListViewItem or TreeViewItem controlID will never be returned, only the parent Listview or TreeView control ID is.

Related

GUICreate, GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Global $x, $y

Example()

Func Example()
Local $msg

HotKeySet("{Esc}", "GetPos")

GUICreate("Press Esc to Get Pos", 400, 400)
$x = GUICtrlCreateLabel("0", 10, 10, 50)
$y = GUICtrlCreateLabel("0", 10, 30, 50)
GUISetState()

; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example

Func GetPos()
Local $a

$a = GUIGetCursorInfo()
GUICtrlSetData($x, $a[0])
GUICtrlSetData($y, $a[1])
EndFunc ;==>GetPos


Function GUIGetMsg

Function Reference

GUIGetMsg

Polls the GUI to see if any events have occurred.

GUIGetMsg ( [advanced] )

Parameters

advanced [optional] return extended information in an array.
0 = (default) Returns a single event.
1 = returns an array containing the event and extended information.

Return Value

Returns an event, or an array depending on the "advanced" parameter.
The "event" returned is the control ID of the control sending the message, or it is a special event (like the window is closing, minimizing). Or if there is no message, the event is 0.

Event ID | the ID of the control sending the message
0 | No event
$GUI_EVENT_CLOSE | dialog box being closed (either by defined button or system menu).
$GUI_EVENT_MINIMIZE | dialog box minimized with Windows title bar button.
$GUI_EVENT_RESTORE | dialog box restored by click on task bar icon.
$GUI_EVENT_MAXIMIZE | dialog box maximized with Windows title bar button.
$GUI_EVENT_MOUSEMOVE | the mouse cursor has moved.
$GUI_EVENT_PRIMARYDOWN | the primary mouse button was pressed.
$GUI_EVENT_PRIMARYUP | the primary mouse button was released.
$GUI_EVENT_SECONDARYDOWN | the secondary mouse button was pressed.
$GUI_EVENT_SECONDARYUP | the secondary mouse button was released.
$GUI_EVENT_RESIZED | dialog box has been resized.
$GUI_EVENT_DROPPED | End of a Drag&Drop action @GUI_DRAGID, @GUI_DRAGFILE and @GUI_DROPID will be used to retrieve the ID's/file corresponding to the involve control.

When using the "advanced" parameter the information is returned in an array with extended information:
$array[0] = 0 or Event ID or Control ID
$array[1] = The window handle the event is from
$array[2] = The control handle the event is from (if applicable)
$array[3] = The current X position of the mouse cursor (relative to the GUI window)
$array[4] = The current Y position of the mouse cursor (relative to the GUI window)

If the GUIOnEventMode option is set to 1 then the return from GUIGetMsg is always 0 and the @error is set to 1.
If the option GUIEventOptions is set to 1 the minimize, restore and maximize button will not do any action on the window just a simple notification.

Remarks

This function automatically idles the CPU when required so that it can be safely used in tight loops without hogging all the CPU.

Information about the mouse position and the hovering control can be retrieved with GUIGetCursorInfo. No event is fired when the mouse is over a control so GUIGetCursorInfo must be called to retrieve the ControlID.

Related

GUICreate, GUICtrlCreate..., GUICtrlRead, GUIOnEventMode (Option), GUIEventOptions (Option), GUIGetCursorInfo, GUICtrlSendMsg, GUICtrlSetOnEvent

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

;-------------------------------------------------------------------------------------
; Example - Press the button to see the value of the radio boxes
; The script also detects state changes (closed/minimized/timeouts, etc).
Func Example()
Local $button_1, $group_1, $radio_1, $radio_2, $radio_3
Local $radioval1, $radioval2, $msg

Opt("GUICoordMode", 1)
GUICreate("Radio Box Demo", 400, 280)

; Create the controls
$button_1 = GUICtrlCreateButton("B&utton 1", 30, 20, 120, 40)
$group_1 = GUICtrlCreateGroup("Group 1", 30, 90, 165, 160)
GUIStartGroup()
$radio_1 = GUICtrlCreateRadio("Radio &0", 50, 120, 70, 20)
$radio_2 = GUICtrlCreateRadio("Radio &1", 50, 150, 60, 20)
$radio_3 = GUICtrlCreateRadio("Radio &2", 50, 180, 60, 20)

; Init our vars that we will use to keep track of GUI events
$radioval1 = 0 ; We will assume 0 = first radio button selected, 2 = last button
$radioval2 = 2

; Show the GUI
GUISetState()

; In this message loop we use variables to keep track of changes to the radios, another
; way would be to use GUICtrlRead() at the end to read in the state of each control
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
MsgBox(0, "", "Dialog was closed")
Exit
Case $msg = $GUI_EVENT_MINIMIZE
MsgBox(0, "", "Dialog minimized", 2)
Case $msg = $GUI_EVENT_MAXIMIZE
MsgBox(0, "", "Dialog restored", 2)

Case $msg = $button_1
MsgBox(0, "Default button clicked", "Radio " & $radioval1)

Case $msg >= $radio_1 And $msg <= $radio_3
$radioval1 = $msg - $radio_1

EndSelect
WEnd
EndFunc ;==>Example


Function GUIGetStyle

Function Reference

GUIGetStyle

Retrieves the styles of a GUI window.

GUIGetStyle ( [ winhandle] )

Parameters

winhandle [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | returns a two-element array that containing the styles information:
 | $array[0] = Style
 | $array[1] = ExStyle
Failure: | Returns 0.

Remarks

Be carefull Style changes after GUISetState().

Related

GUICreate, GUISetStyle

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $NewStyle = False, $hWnd, $Style, $GuiStyles, $Msg

$hWnd = GUICreate("Gui Style", 260, 100)
$Style = GUICtrlCreateButton("Set Style", 45, 50, 150, 20)

$GuiStyles = GUIGetStyle($hWnd) ; be careful the style change after opening

GUISetState()

While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Style
If Not $NewStyle Then
GUISetStyle(BitOR($WS_POPUPWINDOW, $WS_THICKFRAME), BitOR($WS_EX_CLIENTEDGE, $WS_EX_TOOLWINDOW))
GUICtrlSetData($Style, 'Undo Style')
$NewStyle = True
Else
GUISetStyle($GuiStyles[0], $GuiStyles[1])
GUICtrlSetData($Style, 'Set Style')
$NewStyle = False
EndIf
Case Else
EndSwitch
WEnd
EndFunc ;==>Example


Function GUIRegisterMsg

Function Reference

GUIRegisterMsg

Register a user defined function for a known Windows Message ID (WM_MSG).

GUIRegisterMsg ( msgID, "function" )

Parameters

msgID | A Windows Message ID (see Appendix: Windows Message Codes).
function | The name of the user function to call when the message appears or an empty string "" to unregister a message.

Return Value

Success: | 1
Failure: | 0

Remarks

!!! To make the user function workable you have to define it with maximum 4 function parameters otherwise the function won't be called !!!
i.e:
Func MyUserFunction($hWndGUI, $MsgID, $WParam, $LParam)
...
EndFunc

Or

Func MyUserFunction($hWndGUI, $MsgID)
...
EndFunc

When the user function is called then these 4 parameters have the following values:
Position | Parameter | Meaning
1 | hWnd | The Window handle of the GUI in which the message appears.
2 | Msg | The Windows message ID.
3 | wParam | The first message parameter as hex value.
4 | lParam | The second message parameter as hex value.

Up to 256 user functions can be registered for message ID's.

By default after finishing the user function the AutoIt internal message handler will be proceed.
That won't be if your Return a value (See WM_COMMAND in example) or if you use the keyword 'Return' without any value.
By using 'Return' without any return value the AutoIt internal message handler (if there is one for this message) will NOT be proceed!

!!! If you want AutoIt to run it's internal handler for a message, return the variable $GUI_RUNDEFMSG (in GUIConstantsEx.au3) from the function (see also examples) !!!
I.e. if you want to return earlier than the user function ends and also proceed the AutoIt internal message handler.

Warning: blocking of running user functions which executes window messages with commands such as "Msgbox()" can lead to unexpected behavior, the return to the system should be as fast as possible !!!

Some controls consume internally specific Windows Message ID, so registrating them will have no effect, e.g; WM_CHAR, WM_KEYDOWN, WM_KEYUP are consumed by an edit control.

Related

GUICtrlGetHandle

Example

; *******************************************************
; Example - Create an ownerdrawn/colored button
; *******************************************************

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>

Example()

Func Example()
Local Const $BS_OWNERDRAW = 0x0000000B
Local $hGUI, $nButton, $nButton2, $GUIMsg

$hGUI = GUICreate("My Ownerdrawn Created Button", 300, 200)

$nButton = GUICtrlCreateButton("", 90, 50, 120, 30)
GUICtrlSetStyle($nButton, BitOR($WS_TABSTOP, $BS_NOTIFY, $BS_OWNERDRAW)) ; Set the ownerdrawn flag

$nButton2 = GUICtrlCreateButton("Normal Button", 90, 110, 120, 30)

GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
; WM_DRAWITEM has to registered before showing GUI otherwise the initial drawing isn't done
GUIRegisterMsg($WM_DRAWITEM, "MY_WM_DRAWITEM")

GUISetState()

While 1
$GUIMsg = GUIGetMsg()

Switch $GUIMsg
Case $GUI_EVENT_CLOSE
ExitLoop

Case $nButton
; Normally should not run through cause of our MY_WM_COMMAND function
MsgBox(0, "Info", "Button pressed")

Case $nButton2
; Normally should not run through cause of our MY_WM_COMMAND function
MsgBox(0, "Info", "Button2 pressed")
EndSwitch
WEnd
EndFunc ;==>Example

; React on a button click
Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
$nNotifyCode = BitShift($wParam, 16)
$nID = BitAND($wParam, 0x0000FFFF)
$hCtrl = $lParam

If $nID <> 2 And $nNotifyCode = 0 Then ; Check for IDCANCEL - 2
; Ownerdrawn buttons don't send something by pressing ENTER
; So IDOK - 1 comes up, now check for the control that has the current focus
If $nID = 1 Then
$hFocus = DllCall("user32.dll", "hwnd", "GetFocus")
$nCtrlID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hFocus[0])
PostButtonClick($hWnd, $nCtrlID[0])
Else
MsgBox(0, "MY_WM_COMMAND", "GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
"MsgID" & @TAB & ":" & $Msg & @LF & _
"wParam" & @TAB & ":" & $wParam & @LF & _
"lParam" & @TAB & ":" & $lParam & @LF & @LF & _
"WM_COMMAND - Infos:" & @LF & _
"-----------------------------" & @LF & _
"Code" & @TAB & ":" & $nNotifyCode & @LF & _
"CtrlID" & @TAB & ":" & $nID & @LF & _
"CtrlHWnd" & @TAB & ":" & $hCtrl)
EndIf
Return 0 ; Only workout clicking on the button
EndIf
; Proceed the default Autoit3 internal message commands.
; You also can complete let the line out.
; !!! But only 'Return' (without any value) will not proceed
; the default Autoit3-message in the future !!!
Return $GUI_RUNDEFMSG
EndFunc ;==>MY_WM_COMMAND

; RePost a WM_COMMAND message to a ctrl in a gui window
Func PostButtonClick($hWnd, $nCtrlID)
DllCall("user32.dll", "int", "PostMessage", _
"hwnd", $hWnd, _
"int", $WM_COMMAND, _
"int", BitAND($nCtrlID, 0x0000FFFF), _
"hwnd", GUICtrlGetHandle($nCtrlID))
EndFunc ;==>PostButtonClick

; Draw the button
Func MY_WM_DRAWITEM($hWnd, $Msg, $wParam, $lParam)
Local $stDrawItem = DllStructCreate("uint;uint;uint;uint;uint;uint;uint;int[4];dword", $lParam)
Local Const $ODT_BUTTON = 4

$nCtlType = DllStructGetData($stDrawItem, 1)
If $nCtlType = $ODT_BUTTON Then
$nCtrlID = DllStructGetData($stDrawItem, 2)
$nItemState = DllStructGetData($stDrawItem, 5)
$hCtrl = DllStructGetData($stDrawItem, 6)
$hDC = DllStructGetData($stDrawItem, 7)
$nLeft = DllStructGetData($stDrawItem, 8, 1)
$nTop = DllStructGetData($stDrawItem, 8, 2)
$nRight = DllStructGetData($stDrawItem, 8, 3)
$nBottom = DllStructGetData($stDrawItem, 8, 4)
$sText = "Ownerdrawn Button"
$nTextColor = 0x5555DD
$nBackColor = 0xFFEEDD
DrawButton($hWnd, $hCtrl, $hDC, $nLeft, $nTop, $nRight, $nBottom, $nItemState, $sText, $nTextColor, $nBackColor)
$stDrawItem = 0
Return 1
EndIf

$stDrawItem = 0
Return $GUI_RUNDEFMSG ; Proceed the default Autoit3 internal message commands
EndFunc ;==>MY_WM_DRAWITEM

; The main drawing procedure
Func DrawButton($hWnd, $hCtrl, $hDC, $nLeft, $nTop, $nRight, $nBottom, $nItemState, $sText, $nTextColor, $nBackColor)
;Local $bDefault = FALSE
Local Const $GWL_STYLE = -16
Local Const $ODS_SELECTED = 0x0001
Local Const $ODS_GRAYED = 0x0002
Local Const $ODS_DISABLED = 0x0004
Local Const $ODS_CHECKED = 0x0008
Local Const $ODS_FOCUS = 0x0010
Local Const $ODS_HOTLIGHT = 0x0040
Local Const $ODS_INACTIVE = 0x0080
Local Const $ODS_NOACCEL = 0x0100
Local Const $ODS_NOFOCUSRECT = 0x0200
Local Const $DFC_BUTTON = 4
Local Const $DFCS_BUTTONPUSH = 0x0010
Local $bChecked = BitAND($nItemState, $ODS_CHECKED)
Local $bFocused = BitAND($nItemState, $ODS_FOCUS)
Local $bGrayed = BitAND($nItemState, BitOR($ODS_GRAYED, $ODS_DISABLED))
Local $bSelected = BitAND($nItemState, $ODS_SELECTED)

$stRect = DllStructCreate("int;int;int;int")
DllStructSetData($stRect, 1, $nLeft)
DllStructSetData($stRect, 2, $nTop)
DllStructSetData($stRect, 3, $nRight)
DllStructSetData($stRect, 4, $nBottom)

If $bGrayed Then
$nClrTxt = SetTextColor($hDC, GetSysColor($COLOR_HIGHLIGHTTEXT))
ElseIf $nTextColor = -1 Then
$nClrTxt = SetTextColor($hDC, GetSysColor($COLOR_BTNTEXT))
Else
$nClrTxt = SetTextColor($hDC, $nTextColor)
EndIf

If $nBackColor = -1 Then
$hBrush = GetSysColorBrush($COLOR_BTNFACE)
$nClrSel = GetSysColor($COLOR_BTNFACE)
Else
$hBrush = CreateSolidBrush($nBackColor)
$nClrSel = $nBackColor;
EndIf

$nClrBk = SetBkColor($hDC, $nClrSel)
$hOldBrush = SelectObject($hDC, $hBrush)

$nTmpLeft = $nLeft
$nTmpTop = $nTop
$nTmpRight = $nRight
$nTmpBottom = $nBottom

If $bSelected Then
InflateRect($nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, -1, -1)
$hBrushSel = CreateSolidBrush(GetSysColor($COLOR_BTNSHADOW))
FrameRect($hDC, $nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, $hBrushSel)
DeleteObject($hBrushSel)
Else
If $bFocused And Not $bSelected Then InflateRect($nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, -1, -1)
DrawFrameControl($hDC, $nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, $DFC_BUTTON, $DFCS_BUTTONPUSH)
EndIf

$nTmpLeft = $nLeft
$nTmpTop = $nTop
$nTmpRight = $nRight
$nTmpBottom = $nBottom

If $bSelected Then
InflateRect($nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, -2, -2)
Else
If $bFocused And Not $bSelected Then
InflateRect($nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, -3, -3)
$nTmpLeft -= 1
$nTmpTop -= 1
Else
InflateRect($nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, -2, -2)
$nTmpLeft -= 1
$nTmpTop -= 1
EndIf
EndIf

FillRect($hDC, $nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, $hBrush)

If $bSelected Or $bGrayed Then
$nTmpLeft = $nTmpLeft + 2
$nTmpTop = $nTmpTop + 2
EndIf

$uFlags = BitOR($DT_NOCLIP, $DT_CENTER, $DT_VCENTER)

If Not BitAND(GetWindowLong($hCtrl, $GWL_STYLE), $BS_MULTILINE) Then $uFlags = BitOR($uFlags, $DT_SINGLELINE)

DrawText($hDC, $sText, $nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, $uFlags)

If $bGrayed Then
$nTmpLeft = $nLeft
$nTmpTop = $nTop
$nTmpRight = $nRight
$nTmpBottom = $nBottom

$nTmpLeft -= 1

$nClrTxt = SetTextColor($hDC, GetSysColor($COLOR_GRAYTEXT))
DrawText($hDC, $sText, $nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, BitOR($DT_NOCLIP, $DT_CENTER, $DT_VCENTER, $DT_SINGLELINE))
EndIf

$nTmpLeft = $nLeft
$nTmpTop = $nTop
$nTmpRight = $nRight
$nTmpBottom = $nBottom

If $bFocused Then
$hBrush = CreateSolidBrush(0)
FrameRect($hDC, $nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, $hBrush)

$nTmpLeft = $nLeft
$nTmpTop = $nTop
$nTmpRight = $nRight
$nTmpBottom = $nBottom

InflateRect($nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom, -4, -4)
DrawFocusRect($hDC, $nTmpLeft, $nTmpTop, $nTmpRight, $nTmpBottom)
EndIf

SelectObject($hDC, $hOldBrush)
DeleteObject($hBrush)
SetTextColor($hDC, $nClrTxt)
SetBkColor($hDC, $nClrBk)

Return 1
EndFunc ;==>DrawButton

; Some graphic / windows functions
Func CreateSolidBrush($nColor)
Local $hBrush = DllCall("gdi32.dll", "hwnd", "CreateSolidBrush", "int", $nColor)
Return $hBrush[0]
EndFunc ;==>CreateSolidBrush

Func GetSysColor($nIndex)
Local $nColor = DllCall("user32.dll", "int", "GetSysColor", "int", $nIndex)
Return $nColor[0]
EndFunc ;==>GetSysColor

Func GetSysColorBrush($nIndex)
Local $hBrush = DllCall("user32.dll", "hwnd", "GetSysColorBrush", "int", $nIndex)
Return $hBrush[0]
EndFunc ;==>GetSysColorBrush

Func DrawFrameControl($hDC, $nLeft, $nTop, $nRight, $nBottom, $nType, $nState)
Local $stRect = DllStructCreate("int;int;int;int")

DllStructSetData($stRect, 1, $nLeft)
DllStructSetData($stRect, 2, $nTop)
DllStructSetData($stRect, 3, $nRight)
DllStructSetData($stRect, 4, $nBottom)

DllCall("user32.dll", "int", "DrawFrameControl", "hwnd", $hDC, "ptr", DllStructGetPtr($stRect), "int", $nType, "int", $nState)

$stRect = 0
EndFunc ;==>DrawFrameControl

Func DrawFocusRect($hDC, $nLeft, $nTop, $nRight, $nBottom)
Local $stRect = DllStructCreate("int;int;int;int")

DllStructSetData($stRect, 1, $nLeft)
DllStructSetData($stRect, 2, $nTop)
DllStructSetData($stRect, 3, $nRight)
DllStructSetData($stRect, 4, $nBottom)

DllCall("user32.dll", "int", "DrawFocusRect", "hwnd", $hDC, "ptr", DllStructGetPtr($stRect))

$stRect = 0
EndFunc ;==>DrawFocusRect

Func DrawText($hDC, $sText, $nLeft, $nTop, $nRight, $nBottom, $nFormat)
Local $nLen = StringLen($sText)

Local $stRect = DllStructCreate("int;int;int;int")
DllStructSetData($stRect, 1, $nLeft)
DllStructSetData($stRect, 2, $nTop)
DllStructSetData($stRect, 3, $nRight)
DllStructSetData($stRect, 4, $nBottom)

Local $stText = DllStructCreate("char[260]")
DllStructSetData($stText, 1, $sText)

DllCall("user32.dll", "int", "DrawText", "hwnd", $hDC, "ptr", DllStructGetPtr($stText), "int", $nLen, "ptr", DllStructGetPtr($stRect), "int", $nFormat)

$stRect = 0
$stText = 0
EndFunc ;==>DrawText

Func FillRect($hDC, $nLeft, $nTop, $nRight, $nBottom, $hBrush)
Local $stRect = DllStructCreate("int;int;int;int")

DllStructSetData($stRect, 1, $nLeft)
DllStructSetData($stRect, 2, $nTop)
DllStructSetData($stRect, 3, $nRight)
DllStructSetData($stRect, 4, $nBottom)

DllCall("user32.dll", "int", "FillRect", "hwnd", $hDC, "ptr", DllStructGetPtr($stRect), "hwnd", $hBrush)

$stRect = 0
EndFunc ;==>FillRect

Func FrameRect($hDC, $nLeft, $nTop, $nRight, $nBottom, $hBrush)
Local $stRect = DllStructCreate("int;int;int;int")

DllStructSetData($stRect, 1, $nLeft)
DllStructSetData($stRect, 2, $nTop)
DllStructSetData($stRect, 3, $nRight)
DllStructSetData($stRect, 4, $nBottom)

DllCall("user32.dll", "int", "FrameRect", "hwnd", $hDC, "ptr", DllStructGetPtr($stRect), "hwnd", $hBrush)

$stRect = 0
EndFunc ;==>FrameRect

Func InflateRect(ByRef $nLeft, ByRef $nTop, ByRef $nRight, ByRef $nBottom, $nX, $nY)
Local $stRect = DllStructCreate("int;int;int;int")

DllStructSetData($stRect, 1, $nLeft)
DllStructSetData($stRect, 2, $nTop)
DllStructSetData($stRect, 3, $nRight)
DllStructSetData($stRect, 4, $nBottom)

DllCall("user32.dll", "int", "InflateRect", "ptr", DllStructGetPtr($stRect), "int", $nX, "int", $nY)

$nLeft = DllStructGetData($stRect, 1)
$nTop = DllStructGetData($stRect, 2)
$nRight = DllStructGetData($stRect, 3)
$nBottom = DllStructGetData($stRect, 4)

$stRect = 0
EndFunc ;==>InflateRect

Func SetBkColor($hDC, $nColor)
Local $nOldColor = DllCall("gdi32.dll", "int", "SetBkColor", "hwnd", $hDC, "int", $nColor)
Return $nOldColor[0]
EndFunc ;==>SetBkColor

Func SetTextColor($hDC, $nColor)
Local $nOldColor = DllCall("gdi32.dll", "int", "SetTextColor", "hwnd", $hDC, "int", $nColor)
Return $nOldColor[0]
EndFunc ;==>SetTextColor

Func SelectObject($hDC, $hObj)
Local $hOldObj = DllCall("gdi32.dll", "hwnd", "SelectObject", "hwnd", $hDC, "hwnd", $hObj)
Return $hOldObj[0]
EndFunc ;==>SelectObject

Func DeleteObject($hObj)
Local $nResult = DllCall("gdi32.dll", "hwnd", "DeleteObject", "hwnd", $hObj)
EndFunc ;==>DeleteObject

Func GetWindowLong($hWnd, $nIndex)
Local $nVal = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hWnd, "int", $nIndex)
Return $nVal[0]
EndFunc ;==>GetWindowLong


Function GUIStartGroup

Function Reference

GUIStartGroup

Defines that any subsequent controls that are created will be "grouped" together.

GUIStartGroup ( [winhandle] )

Parameters

winhandle [optional] Windows handle as returned by GUICreate (default is the previously used window).

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

This function is generally used when working with radio button controls. When you click a radio button all other radio buttons in the same grouping are reset. The GUIStartGroup function allows you to easily define these groups.

Related

GUICtrlCreateGroup

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $button_1, $group_1, $radio_1, $radio_2, $radio_3
Local $radio_4, $radio_5, $radio_6, $input_1, $input_2
Local $radioval1, $radioval2, $msg

Opt("GUICoordMode", 1)

GUICreate("Radio Box Grouping Demo", 400, 280)

; Create the controls
$button_1 = GUICtrlCreateButton("B&utton 1", 30, 20, 120, 40)
$group_1 = GUICtrlCreateGroup("Group 1", 30, 90, 165, 160)
GUIStartGroup()
$radio_1 = GUICtrlCreateRadio("Radio &0", 50, 120, 70, 20)
$radio_2 = GUICtrlCreateRadio("Radio &1", 50, 150, 60, 20)
$radio_3 = GUICtrlCreateRadio("Radio &2", 50, 180, 60, 20)
GUIStartGroup()
$radio_4 = GUICtrlCreateRadio("Radio &A", 120, 120, 70, 20)
$radio_5 = GUICtrlCreateRadio("Radio &B", 120, 150, 60, 20)
$radio_6 = GUICtrlCreateRadio("Radio &C", 120, 180, 60, 20)
GUIStartGroup()
$input_1 = GUICtrlCreateInput("Input 1", 200, 20, 160, 30)
$input_2 = GUICtrlCreateInput("Input 2", 200, 70, 160, 30)

; Set the defaults (radio buttons clicked, default button, etc)
GUICtrlSetState($radio_1, $GUI_CHECKED)
GUICtrlSetState($radio_6, $GUI_CHECKED)
GUICtrlSetState($button_1, $GUI_FOCUS + $GUI_DEFBUTTON)

; Init our vars that we will use to keep track of radio events
$radioval1 = 0 ; We will assume 0 = first radio button selected, 2 = last button
$radioval2 = 2

GUISetState()

; In this message loop we use variables to keep track of changes to the radios, another
; way would be to use GUICtrlRead() at the end to read in the state of each control. Both
; methods are equally valid
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit

Case $msg = $button_1
MsgBox(0, "Button", "Radio " & $radioval1 & @LF & "Radio " & Chr($radioval2 + Asc("A")) & @LF & GUICtrlRead($input_1) & @LF & GUICtrlRead($input_2))

Case $msg = $radio_1 Or $msg = $radio_2 Or $msg = $radio_3
$radioval1 = $msg - $radio_1

Case $msg = $radio_4 Or $msg = $radio_5 Or $msg = $radio_6
$radioval2 = $msg - $radio_4

EndSelect
WEnd
EndFunc ;==>Example


Function GUISwitch

Function Reference

GUISwitch

Switches the current window used for GUI functions.

GUISwitch ( winhandle [, tabitemID] )

Parameters

winhandle | The handle of the window to switch to.
tabitemID | [optional] controlID of the tabitem control to be selected.

Return Value

Success: | Returns the handle of the previously current.
Failure: | Returns a NULL handle.

Remarks

Many of the GUI specific functions work on the "current" window - this is usually the last window created with GUICreate. This function allows you to make another window "current". That's does not mean that the referenced window will become active. You have to use WinActivate.

Using the tabitemID allow to create new control in the specified tabitem control. Don't forget to close tabitem definition GuiCtrlCreateTabItem("")

Related

GUICreate, GUIDelete, GUICtrlCreateTabItem

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $parent1, $parent2, $tabitem, $msg

$parent1 = GUICreate("Parent1")
GUICtrlCreateTab(10, 10)
$tabitem = GUICtrlCreateTabItem("tab1")
GUICtrlCreateTabItem("tab2")
GUICtrlCreateTabItem("")

$parent2 = GUICreate("Parent2", -1, -1, 100, 100)

GUISwitch($parent2)
GUISetState()
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

GUISwitch($parent1, $tabitem)
GUICtrlCreateButton("OK", 50, 50, 50)
GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW, $parent1)
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example


Functions

Keyboard functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
HotKeySet | Sets a hotkey that calls a user function.
Send | Sends simulated keystrokes to the active window.
SendKeepActive | Attempts to keep a specified window active during Send().


Function HotKeySet

Function Reference

HotKeySet

Sets a hotkey that calls a user function.

HotKeySet ( "key" [, "function"] )

Parameters

key | The key combination to use as the hotkey. Same format as Send().
function | [optional] The name of the function to call when the key is pressed. Not specifying this parameter will unset a previous hotkey.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

If two AutoIt scripts set the same HotKeys, you should avoid running those scripts simultaneously. (The second script cannot capture the hotkey unless the first script terminates or unregisters the key prior to the second script setting the hotkey.)

A hotkey-press *typically* interrupts the active AutoIt function/statement and runs its user function until it completes or is interrupted. Exceptions are as follows:
1) If the current function is a "blocking" function, then the key-presses are buffered and execute as soon as the blocking function completes. MsgBox and FileSelectFolder are examples of blocking functions. Try the behavior of Shift-Alt-d in the Example.
2) If you have paused the script by clicking on the AutoIt Tray icon, any hotkeys pressed during this paused state are ignored.

The following hotkeys cannot be set:

Ctrl+Alt+Delete | It is reserved by Windows
F12 | It is also reserved by Windows, according to its API.
NumPad's Enter Key | Instead, use {Enter} which captures both Enter keys on the keyboard.
Win+B,D,E,F,L,M,R,U; and Win+Shift+M | These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above.
Alt, Ctrl, Shift, Win | These are the modifier keys themselves!
Other | Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.

When you set a hotkey, AutoIt captures the key-press and does not pass it on to the active application, with one exception: the Lock keys (NumLock, CapsLock, and ScrollLock) still toggle their respective state!
To Send() a key combination which will trigger a HotKeySet() event, either use ControlSend() or unregister the HotKeySet() event, otherwise, the Send() event may trigger an infinite loop.

; capture and pass along a keypress
HotKeySet("{Esc}", "captureEsc")
Func captureEsc()
; ... can do stuff here
HotKeySet("{Esc}")
Send("{Esc}")
HotKeySet("{Esc}", "captureEsc")
EndFunc

The called function can not be given parameters. They will be ignored.

@HotKeyPressed macro can be used inside the function to handle several keys in the same function.

Related

Send, GUISetAccelerators

Example

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here ;;;;
While 1
Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc

Func Terminate()
Exit 0
EndFunc

Func ShowMessage()
MsgBox(4096,"","This is a message.")
EndFunc


Function Send

Function Reference

Send

Sends simulated keystrokes to the active window.

Send ( "keys" [, flag] )

Parameters

keys | The sequence of keys to send.
flag | [optional] Changes how "keys" is processed: flag = 0 (default), Text contains special characters like + and ! to indicate SHIFT and ALT key-presses. flag = 1, keys are sent raw.

Return Value

None.

Remarks

See the Appendix for some tips on using Send. AutoIt can send all ASCII and Extended ASCII characters (0-255), to send UNICODE characters you must use the "ASC" option and the code of the character you wish to send (see {ASC} at the bottom of the table below).

The "Send" command syntax is similar to that of ScriptIt and the Visual Basic "SendKeys" command. Characters are sent as written with the exception of the following characters:

'!'
This tells AutoIt to send an ALT keystroke, therefore Send("This is text!a") would send the keys "This is text" and then press "ALT+a".

N.B. Some programs are very choosy about capital letters and ALT keys, i.e. "!A" is different to "!a". The first says ALT+SHIFT+A, the second is ALT+a. If in doubt, use lowercase!

'+'
This tells AutoIt to send a SHIFT keystroke, therefore Send("Hell+o") would send the text "HellO". Send("!+a") would send "ALT+SHIFT+a".

'^'
This tells AutoIt to send a CONTROL keystroke, therefore Send("^!a") would send "CTRL+ALT+a".

N.B. Some programs are very choosy about capital letters and CTRL keys, i.e. "^A" is different to "^a". The first says CTRL+SHIFT+A, the second is CTRL+a. If in doubt, use lowercase!

'#'
The hash now sends a Windows keystroke; therefore, Send("#r") would send Win+r which launches the Run dialog box.

You can set SendCapslockMode to make CAPS LOCK disabled at the start of a Send operation and restored upon completion.
However, if a user is holding down the Shift key when a Send function begins, text may be sent in uppercase.
One workaround is to Send("{SHIFTDOWN}{SHIFTUP}") before the other Send operations.

Certain keyboard as the Czech one send different characters when using the Shift Key or being in CAPS LOCK enabled and sending a char. Due to the send AutoIt implementation the CAPS LOCKed char will be sent as Shifted one so it will not work.

Certain special keys can be sent and should be enclosed in braces:

N.B. Windows does not allow the simulation of the "CTRL-ALT-DEL" combination!
Send Command (if zero flag) | Resulting Keypress
{!} | !
{#} | #
{+} | +
{^} | ^
{{} | {
{}} | }
{SPACE} | SPACE
{ENTER} | ENTER key on the main keyboard
{ALT} | ALT
{BACKSPACE} or {BS} | BACKSPACE
{DELETE} or {DEL} | DELETE
{UP} | Up arrow
{DOWN} | Down arrow
{LEFT} | Left arrow
{RIGHT} | Right arrow
{HOME} | HOME
{END} | END
{ESCAPE} or {ESC} | ESCAPE
{INSERT} or {INS} | INS
{PGUP} | PageUp
{PGDN} | PageDown
{F1} - {F12} | Function keys
{TAB} | TAB
{PRINTSCREEN} | Print Screen key
{LWIN} | Left Windows key
{RWIN} | Right Windows key
{NUMLOCK on} | NUMLOCK (on/off/toggle)
{CAPSLOCK off} | CAPSLOCK (on/off/toggle)
{SCROLLLOCK toggle} | SCROLLLOCK (on/off/toggle)
{BREAK} | for Ctrl+Break processing
{PAUSE} | PAUSE
{NUMPAD0} - {NUMPAD9} | Numpad digits
{NUMPADMULT} | Numpad Multiply
{NUMPADADD} | Numpad Add
{NUMPADSUB} | Numpad Subtract
{NUMPADDIV} | Numpad Divide
{NUMPADDOT} | Numpad period
{NUMPADENTER} | Enter key on the numpad
{APPSKEY} | Windows App key
{LALT} | Left ALT key
{RALT} | Right ALT key
{LCTRL} | Left CTRL key
{RCTRL} | Right CTRL key
{LSHIFT} | Left Shift key
{RSHIFT} | Right Shift key
{SLEEP} | Computer SLEEP key
{ALTDOWN} | Holds the ALT key down until {ALTUP} is sent
{SHIFTDOWN} | Holds the SHIFT key down until {SHIFTUP} is sent
{CTRLDOWN} | Holds the CTRL key down until {CTRLUP} is sent
{LWINDOWN} | Holds the left Windows key down until {LWINUP} is sent
{RWINDOWN} | Holds the right Windows key down until {RWINUP} is sent
{ASC nnnn} | Send the ALT+nnnn key combination
{BROWSER_BACK} | 2000/XP Only: Select the browser "back" button
{BROWSER_FORWARD} | 2000/XP Only: Select the browser "forward" button
{BROWSER_REFRESH} | 2000/XP Only: Select the browser "refresh" button
{BROWSER_STOP} | 2000/XP Only: Select the browser "stop" button
{BROWSER_SEARCH} | 2000/XP Only: Select the browser "search" button
{BROWSER_FAVORITES} | 2000/XP Only: Select the browser "favorites" button
{BROWSER_HOME} | 2000/XP Only: Launch the browser and go to the home page
{VOLUME_MUTE} | 2000/XP Only: Mute the volume
{VOLUME_DOWN} | 2000/XP Only: Reduce the volume
{VOLUME_UP} | 2000/XP Only: Increase the volume
{MEDIA_NEXT} | 2000/XP Only: Select next track in media player
{MEDIA_PREV} | 2000/XP Only: Select previous track in media player
{MEDIA_STOP} | 2000/XP Only: Stop media player
{MEDIA_PLAY_PAUSE} | 2000/XP Only: Play/pause media player
{LAUNCH_MAIL} | 2000/XP Only: Launch the email application
{LAUNCH_MEDIA} | 2000/XP Only: Launch media player
{LAUNCH_APP1} | 2000/XP Only: Launch user app1
{LAUNCH_APP2} | 2000/XP Only: Launch user app2

To send the ASCII value A (same as pressing ALT+065 on the numeric keypad)
Send("{ASC 065}")

(When using 2 digit ASCII codes you must use a leading 0, otherwise an obsolete 437 code page is used).

To send UNICODE characters enter the character code (decimal or hex), for example this sends a Chinese character
Send("{ASC 2709}") or Send("{ASC 0xA95}")

Single keys can also be repeated, e.g.
Send("{DEL 4}") ;Presses the DEL key 4 times
Send("{S 30}") ;Sends 30 'S' characters
Send("+{TAB 4}") ;Presses SHIFT+TAB 4 times

The key will be send at least once even if the count is zero.

To hold a key down (generally only useful for games)
Send("{a down}") ;Holds the A key down
Send("{a up}") ;Releases the A key

To set the state of the capslock, numlock and scrolllock keys
Send("{NumLock on}") ;Turns the NumLock key on
Send("{CapsLock off}") ;Turns the CapsLock key off
Send("{ScrollLock toggle}") ;Toggles the state of ScrollLock

If you wish to use a variable for the count, try
$n = 4
Send("+{TAB " & $n & "}")

If you wish to send the ASCII value A four times, then try
$x = Chr(65)
Send("{" & $x & " 4}")

Most laptop computer keyboards have a special Fn key. This key cannot be simulated.

Note, by setting the flag parameter to 1 the above "special" processing will be disabled. This is useful when you want to send some text copied from a variable and you want the text sent exactly as written.

For example, open Folder Options (in the control panel) and try the following:
Send("{TAB}") | Navigate to next control (button, checkbox, etc)
Send("+{TAB}") | Navigate to previous control.
Send("^{TAB}") | Navigate to next WindowTab (on a Tabbed dialog window)
Send("^+{TAB}") | Navigate to previous WindowTab.
Send("{SPACE}") | Can be used to toggle a checkbox or click a button.
Send("{+}") | Usually checks a checkbox (if it's a "real" checkbox.)
Send("{-}") | Usually unchecks a checkbox.
Send("{NumPadMult}") | Recursively expands folders in a SysTreeView32.

Use Alt-key combos to access menu items. Also, open Notepad and try the following:
Send("!f") Send Alt+f, the access key for Notepad's file menu. Try other letters!

Send("{DOWN}") | Move down a menu.
Send("{UP}") | Move up a menu.
Send("{LEFT}") | Move leftward to new menu or expand a submenu.
Send("{RIGHT}") | Move rightward to new menu or collapse a submenu.
See Windows' Help--press Win+F1--for a complete list of keyboard shortcuts if you don't know the importance of Alt+F4, PrintScreen, Ctrl+C, and so on.

When running a script on a remote computer through a program as psexec (www.sysinternals.com) or beyondexec (www.beyondlogic.org) it is necessary, specially when sending strokes to a program launch by the script with a Run function, to use ControlSend or other ControlXXX functions to directly communicate with the control. Send even with Opt("SendAttachMode",1) is not working.
Using the -s mode when submitting can help to have better right on the remote computer.

Opt("SendKeyDelay",...) alters the the length of the brief pause in between sent keystrokes.
Opt("SendKeyDownDelay",...) alters the length of time a key is held down before being released during a keystroke.
Set both "SendKeyDelay" and "SendKeyDownDelay" to 0 to remove all delays when sending keystrokes. This may be required under certain circumstances, for example, when locking the system ("#l") it may be necessary to remove the delays in order to prevent the WIN key from being stuck down.

Related

SendAttachMode (Option), SendKeepActive, SendKeyDelay (Option), SendKeyDownDelay (Option), ControlSend, BlockInput, HotKeySet, WinMenuSelectItem

Example

Send("#r")
WinWaitActive("Run")
Send("notepad.exe{Enter}")
WinWaitActive("[CLASS:Notepad]")
Send("Today's time/date is {F5}")


Function SendKeepActive

Function Reference

SendKeepActive

Attempts to keep a specified window active during Send().

SendKeepActive ( "title" [, "text"] )

Parameters

title | The title of the window to activate. See Title special definition. Use a blank title to disable the function.
text | [optional] The text of the window.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window is not found.

Remarks

Attempts to reset the active window in between each simulated keystroke from Send().

Related

Send

Example

Run("notepad.exe")
WinWait("[CLASS:Notepad]")

SendKeepActive("[CLASS:Notepad]")

; Change the active window during pauses
For $i = 1 to 10
Sleep(1000)
Send("Hello")
Next


Functions

Math functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
Abs | Calculates the absolute value of a number.
ACos | Calculates the arcCosine of a number.
ASin | Calculates the arcsine of a number.
ATan | Calculates the arctangent of a number.
BitAND | Performs a bitwise AND operation.
BitNOT | Performs a bitwise NOT operation.
BitOR | Performs a bitwise OR operation.
BitRotate | Performs a bit shifting operation, with rotation.
BitShift | Performs a bit shifting operation.
BitXOR | Performs a bitwise exclusive OR (XOR) operation.
Cos | Calculates the cosine of a number.
Ceiling | Returns a number rounded up to the next integer.
Exp | Calculates e to the power of a number.
Floor | Returns a number rounded down to the closest integer.
Log | Calculates the natural logarithm of a number.
Mod | Performs the modulus operation.
Random | Generates a pseudo-random float-type number.
Round | Returns a number rounded to a specified number of decimal places.
Sin | Calculates the sine of a number.
Sqrt | Calculates the square-root of a number.
SRandom | Set Seed for random number generation.
Tan | Calculates the tangent of a number.


Function Abs

Function Reference

Abs

Calculates the absolute value of a number.

Abs ( expression )

Parameters

expression Any valid numeric expression.

Return Value

Returns absolute value of expression.

Remarks

A string has a value of zero.

Related

None.

Example

$var = Abs(-123.45) ;value is 123.45


Function ACos

Function Reference

ACos

Calculates the arcCosine of a number.

ACos ( expression )

Parameters

expression Any value between -1 and 1 inclusive.

Return Value

Returns the trigonometric arccosine of expression. Result is in radians.

Remarks

ACos(x) is mathematically defined only for -1 < x < 1, so ACos tends to return -1.#IND for other values of x.

Related

Sin, Cos, Tan, ASin, ATan

Example

$x = ACos(0.5)

$pi = 3.14159265358979
$radToDeg = 180 / $pi
$y = ACos(-1) * $radToDeg ;arcCosine of -1 returns 180°


Function ASin

Function Reference

ASin

Calculates the arcsine of a number.

ASin ( expression )

Parameters

expression Any value between -1 and 1 (inclusive).

Return Value

Returns the trigonometric arcsine of expression. Result is in radians.

Remarks

ASin(x) is mathematically defined only for -1 < x < 1, so ASin tends to return -1.#IND for other values of x.

Related

Sin, Cos, Tan, ACos, ATan

Example

$x = ASin(0.5)

$pi = 3.14159265358979
$radToDeg = 180 / $pi
$y = ASin(1) * $radToDeg ;arcsine of 1 returns 90°


Function ATan

Function Reference

ATan

Calculates the arctangent of a number.

ATan ( expression )

Parameters

expression Any valid numeric expression.

Return Value

Returns the trigonometric arctangent of expression. Result is in radians.

Remarks

The result of 4 * ATan(1) is pi.

Related

Sin, Cos, Tan, ASin, ACos

Example

$x = ATan(0.5)

$pi = 4 * ATan(1) ;equals 3.14159265358979
$radToDeg = 180 / $pi
$y = ATan(1) * $radToDeg ;arctangent of 1 returns 45°


Function BitAND

Function Reference

BitAND

Performs a bitwise AND operation.

BitAND ( value1, value2 [, value n] )

Parameters

value1 | The first number.
value2 | The second number.
value n | [optional] The nth number - up to 255 values can be specified.

Return Value

Returns the value of the parameters bitwise-AND'ed together.
Bit operations are performed as 32-bit integers.

Remarks

Remember hex notation can be used for numbers.
BitAND returns 1 in each bit position where all input arguments have a 1 in the corresponding
position and 0 in all others,

Related

BitNOT, BitOR, BitShift, BitXOR, Hex, BitRotate

Example

$x = BitAND(13, 7) ;x == 5 because 1101 AND 0111 = 0101

$x = BitAND(2, 3, 6) ;x == 2 because 0010 AND 0011 AND 0110 = 0010


Function BitNOT

Function Reference

BitNOT

Performs a bitwise NOT operation.

BitNOT ( value )

Parameters

value The number to operate on.

Return Value

Returns the bitwise NOT of the value.
Bit operations are performed as 32-bit integers.

Remarks

Remember hex notation can be used for numbers.
Remember that in 2's-complement notation, BitNOT is functionally equivalent to adding 1 and negating the result.
Also remember that NOT changes a 0 bit to 1 and vice-versa.

Related

BitAND, BitOR, BitShift, BitXOR, Hex, BitRotate

Example

$x = BitNot(5)

#cs Comments:
Result is -6 because for 32-bit numbers
5 == 00000000000000000000000000000101 binary
-6 == 11111111111111111111111111111010 binary
and the first bit is signed
#ce


Function BitOR

Function Reference

BitOR

Performs a bitwise OR operation.

BitOR ( value1, value2 [, value n] )

Parameters

value1 | The first number.
value2 | The second number.
value n | [optional] The nth number - up to 255 values can be specified.

Return Value

Returns the two parameters bitwise-OR'ed together.
Bit operations are performed as 32-bit integers.

Remarks

Remember hex notation can be used for numbers.
BitOR returns 0 in each bit position where all input arguments have a 0 in the corresponding
position and 1 wherever there is at least one 1-bit.

Related

BitAND, BitNOT, BitShift, BitXOR, Hex, BitRotate

Example

$x = BitOR(3, 6) ;x == is 7 because 0011 OR 0110 = 0111

$x = BitOR(3, 15, 32) ;x == 47 because 0011 OR 1111 OR 00100000 = 00101111


Function BitRotate

Function Reference

BitRotate

Performs a bit shifting operation, with rotation.

BitRotate ( value , shift [, size] )

Parameters

value | The number to be operate on.
shift | Number of bits to rotate to the left (negative numbers shift right). If not given, the default is 1.
size | [optional] A string that determines the rotation size, the default is (16 bits). See below.

Size parameter :
"B" | rotate bits within the low-order byte (8 bits).
"W" | rotate bits within the low-order word (16 bits).
"D" | rotate bits within the entire double-word (32 bits).

Return Value

Success: | Returns the value rotated by the required number of bits.
Failure: | Set @error if size is invalid
Bit operations are performed as 32-bit integers.

Remarks

Remember hex notation can be used for numbers.

Related

BitShift, BitAND, BitNOT, BitOR, BitXOR, Hex

Example

$x = BitRotate(7, 2)
; x == 3 because 111b left-rotated twice is 1 1100b == 28

$y = BitRotate(14, -2)
; y == 32771 because 1110b right-rotated twice on 16 bits is 1000 0000 0000 0011b == 32771

$z = BitRotate(14, -2, "D")
; z == -2147483645 because 1110b right-rotated twice on 16 bits is 1000 0000 0000 0000 0000 0000 0000 0011b == 2147483645


Function BitShift

Function Reference

BitShift

Performs a bit shifting operation.

BitShift ( value, shift )

Parameters

value | The number to be shifted.
shift | Number of bits to shift to the right (negative numbers shift left).

Return Value

Returns the value shifted by the required number of bits.
Bit operations are performed as 32-bit integers.

Remarks

Remember hex notation can be used for numbers.
Right shifts are equivalent to halving; left shifts to doubling.

Related

BitAND, BitNOT, BitOR, BitXOR, Hex, BitRotate

Example

$x = BitShift(14, 2)
; x == 3 because 1110b right-shifted twice is 11b == 3

$y = BitShift(14, -2)
; y == 56 because 1110b left-shifted twice is 111000b == 56

$z = BitShift( 1, -31)
; z == -2147483648 because in 2's-complement notation, the
; 32nd digit from the right has a negative sign.


Function BitXOR

Function Reference

BitXOR

Performs a bitwise exclusive OR (XOR) operation.

BitXOR ( value1, value2 [, value n] )

Parameters

value1 | The first number.
value2 | The second number.
value n | [optional] The nth number - up to 255 values can be specified.

Return Value

Returns the value of the parameters bitwise-XOR'ed together.
Bit operations are performed as 32-bit integers.

Remarks

Remember hex notation can be used for numbers.
BitXOR returns 1 in a bit position if there are an odd number 1's in the corresponding bit position in all the input arguments, and 0 otherwise.

Related

BitAND, BitNOT, BitOR, BitShift, Hex, BitRotate

Example

$x = BitXOR(10, 6) ;x == 12 because 1010b XOR 0110b == 1100

$x = BitXOR(2, 3, 6) ;x == 7 because 0010 XOR 0011 XOR 0110 = 0111


Function Cos

Function Reference

Cos

Calculates the cosine of a number.

Cos ( expression )

Parameters

expression Value in radians.

Return Value

Returns the trigonometric cosine of number.

Remarks

1° = pi / 180 radians.

Related

Sin, Tan, ASin, ACos, ATan

Example

$pi = 3.14159265358979
$x = cos($pi / 4)

$degToRad = $pi / 180
$y = Cos(90 * $degToRad) ;cosine of 90°


Function Ceiling

Function Reference

Ceiling

Returns a number rounded up to the next integer.

Ceiling ( expression )

Parameters

expression Any valid numeric expression.

Return Value

Returns the rounded number.

Remarks

None

Related

Int, Number, Floor, Round

Example

Dim $msg

$msg = ""
$msg = $msg & "Ceiling(4.8) = " & Ceiling(4.8) & @CR
$msg = $msg & "Ceiling(4.5) = " & Ceiling(4.5) & @CR
$msg = $msg & "Ceiling(4.3) = " & Ceiling(4.3) & @CR
$msg = $msg & "Ceiling(4) = " & Ceiling(4) & @CR
$msg = $msg & "Ceiling(-4.3) = " & Ceiling(-4.3) & @CR
$msg = $msg & "Ceiling(-4.5) = " & Ceiling(-4.5) & @CR
$msg = $msg & "Ceiling(-4.8) = " & Ceiling(-4.8) & @CR
$msg = $msg & "Ceiling(-4) = " & Ceiling(-4) & @CR

MsgBox(64, "Testing", $msg)


Function Exp

Function Reference

Exp

Calculates e to the power of a number.

Exp ( expression )

Parameters

expression Any valid numeric expression.

Return Value

Returns e raised to the power of expression.

Remarks

e is the base of the natural logarithm and is approximately 2.71828182845905

Related

Log

Example

$x = Exp(5) ;returns 148.413159102577


Function Floor

Function Reference

Floor

Returns a number rounded down to the closest integer.

Floor ( expression )

Parameters

expression Any valid numeric expression.

Return Value

Returns the rounded number.

Remarks

None

Related

Int, Number, Round, Ceiling

Example

Dim $msg

$msg = ""

$msg = $msg & "Floor(4.8) = " & Floor(4.8) & @CR
$msg = $msg & "Floor(4.5) = " & Floor(4.5) & @CR
$msg = $msg & "Floor(4.3) = " & Floor(4.3) & @CR
$msg = $msg & "Floor(4) = " & Floor(4) & @CR
$msg = $msg & "Floor(-4.3) = " & Floor(-4.3) & @CR
$msg = $msg & "Floor(-4.5) = " & Floor(-4.5) & @CR
$msg = $msg & "Floor(-4.8) = " & Floor(-4.8) & @CR
$msg = $msg & "Floor(-4) = " & Floor(-4) & @CR

MsgBox(64, "Testing", $msg)


Function Log

Function Reference

Log

Calculates the natural logarithm of a number.

Log ( expression )

Parameters

expression Any positive number.

Return Value

Success: | Returns the parameter's natural logarithm.
Failure: | Tends to return -1.#IND for non-positive parameters.

Remarks

@error is always 0

Related

Exp

Example

$x = Log(1000) ;returns 6.90775527898214

$y = Log10(1000) ;returns 3

; user-defined function for common log
Func Log10($x)
Return Log($x) / Log(10) ;10 is the base
EndFunc


Function Mod

Function Reference

Mod

Performs the modulus operation.

Mod ( value1, value2 )

Parameters

value1 | The dividend.
value2 | The divisor.

Return Value

Success: | Returns the remainder when value1 is divided by value2.
Failure: | Returns -1.#IND if the divisor is zero.

Remarks

This function guarantes that dividend = (dividend / divisor) * divisor + Mod(dividend, divisor).

This function does not guarantee that dividend or divisor can be represented accurately, specifically with floating point numbers.

If integers are passed this function does an integral modulo operation. Otherwise it falls back to a floating point operation which per the previous remark means it may not produce the expected output.

Related

None.

Example

$n = 18
If mod($n, 2) = 0 Then
MsgBox(0,"", $n & " is an even number.")
Else
MsgBox(0, "", $n & " is an odd number.")
EndIf

$x = mod(4, 7) ;$x == 4 because the divisor > dividend

$y = mod(1, 3/4) ;$y == 0.25 because the divisor is a float


Function Random

Function Reference

Random

Generates a pseudo-random float-type number.

Random ( [Min [, Max [, Flag]]] )

Parameters

Min | [optional] The smallest number to be generated. The default is 0.
Max | [optional] The largest number to be generated. The default is 1.
Flag | [optional] If this is set to 1 then an integer result will be returned. Default is a floating point number.

Return Value

Success: | Returns a pseudo-random number between Min and Max.
Failure: | Returns 0 and sets @error flag to 1 if bad parameters.

Remarks

By default the Random function works with decimal/floating point numbers. If you want to only have integer/whole number results then set the Flag to 1.

If only one argument is provided, then it is interpreted to be the Max.

The result will be in the range of Min to Max INCLUSIVE when using integers (just short of Max when using floats).

When using integers Max-Min must be less than 2^31.

Comments based on the original source

This function uses the Mersenne Twister random number generator, MT19937, written by Takuji Nishimura, Makoto Matsumoto, Shawn Cokus, Matthe Bellew and Isaku Wada.

The Mersenne Twister is an algorithm for generating random numbers. It was designed with consideration of the flaws in various other generators. The period, 219937-1, and the order of equidistribution, 623 dimensions, are far greater. The generator is also fast; it avoids multiplication and division, and it benefits from caches and pipelines. For more information see the inventors' web page at http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html

Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Related

Round, SRandom

Example

;Flip of coin
If Random() < 0.5 Then ; Returns a value between 0 and 1.
$msg = "Heads. 50% Win"
Else
$msg = "Tails. 50% Loss"
Endif
MsgBox(0,"Coin toss", $msg )

;Roll of a die
msgBox(0, "Roll of die", "You rolled a " & Random(1, 6, 1) )

$StockPrice = 98
;In the middle of a stock market simulation game
$StockPriceChange = Random(-10, 10, 1) ; generate an integer between -10 and 10
$StockPrice = $StockPrice + $StockPriceChange
If $StockPriceChange < 0 Then
MsgBox(4096, "Stock Change", "Your stock dropped to $" & $StockPrice)
ElseIf $StockPriceChange > 0 Then
MsgBox(4096, "Stock Change", "Your stock rose to $" & $StockPrice)
Else
MsgBox(4096, "Stock Change", "Your stock stayed at $" & $StockPrice)
Endif

;Random letter
If Random() < 0.5 Then
;Capitals
$Letter = Chr(Random(Asc("A"), Asc("Z"), 1))
Else
;Lower case
$Letter = Chr(Random(Asc("a"), Asc("z"), 1))
Endif


Function Round

Function Reference

Round

Returns a number rounded to a specified number of decimal places.

Round ( expression [, decimalplaces] )

Parameters

expression | Any valid numeric expression.
decimalplaces | [optional] Number indicating how many places to the right of the decimal are included in the rounding. If omitted, Round returns an integer.

Return Value

Returns rounded number.

Remarks

The decimalplaces parameter can be negative which allows you to round to the ones, tens, hundred, etc. place. Note that up to fifteen digits of a number are displayed, and note that decimalplaces will never pad a number with trailing zeros.

Related

Int, Number, Ceiling, Floor, Random

Example

$x = Round(-1.582, 1) ;returns -1.6
$y = Round(3.1415, 9) ;no change
$z = Round(123.5, -1) ;returns 120


Function Sin

Function Reference

Sin

Calculates the sine of a number.

Sin ( expression )

Parameters

expression Value in radians.

Return Value

Returns the trigonometric sine of number.

Remarks

1° = pi / 180 radians.

Related

Cos, Tan, ASin, ACos, ATan

Example

$pi = 3.14159265358979
$x = sin($pi / 4) ;returns 0.707106781186547 which you should recognize as sqrt(2)/2

$degToRad = $pi / 180
$y = Sin(90 * $degToRad) ;sine of 90°


Function Sqrt

Function Reference

Sqrt

Calculates the square-root of a number.

Sqrt ( expression )

Parameters

expression Any nonnegative expression to get the square-root of.

Return Value

Success: | Returns the square-root.
Failure: | Returns -1.#IND if parameter is negative.

Remarks

To compute an nth root, use the power operator: x ^ (1/n)
MsgBox(0,"The cube root of 27 is", 27 ^ (1/3) )

Related

None.

Example

$x = Sqrt(2) ;returns 1.4142135623731
$y = sqrt(9) ;returns 3


Function SRandom

Function Reference

SRandom

Set Seed for random number generation.

SRandom ( Seed )

Parameters

Seed Seed value for random number generation. Number between -2^31 and 2^31-1

Return Value

None.

Remarks

None.

Related

Random

Example

SRandom(12)
$rand=Random()


Function Tan

Function Reference

Tan

Calculates the tangent of a number.

Tan ( expression )

Parameters

expression Value in radians.

Return Value

Returns the trigonometric tangent of number.

Remarks

1° = pi / 180 radians.
Note that Tan is "infinite" for ... -3PI/2, -PI/2, PI/2, 3PI/2, 5PI/2, ... and tends to return 1.63317787283838e+016 for such multiples of Pi-halves.

Related

Sin, Cos, ASin, ACos, ATan

Example

$pi = 3.14159265358979
$x = tan($pi / 4)

$degToRad = $pi / 180
$y = Tan(90 * $degToRad) ;tangent of 90°


Functions

Message Boxes and Dialogs functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
InputBox | Displays an input box to ask the user to enter a string.
MsgBox | Displays a simple message box with optional timeout.
ProgressOff | Turns Progress window off.
ProgressOn | Creates a customizable progress bar window.
ProgressSet | Sets the position and/or text of a previously created Progress bar window.
SplashImageOn | Creates a customizable image popup window.
SplashOff | Turns SplashText or SplashImage off.
SplashTextOn | Creates a customizable text popup window.
ToolTip | Creates a tooltip anywhere on the screen.


Function InputBox

Function Reference

InputBox

Displays an input box to ask the user to enter a string.

InputBox ( "title", "prompt" [, "default" [, "password char" [, width [, height [, left [, top [, timeout [, hwnd]]]]]]]] )

Parameters

title | The title of the input box.
prompt | A message to the user indicating what kind of input is expected.
default | [optional] The value that the input box starts with.
password char | [optional] The character to replace all typed characters with in the display. If you want the actual typed character to appear, define with an empty string ("") (default) or a space for the first character. If you provide a multi-character string, only the first character is used for character masking. There are special meanings for the second and subsequent characters. See Remarks.
width | [optional] The width of the window.
height | [optional] The height of the window.
left | [optional] The left side of the input box. By default, the box is centered.
top | [optional] The top of the input box. By default, the box is centered.
timeout | [optional] How many seconds to wait before automatically cancelling the InputBox.
hwnd | [optional] The window handle to use as the parent for this dialog.

Return Value

Success: | Returns the string that was entered.
Failure: | Returns "" (blank string) and sets @error as follows:
@Error | 0 = The string returned is valid.
 | 1 = The Cancel button was pushed.
 | 2 = The Timeout time was reached.
 | 3 = The InputBox failed to open. This is usually caused by bad arguments.
 | 4 = The InputBox cannot be displayed on any monitor.
 | 5 = Invalid parameters width without height or left without top.

Remarks

The InputBox is user-resizable, but has a minimum size of approximately 190 x 115 pixels. Default size is approximately 250 x 190 pixels.

The string returned will not exceed 254 characters and if input contains carriage returns or linefeeds, the result will be truncated at the first occurrence of those characters.

The second and subsequent characters of the password field can be used to restrict input. Use a space to fill the first character to still see the characters typed. Putting an M after the first character indicates that input is Mandatory; i.e. you must enter something. Nothing will happen if you press the Ok button when there is nothing in the InputBox. It will not close and return the string.

You can also specify the maximum length at the end of the password field. Just enter a number as the last character(s) to specify the length of the string.

Related

MsgBox

Example

;Places the input box in the top left corner displaying the characters as they
;are typed.
$answer = InputBox("Question", "Where were you born?", "Planet Earth", "", _
-1, -1, 0, 0)

;Asks the user to enter a password. Don't forget to validate it!
$passwd = InputBox("Security Check", "Enter your password.", "", "*")

;Asks the user to enter a 1 or 2 character response. The M in the password
;field indicates that blank string are not accepted and the 2 indicates that the
;responce will be at most 2 characters long.
$value = InputBox("Testing", "Enter the 1 or 2 character code.", "", " M2")


Function MsgBox

Function Reference

MsgBox

Displays a simple message box with optional timeout.

MsgBox ( flag, "title", "text" [, timeout [, hwnd]] )

Parameters

flag | The flag indicates the type of message box and the possible button combinations. See remarks.
title | The title of the message box.
text | The text of the message box.
timeout | [optional] Timeout in seconds. After the timeout has elapsed the message box will be automatically closed. The default is 0, which is no timeout.
hwnd | [optional] The window handle to use as the parent for this dialog.

Return Value

Success: | Returns the ID of the button pressed.
Failure: | Returns -1 if the message box timed out.

Button Pressed | Return Value
OK | 1
CANCEL | 2
ABORT | 3
RETRY | 4
IGNORE | 5
YES | 6
NO | 7
TRY AGAIN ** | 10
CONTINUE ** | 11

Remarks

The flag parameter can be a combination of the following values:

decimal flag | Button-related Result | hexadecimal flag
0 | OK button | 0x0
1 | OK and Cancel | 0x1
2 | Abort, Retry, and Ignore | 0x2
3 | Yes, No, and Cancel | 0x3
4 | Yes and No | 0x4
5 | Retry and Cancel | 0x5
6 ** | Cancel, Try Again, Continue | 0x6
decimal flag | Icon-related Result | hexadecimal flag
0 | (No icon) | 0x0
16 | Stop-sign icon | 0x10
32 | Question-mark icon | 0x20
48 | Exclamation-point icon | 0x30
64 | Information-sign icon consisting of an 'i' in a circle | 0x40
decimal flag | Default-related Result | hexadecimal flag
0 | First button is default button | 0x0
256 | Second button is default button | 0x100
512 | Third button is default button | 0x200
decimal flag | Modality-related Result | hexadecimal flag
0 | Application | 0x0
4096 | System modal (dialog has an icon) | 0x1000
8192 | Task modal | 0x2000
decimal flag | Miscellaneous-related Result | hexadecimal flag
0 | (nothing else special) | 0x0
262144 | MsgBox has top-most attribute set | 0x40000
524288 | title and text are right-justified | 0x80000

** Only valid on Windows 2000/XP and above.

For example, to specify a SYSTEMMODAL box with the YES/NO buttons the flag value would be 4096+4 (or 4100) If using hexadecimal flags, that would be 0x1000+0x4 (or 0x1004).

A message box appears centered on screen and resizes according to the text it contains. However, the title could get truncated if the SYSTEMMODAL flag (4096) is used..

If "title" is equal to Default keyword @Scriptname is used

Related

InputBox, ToolTip, TrayTip, SplashTextOn

Example

MsgBox(4096, "Test", "This box will time out in 10 seconds", 10)


Function ProgressOff

Function Reference

ProgressOff

Turns Progress window off.

ProgressOff ( )

Parameters

None.

Return Value

None.

Remarks

None.

Related

ProgressSet, ProgressOn

Example

ProgressOff()


Function ProgressOn

Function Reference

ProgressOn

Creates a customizable progress bar window.

ProgressOn ( "title", "maintext" [, "subtext" [, x pos [, y pos [, opt]]]] )

Parameters

title | Title for progress window.
maintext | Text for Main, Bold, Upper label.
subtext | [optional] text for Sub, Normal, Lower label. (default is blank)
x pos | [optional] position from left (in pixels) of progress window. (default is centered)
y pos | [optional] position from top (in pixels) of progress window. (default is centered)
opt | [optional] Default is 'always on top/with title' Add up the following options you want: 1 = borderless, titleless window 2 = Without "always on top" attribute 16 = Window can be moved

Return Value

None.

Remarks

To skip an optional parameter, leaving it's default value intact, use:
"" for string parameters
-1 for numeric parameters
If ProgressOn is called while a progress window already exists, the window is redrawn/moved. (If you want multiple simultaneous progress windows, you need to use multiple scripts.)

Related

ProgressOff, ProgressSet

Example

ProgressOn("Progress Meter", "Increments every second", "0 percent")
For $i = 10 to 100 step 10
sleep(1000)
ProgressSet( $i, $i & " percent")
Next
ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()


Function ProgressSet

Function Reference

ProgressSet

Sets the position and/or text of a previously created Progress bar window.

ProgressSet ( percent [, "subtext" [, "maintext"]] )

Parameters

percent | Percentage (value between 0. and 100.) to set the progress bar at.
subtext | [optional] Set the text for the Sub, Normal, Lower label.
maintext | [optional] Set the text for the Main, Bold, Upper label.

Return Value

None.

Remarks

Notice that the subtext argument comes before maintext.

Related

ProgressOff, ProgressOn

Example

ProgressOn("Progress Meter", "Increments every second", "0 percent")
For $i = 10 to 100 step 10
sleep(1000)
ProgressSet( $i, $i & " percent")
Next
ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()


Function SplashImageOn

Function Reference

SplashImageOn

Creates a customizable image popup window.

SplashImageOn ( "title", "file" [, width [, height [, x pos [, y pos [, opt]]]]] )

Parameters

title | Title for splash window.
file | full path\filename of image (BMP, GIF, or JPG)
width | [optional] width of window in pixels. (default is 500)
height | [optional] height of window in pixels. (default is 400)
x pos | [optional] position from left (in pixels) of splash window. (default is centered)
y pos | [optional] position from top (in pixels) of splash window. (default is centered)
opt | [optional] Add up the options you want. Default is 'always on top/with title' 1 = Thin bordered titleless window 2 = Without "always on top" attribute 16 = Windows can be moved

Return Value

None.

Remarks

To skip an optional parameter, leaving it's default value intact, use a value of -1.

The image is scaled to specified width and height and should be a Bitmap, GIF, or JPEG image. Icons (ICOs) will not display, though the window still appears. PNG images throw an error message of failing to load, and so do invalid files/paths.

Images are not embedded in the executable unless you use FileInstall

Only one SplashImage/Text window is allowed at one time; so if you wish to cycle through multiple images/text, simply call SplashImageOn/SplashTextOn again with the new information.

Splash with opt=1 cannot be moved and cannot be activated by click.

Related

SplashOff, SplashTextOn

Example

$destination = "..\GUI\mslogo.jpg"

SplashImageOn("Splash Screen", $destination,250,50)
Sleep(3000)
SplashOff()


Function SplashOff

Function Reference

SplashOff

Turns SplashText or SplashImage off.

SplashOff ( )

Parameters

None.

Return Value

None.

Remarks

None.

Related

SplashImageOn, SplashTextOn

Example

SplashTextOn("Example", "Splash Screen")
Sleep(5000)
SplashOff()


Function SplashTextOn

Function Reference

SplashTextOn

Creates a customizable text popup window.

SplashTextOn ( "title", "text" [, w [, h [, x pos [, y pos [, opt [, "fontname" [, fontsz [, fontwt ]]]]]]]] )

Parameters

title | Title for splash window.
text | Text for splash window.
w | [optional] Width of window in pixels. (default 500)
h | [optional] Height of window in pixels. (default 400)
x pos | [optional] Position from left (in pixels) of splash window. (default is centered)
y pos | [optional] Position from top (in pixels) of splash window. (default is centered)
opt | [optional] Add them up - default is 'center justified/always on top/with title' 0 = Center justified/always on top/with title (default) 1 = Thin bordered titleless window 2 = Without "always on top" attribute 4 = Left justified text 8 = Right justified text 16 = Windows can be moved 32 = Center text vertically
fontname | [optional] Font to use. (OS default GUI font is used if the font is "" or is not found)
fontsz | [optional] Font size. (default is 12; standard sizes are 6 8 9 10 11 12 14 16 18 20 22 24 26 28 36 48 72)
fontwt | [optional] Font weight (0 - 1000, default = 400 = normal). A value > 1000 is treated as zero.

Return Value

Return the Handle of the splash window that can be used in ControlSetText.

Remarks

To skip an optional parameter, leaving it's default value intact, use:
"" for a string parameters
-1 for a numeric parameters

Only one SplashImage/Text window is allowed at one time; so if you wish to cycle through multiple images/text, simply call SplashImageOn/SplashTextOn again with the new information.

Even better is to use ControlSetText to update text without flicker...
If the text is center and multiline, the ControlSetText will not override the number of lines created by the SplashTextOn.

Splash with opt=1 cannot be moved and cannot be activated by click.

Standard font names include:
Arial, Comic Sans MS, Courier New, Lucida Console, Microsoft Sans Serif, System, Tahoma, Times New Roman, and WingDings
See Appendix for a complete font list

Use @LF to display several lines.

Related

SplashOff, SplashImageOn, ControlSetText, ToolTip, MsgBox

Example

SplashTextOn("Title", "Message goes here.", -1, -1, -1, -1, 4, "", 24)
Sleep(3000)
SplashOff()

;; FLICKER
$message = ""
SplashTextOn("TitleFoo", $message, -1, -1, -1, -1, 4, "")
For $x = 1 to 20
$message = $message & $x & @LF
SplashTextOn("TitleFoo", $message, -1, -1, -1, -1, 4, "")
Sleep(100)
Next

;; SMOOTH
$message = ""
SplashTextOn("TitleFoo", $message, -1, -1, -1, -1, 4, "")
For $x = 1 to 20
$message = $message & $x & @LF
ControlSetText("TitleFoo", "", "Static1", $message)
sleep(100)
Next


Function ToolTip

Function Reference

ToolTip

Creates a tooltip anywhere on the screen.

ToolTip ( "text" [, x [, y [, "title" [, icon [, options]]]]] )

Parameters

text | The text of the tooltip. (An empty string clears a displaying tooltip)
x | [optional] The x position of the tooltip.
y | [optional] The y position of the tooltip.
title | [optional] The title for the tooltip Requires IE5+
icon | [optional] Pre-defined icon to show next to the title: Requires a title. 0 = No icon, 1 = Info icon, 2 = Warning icon, 3 = Error Icon
options | [optional] Sets different options for how the tooltip will be displayed (Can be added together): 1 = Display as Balloon Tip Requires IE5+ 2 = Center the tip at the x,y coordinates instead of using them for the upper left corner. 4 = Force the tooltip to always be visible confining it to monitor borders if necessary. If multiple monitors are used, then the tooltip will "snap-to" the nearest monitor.

Return Value

Success: | Returns 1.
Failure: | Returns 0 when title length is greater than 99.

Remarks

To skip an optional parameter, leaving it's default value intact, use the Default keyword.

If the x and y coordinates are omitted the, tip is placed near the mouse cursor.
A Tooltip will appear until the script terminates or ToolTip("") is called.
You may use @CR or @LF to create multi-line tooltips.
To display an icon, you must specify a non-empty title. The icon appears on the same row as the title and thus requires a title to be present.
If using the center flag, the center of the tooltip will be at the coordinates specified. If using the center flag with a Balloon Tip, the stem will be centered on the balloon and will point to the coordinates specified.

Related

TrayTip, MsgBox, SplashTextOn

Example

; This will create a tooltip in the upper left of the screen
ToolTip("This is a tooltip", 0, 0)
Sleep(2000) ; Sleep to give tooltip time to display


Functions

Misc. functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
AdlibRegister | Registers an Adlib function.
AdlibUnRegister | Unregisters an adlib function.
AutoItSetOption | Changes the operation of various AutoIt functions/parameters.
AutoItWinGetTitle | Retrieves the title of the AutoIt window.
AutoItWinSetTitle | Changes the title of the AutoIt window.
BlockInput | Disable/enable the mouse and keyboard.
Break | Enables or disables the users' ability to exit a script from the tray icon menu.
Call | Calls a user-defined function contained in a string parameter.
CDTray | Opens or closes the CD tray.
Execute | Execute an expression.
OnAutoItExitRegister | Registers a function to be called when AutoIt exits.
OnAutoItExitUnRegister | UnRegisters a function that was called when AutoIt exits.
AutoItSetOption | Changes the operation of various AutoIt functions/parameters.
SetError | Manually set the value of the @error macro.
SetExtended | Manually set the value of the @extended macro.
VarGetType | Returns the internal type representation of a variant.


Function AdlibRegister

Function Reference

AdlibRegister

Registers an Adlib function.

AdlibRegister ( "function" [, time] )

Parameters

function | The name of the adlib function to be registered.
time | [optional] how often in milliseconds to call the function. Default is 250 ms.

Return Value

None.

Remarks

Every 250 ms (or time ms) the specified "function" is called--typically to check for unforeseen errors. For example, you could use adlib in a script which causes an error window to pop up unpredictably.
The adlib function should be kept simple as it is executed often and during this time the main script is paused. Also, the time parameter should be used carefully to avoid CPU load.

Several Adlib functions can be registered. Re-registering an already existing Adlib function will update it with a new time.

Related

AdlibUnRegister

Example

AdlibRegister("MyAdlib")
;...
Exit

Func MyAdlib()
;... execution must be non blocking, avoid ...Wait(), MsgBox(), InputBox() functions
If WinActive("Error") Then
;...
EndIf
EndFunc


Function AdlibUnRegister

Function Reference

AdlibUnRegister

Unregisters an adlib function.

AdlibUnRegister( [ "function" ] )

Parameters

function [optional] The name of the adlib function to be Unregistered. See remarks for more information.

Return Value

Remarks

If the function name is not specified then the last registered function will be unregistered.

Related

AdlibRegister

Example

AdlibRegister("MyAdlib")
;...
AdlibUnRegister("MyAdlib")

Func MyAdlib()
;... execution must be non blocking, avoid ...Wait(), MsgBox(), InputBox() functions
EndFunc


Function AutoItWinGetTitle

Function Reference

AutoItWinGetTitle

Retrieves the title of the AutoIt window.

AutoItWinGetTitle ( )

Parameters

None.

Return Value

Returns a string containing the title of the AutoIt window.

Remarks

None.

Related

AutoItWinSetTitle, WinGetTitle

Example

$a = AutoItWinGetTitle()


Function AutoItWinSetTitle

Function Reference

AutoItWinSetTitle

Changes the title of the AutoIt window.

AutoItWinSetTitle ( "newtitle" )

Parameters

newtitle The new title to give to the window.

Return Value

None.

Remarks

The AutoIt window is usually hidden. The purpose of changing the title is to allow other programs (or other AutoIt scripts) to interact with AutoIt.

Related

AutoItWinGetTitle, WinSetTitle

Example

AutoItWinSetTitle("My AutoIt Window")


Function BlockInput

Function Reference

BlockInput

Disable/enable the mouse and keyboard.

BlockInput ( flag )

Parameters

flag 1 = Disable user input
0 = Enable user input

Return Value

Success: | Returns 1.
Failure: | Returns 0. Already Enable or #requireAdmin not used.

Remarks

The table below shows how BlockInput behavior depends on the Windows version; however, pressing Ctrl+Alt+Del on any platform will re-enable input due to a Windows API feature.

Operating System | "BlockInput" Results
Windows 2000 | User input is blocked and AutoIt can simulate mouse and keyboard input.
Windows XP | User input is blocked and AutoIt can simulate mouse and keyboard input. See remarks below for an issue with Windows XP SP1.
Windows Vista | User input is blocked and AutoIt can simulate mouse and keyboard if #RequireAdmin is used.

A Windows hotfix was released for Windows XP SP1 that contained a bug that prevents the Alt keystroke from being sent (via the Send() function) while BlocKInput() is active. The Windows bug is fixed in Windows XP SP2 and newer.

BlockInput() only affects user-input. Input from functions like Send() or MouseMove() still work.

Related

Send

Example

BlockInput(1)

Run("notepad")
WinWaitActive("[CLASS:Notepad]")
Send("{F5}") ;pastes time and date

BlockInput(0)


Function Break

Function Reference

Break

Enables or disables the users' ability to exit a script from the tray icon menu.

Break ( mode )

Parameters

mode Sets the script break mode:
1 = Break is enabled (user can quit) (default)
0 = Break is disabled (user cannot quit)

Return Value

None.

Remarks

Please only disable break with good reason.
AutoIt normally creates a tray icon when running, and right-clicking this icon allows the user to pause or exit the script. If Break is disabled (0), then the user cannot terminate the script this way.

Related

None.

Example

Break(0) ;Disable break


Function Call

Function Reference

Call

Calls a user-defined function contained in a string parameter.

Call ( "function" [, param1 [, param2 [, paramN ]]] )

Parameters

function | The name of the user function to call.
param | Arguments that will be passed to the function being invoked.

Return Value

Success: | Returns the return value of the called function. Both @error and @extended may contain values if the called function set them.
Failure: | Sets @error to 0xDEAD and @extended to 0xBEEF if the function does not exist or invalid number of parameters.

Remarks

The function cannot be a built-in AutoIt function or plug-in function.
The function can pass arguments to functions, however, ByRef parameters are not supported; there is no way to retrieve the ByRef parameter.
A special array can be passed in lieu of individual parameters. This array must have it's first element set to "CallArgArray" and elements 1 - n will be passed as seperate arguments to the function. If using this special array, no other arguments can be passed to Call(). See example for a demonstration.
Both Call() itself can set @error or the called function can set @error. If Call() sets @error the value will be 0xDEAD and @extended will also be set to 0xBEEF. See the example for a demonstration of testing for a function that was not found.

Related

Execute

Example

; This calls a function accepting no arguments.
Call("Test1")

; This calls a function accepting one argument and passes it an argument.
Call("Test2", "Message from Call()!")

; This demonstrates how to use the special array argument.
Global $aArgs[4]
$aArgs[0] = "CallArgArray" ; This is required, otherwise, Call() will not recognize the array as containing arguments
$aArgs[1] = "This is a string" ; Parameter one is a string
$aArgs[2] = 47 ; Parameter two is a number
Global $array[2]
$array[0] = "Array Element 0"
$array[1] = "Array Element 1"
$aArgs[3] = $array ; Parameter three is an array

; We've built the special array, now call the function
Call("Test3", $aArgs)

; Test calling a function that does not exist. This shows the proper way to test by
; checking that both @error and @extended contain the documented failure values.
Local Const $sFunction = "DoesNotExist"
Call($sFunction)
If @error = 0xDEAD And @extended = 0xBEEF Then MsgBox(4096, "", "Function does not exist.")

Func Test1()
MsgBox(4096, "", "Hello")
EndFunc

Func Test2($sMsg)
MsgBox(4096, "", $sMsg)
EndFunc

Func Test3($sString, $nNumber, $aArray)
MsgBox(4096, "", "The string is: " & @CRLF & $sString)
MsgBox(4096, "", "The number is: "& @CRLF & $nNumber)
For $i = 0 To UBound($aArray) - 1
MsgBox(4096, "", "Array[" & $i & "] contains:" & @CRLF & $aArray[$i])
Next
EndFunc


Function CDTray

Function Reference

CDTray

Opens or closes the CD tray.

CDTray ( "drive", "status" )

Parameters

drive | The drive letter of the CD tray to control, in the format D:, E:, etc.
status | Specifies if you want the CD tray to be open or closed: "open" or "closed"

Return Value

Success: | Returns 1.
Failure: | Returns 0 if drive is locked via CD burning software or if the drive letter is not a CD drive.

Remarks

CDTray works as expected with virtual CD drives such as DAEMON Tools.
CDTray does not work on non-local/mapped CD drives; CDTray must be run from the computer whose drive it affects.
CDTray("X:", "close") tends to return 0 even on laptop-style cd trays that can only be closed manually.

Related

DriveGetType, DriveStatus

Example

; Open the CD tray on drive E:
CDTray("E:", "open")


Function Execute

Function Reference

Execute

Execute an expression.

Execute ( string )

Parameters

string string representing an expression to be evaluated.

Return Value

Success: | Returns the value of the evaluated expression.
Failure: | Returns "" (blank string) with @error set not to 0.

Remarks

None.

Related

Assign, Eval, Call

Example

$a=1
$v=Execute("$a+1") ; $v is set to 2


Function OnAutoItExitRegister

Function Reference

OnAutoItExitRegister

Registers a function to be called when AutoIt exits.

OnAutoItExitRegister( "function" )

Parameters

function The name of the user function to call.

Return Value

Success: | Returns 1. @extended can be set if already registered.
Failure: | Returns 0.

Remarks

The exit code can be retrieved with @ExitCode.
The mode of exit can be retrieved with @ExitMethod.
0 | Natural closing.
1 | close by Exit function.
2 | close by clicking on exit of the systray.
3 | close by user logoff.
4 | close by Windows shutdown.

Related

OnAutoItExitUnRegister, Exit

Example

OnAutoItExitRegister("MyTestFunc")
OnAutoItExitRegister("MyTestFunc2")

Sleep(1000)

Func MyTestFunc()
MsgBox(64, "Exit Results 1", 'Exit Message from MyTestFunc()')
EndFunc

Func MyTestFunc2()
MsgBox(64, "Exit Results 2", 'Exit Message from MyTestFunc()')
EndFunc


Function OnAutoItExitUnRegister

Function Reference

OnAutoItExitUnRegister

UnRegisters a function that was called when AutoIt exits.

OnAutoItExitUnregister( "function" )

Parameters

function The name of the user function that was called.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Related

OnAutoItExitRegister

Example

OnAutoItExitRegister("MyTestFunc")
OnAutoItExitRegister("MyTestFunc2")

Sleep(1000)

OnAutoItExitUnRegister("MyTestFunc")

Func MyTestFunc()
MsgBox(64, "Exit Results 1", 'Exit Message from MyTestFunc()')
EndFunc

Func MyTestFunc2()
MsgBox(64, "Exit Results 2", 'Exit Message from MyTestFunc()')
EndFunc


Function SetError

Function Reference

SetError

Manually set the value of the @error macro.

SetError ( code [, extended [, return value]] )

Parameters

code | The required value (integer) to set the @error macro to.
extended | [optional] The optional value (integer) to set the @extended macro to. This sets the same macro as the SetExtended() function.
return value | [optional] Override the default return value and return this parameter.

Return Value

By default, none, however if the optional return value argument is passed, then the function will return that value.

Remarks

When entering a function @error is set to 0. Unless SetError() is called, then @error will remain 0 after the function has ended. This means that in order for @error to be set after a function, it must be explicitly set. This also means you may need to backup the status of @error in a variable if you are testing it in a While-WEnd loop.
The extended parameter is optional. It is only provided as a way to set both @error and @extended at the same time. If only @extended needs set, then it is recommended to use the SetExtended() function instead.

Related

SetExtended

Example

$result = myDiv(5, 0)
If @error Then
MsgBox(4096,"Error", "Division by Zero")
Else
MsgBox(4096, "Result", $result)
EndIf
Exit

Func myDiv($dividend, $divisor)
If $dividend = 0 And $divisor = 0 Then
SetError(2) ;indeterminate form 0/0
ElseIf $divisor = 0 Then
SetError(1) ;plain division by zero
EndIf
Return $dividend / $divisor
EndFunc


Function SetExtended

Function Reference

SetExtended

Manually set the value of the @extended macro.

SetExtended ( code [, return value] )

Parameters

code | The required value (integer) to set the @extended macro to.
return value | [optional] Override the default return value and return this parameter.

Return Value

By default, none, however, if the optional return value argument is passed, then the function will return that value.

Remarks

When entering a function @extended is set to 0. Unless SetExtended() is called, then @extended will remain 0 after the function has ended. This means that in order for @extended to be set after a function, it must be explicitly set. This also means you may need to backup the status of @extended in a variable if you are testing it in a While-WEnd loop.

Related

SetError

Example

SetExtended(10)
MsgBox(4096, "Value of @Extended is", @extended)


Function VarGetType

Function Reference

VarGetType

Returns the internal type representation of a variant.

VarGetType ( expression )

Parameters

expression An expression to check the internal type of.

Return Value

Returns a string representing the type of the expression.

Remarks

IsInt can return different results as it tries to convert from a string or float.

Related

IsInt, IsFloat, IsString, IsBinary, IsArray, IsDllStruct, IsHwnd, IsObj, IsBool, IsKeyword

Example

$int = 1
$float = 2.0
Msgbox(0, "Types", "$int is " & VarGetType($int) & @CRLF & "$float is " & VarGetType($float) )


Functions

Mouse functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
MouseClick | Perform a mouse click operation.
MouseClickDrag | Perform a mouse click and drag operation.
MouseDown | Perform a mouse down event at the current mouse position.
MouseGetCursor | Returns the cursor ID Number for the current Mouse Cursor.
MouseGetPos | Retrieves the current position of the mouse cursor.
MouseMove | Moves the mouse pointer.
MouseUp | Perform a mouse up event at the current mouse position.
MouseWheel | Moves the mouse wheel up or down. NT/2000/XP ONLY.


Function MouseClick

Function Reference

MouseClick

Perform a mouse click operation.

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

Parameters

button | The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary".
x, y | [optional] The x/y coordinates to move the mouse to. If no x and y coords are given, the current position is used (default).
clicks | [optional] The number of times to click the mouse. Default is 1.
speed | [optional] the speed to move the mouse in the range 1 (fastest) to 100 (slowest). A speed of 0 will move the mouse instantly. Default speed is 10.

Return Value

Success: | Returns 1.
Failure: | Returns 0, the button is not in the list or invalid parameter as x without y.

Remarks

If the button is an empty string, the left button will be clicked.
If x or y equal to the Default keyword no move occurs in the corresponding coordinate.

If the user has swapped the left and right mouse buttons in the control panel, then the behaviour of the buttons is different. "Left" and "right" always click those buttons, whether the buttons are swapped or not. The "primary" or "main" button will be the main click, whether or not the buttons are swapped. The "secondary" or "menu" buttons will usually bring up the context menu, whether the buttons are swapped or not.

Button | Normal | Swapped
"" | Left | Left
"left" | Left | Left
"middle" | Middle | Middle
"right" | Right | Right
"primary" | Left | Right
"main" | Left | Right
"secondary" | Right | Left
"menu" | Right | Left

Related

MouseClickDrag, MouseGetPos, MouseMove, MouseCoordMode (Option), MouseClickDelay (Option), ControlClick, MouseDown, MouseUp, MouseWheel

Example

; Double click at the current mouse pos
MouseClick("left")
MouseClick("left")

; Double click at 0,500
MouseClick("left", 0, 500, 2)

; SAFER VERSION of Double click at 0,500 - takes into account user's control panel settings
MouseClick("primary", 0, 500, 2)


Function MouseClickDrag

Function Reference

MouseClickDrag

Perform a mouse click and drag operation.

MouseClickDrag ( "button", x1, y1, x2, y2 [, speed] )

Parameters

button | The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary".
x1, y1 | The x/y coords to start the drag operation from.
x2, y2 | The x/y coords to end the drag operation at.
speed | [optional] the speed to move the mouse in the range 1 (fastest) to 100 (slowest). A speed of 0 will move the mouse instantly. Default speed is 10.

Return Value

Success: | Returns 1.
Failure: | Returns 0, the button is not in the list.

Remarks

If the button is an empty string, the left button will be clicked.

If the user has swapped the left and right mouse buttons in the control panel, then the behaviour of the buttons is different. "Left" and "right" always click those buttons, whether the buttons are swapped or not. The "primary" or "main" button will be the main click, whether or not the buttons are swapped. The "secondary" or "menu" buttons will usually bring up the context menu, whether the buttons are swapped or not. See the table in MouseClick for more explaination

Related

MouseClick, MouseGetPos, MouseMove, MouseCoordMode (Option), MouseClickDragDelay (Option), MouseDown, MouseUp, MouseWheel

Example

; Left click drag from 0,200 to 600, 700
MouseClickDrag("left", 0, 200, 600, 700)


Function MouseDown

Function Reference

MouseDown

Perform a mouse down event at the current mouse position.

MouseDown ( "button" )

Parameters

button The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary".

Return Value

Success: | Returns 1.
Failure: | Returns 0, the button is not in the list.

Remarks

See MouseClick remarks.
User responsibility: For every MouseDown there should eventually be a corresponding MouseUp event.

Related

MouseUp, MouseClick, MouseClickDrag, MouseGetPos, MouseMove, MouseCoordMode (Option), MouseClickDownDelay (Option)

Example

MouseDown("left")
Sleep(100)
MouseUp("left")


Function MouseGetCursor

Function Reference

MouseGetCursor

Returns the cursor ID Number for the current Mouse Cursor.

MouseGetCursor ( )

Parameters

None.

Return Value

Returns a cursor ID Number:
0 = UNKNOWN (this includes pointing and grabbing hand icons)
1 = APPSTARTING
2 = ARROW
3 = CROSS
4 = HELP
5 = IBEAM
6 = ICON
7 = NO
8 = SIZE
9 = SIZEALL
10 = SIZENESW
11 = SIZENS
12 = SIZENWSE
13 = SIZEWE
14 = UPARROW
15 = WAIT
16 = HAND

Remarks

None.

Related

MouseGetPos

Example

sleep(2000) ;allow time to move mouse before reporting ID

;create an array that tells us the meaning of an ID Number
$IDs = StringSplit("AppStarting|Arrow|Cross|Help|IBeam|Icon|No|" & _
"Size|SizeAll|SizeNESW|SizeNS|SizeNWSE|SizeWE|UpArrow|Wait|Hand", "|")
$IDs[0] = "Unknown"

$cursor = MouseGetCursor()
MsgBox(4096, "ID = " & $cursor, "Which means " & $IDs[$cursor])


Function MouseGetPos

Function Reference

MouseGetPos

Retrieves the current position of the mouse cursor.

MouseGetPos ( [dimension] )

Parameters

dimension [optional] argument that determines what the return value will be. See Return Value.

Return Value

Dimension | Values
None | Returns a two-element array that containing the mouse coordinates: $array[0] = X coord (horizontal), $array[1] = Y coord (vertical)
0 | Returns the X co-ordinate as an integer.
1 | Returns the Y co-ordinate as an integer.

If dimension is not a number @error will be set to 1.

Remarks

See MouseCoordMode for relative/absolute position settings. If relative positioning, numbers may be negative.

Related

MouseClick, MouseClickDrag, MouseMove, MouseCoordMode (Option), MouseDown, MouseGetCursor, MouseUp, MouseWheel, PixelGetColor

Example

$pos = MouseGetPos()
MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])


Function MouseMove

Function Reference

MouseMove

Moves the mouse pointer.

MouseMove ( x, y [, speed] )

Parameters

x | The screen x coordinate to move the mouse to.
y | The screen y coordinate to move the mouse to.
speed | [optional] the speed to move the mouse in the range 1 (fastest) to 100 (slowest). A speed of 0 will move the mouse instantly. Default speed is 10.

Return Value

None.

Remarks

User mouse movement is hindered during a non-instantaneous MouseMove operation.
If MouseCoordMode is relative positioning, numbers may be negative.

Related

MouseClick, MouseClickDrag, MouseGetPos, MouseCoordMode (Option), MouseDown, MouseUp, MouseWheel

Example

MouseMove(10, 100)
MouseMove(700, 700, 0)


Function MouseUp

Function Reference

MouseUp

Perform a mouse up event at the current mouse position.

MouseUp ( "button" )

Parameters

button The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary".

Return Value

Success: | Returns 1.
Failure: | Returns 0, the button is not in the list.

Remarks

See MouseClick remarks.
User responsibility: For every MouseDown there should eventually be a corresponding MouseUp event.

Related

MouseDown, MouseClick, MouseClickDrag, MouseGetPos, MouseMove, MouseCoordMode (Option)

Example

MouseDown("left")
Sleep(100)
MouseUp("left")


Function MouseWheel

Function Reference

MouseWheel

Moves the mouse wheel up or down. NT/2000/XP ONLY.

MouseWheel ( "direction" [, clicks] )

Parameters

direction | "up" or "down"
clicks | [optional] The number of times to move the wheel. Default is 1.

Return Value

Success: | Returns 1.
Failure: | Returns 0, the direction is not recognized.

Remarks

This function only works on NT, 2000, XP and later operating systems.

Related

MouseClick, MouseClickDrag, MouseGetPos, MouseMove, MouseCoordMode (Option)

Example

; Move the wheel up 10 times
MouseWheel("up", 10)


Functions

Network functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
FtpSetProxy | Sets the internet proxy to use for ftp access.
HttpSetProxy | Sets the internet proxy to use for http access.
HttpSetUserAgent | Sets the user-agent string sent with InetGet() and InetRead() requests.
InetClose | Closes a handle returned from InetGet().
InetGet | Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.
InetGetInfo | Returns detailed data for a handle returned from InetGet().
InetGetSize | Returns the size (in bytes) of a file located on the internet.
InetRead | Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.
Ping | Pings a host and returns the roundtrip-time.
TCPAccept | Permits an incoming connection attempt on a socket.
TCPCloseSocket | Closes a TCP socket.
TCPConnect | Create a socket connected to an existing server.
TCPListen | Creates a socket listening for an incoming connection.
TCPNameToIP | Converts an Internet name to IP address.
TCPRecv | Receives data from a connected socket.
TCPSend | Sends data on a connected socket.
TCPShutdown, UDPShutdown | Stops TCP/UDP services.
TCPStartup, UDPStartup | Starts TCP or UDP services.
UDPBind | Create a socket bound to an incoming connection.
UDPCloseSocket | Close a UDP socket.
UDPOpen | Open a socket connected to an existing server .
UDPRecv | Receives data from a opened socket
UDPSend | Sends data on an opened socket
TCPShutdown, UDPShutdown | Stops TCP/UDP services.
TCPStartup, UDPStartup | Starts TCP or UDP services.


Function FtpSetProxy

Function Reference

FtpSetProxy

Sets the internet proxy to use for ftp access.

FtpSetProxy ( mode [, "proxy:port" [, "username" [, "password"]]] )

Parameters

mode | The proxy mode to use: 0 = (default) Use current Internet Explorer settings for proxy. 1 = Use no proxy (direct access) 2 = Use the proxy specified
proxy:port | [optional] The address and port of the proxy to use. See remarks below.
username | [optional] If required, the username for the proxy
password | [optional] If required, the password for the proxy

Return Value

None.

Remarks

Internet Explorer 3 or greater must be installed for this function to work.

Only CERN proxy servers are supported.

Proxy servers are usually made up of a web address and port number. Most ISPs use the port number of 8080. If your proxy was "www.proxy.com" and port was "8080" then you would use this to set the proxy:
FtpSetProxy(2, "www.proxy.com:8080")

Most proxy servers do not require a username and password.

When using mode 0 you may specify a username and password and these will be used with the Internet Explorer configured proxy.

Related

InetGet, InetGetSize, InetRead, HttpSetProxy

Example

; Use no proxy
FtpSetProxy(1)

; Use IE defaults for proxy
FtpSetProxy(0)

; Use the proxy "www-cache.myisp.net" on port 8080
FtpSetProxy(2, "www-cache.myisp.net:8080")


Function HttpSetProxy

Function Reference

HttpSetProxy

Sets the internet proxy to use for http access.

HttpSetProxy ( mode [, "proxy:port" [, "username" [, "password"]]] )

Parameters

mode | The proxy mode to use: 0 = (default) Use current Internet Explorer settings for proxy. 1 = Use no proxy (direct access) 2 = Use the proxy specified
proxy:port | [optional] The address and port of the proxy to use. See remarks below.
username | [optional] If required, the username for the proxy
password | [optional] If required, the password for the proxy

Return Value

None.

Remarks

Internet Explorer 3 or greater must be installed for this function to work.

Only CERN proxy servers are supported.

Proxy servers are usually made up of a web address and port number. Most ISPs use the port number of 8080. If your proxy was "www.proxy.com" and port was "8080" then you would use this to set the proxy:
HttpSetProxy(2, "www.proxy.com:8080")

Most proxy servers do not require a username and password.

When using mode 0 you may specify a username and password and these will be used with the Internet Explorer configured proxy.

Related

InetGet, InetGetSize, InetRead, FtpSetProxy

Example

; Use no proxy
HttpSetProxy(1)

; Use IE defaults for proxy
HttpSetProxy(0)

; Use the proxy "www-cache.myisp.net" on port 8080
HttpSetProxy(2, "www-cache.myisp.net:8080")


Function HttpSetUserAgent

Function Reference

HttpSetUserAgent

Sets the user-agent string sent with InetGet() and InetRead() requests.

HttpSetUserAgent ( "user agent" )

Parameters

user agent The string to set as the user-agent. The default user-agent is "AutoIt". Passing an empty string will reset the user-agent back to the default.

Return Value

None.

Remarks

None.

Related

InetGet, InetGetSize, InetRead

Example

HttpSetUserAgent("MyUserAgent")


Function InetClose

Function Reference

InetClose

Closes a handle returned from InetGet().

InetClose ( handle )

Parameters

handle A handle return from InetGet().

Return Value

True if the handle was found and closed, False if not.

Remarks

InetGet() handles must be closed or resources will leak.

Closing the handle to a download still in progress will cancel the download.

Related

InetGet

Example

Local $hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @TempDir & "\update.dat", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload) ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $nBytes)


Function InetGet

Function Reference

InetGet

Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.

InetGet ( "URL" [,"filename" [, options [, background]]] )

Parameters

URL | URL of the file to download. See remarks below.
filename | [optional] Local filename to download to.
options | [optional] 0 = (default) Get the file from local cache if available. 1 = Forces a reload from the remote site. 2 = Ignore all SSL errors (with HTTPS connections). 4 = Use ASCII when transfering files with the FTP protocol (Can not be combined with flag 8). 8 = Use BINARY when transfering files with the FTP protocol (Can not be combined with flag 4). This is the default transfer mode if none are provided. 16 = By-pass forcing the connection online (See remarks).
background | [optional] 0 = (default) Wait until the download is complete before continuing. 1 = return immediately and download in the background (see remarks).

Return Value

Success: | The return value changes depending on if the download is in the background:
 | Background: A handle is returned. The handle can be used with InetGetInfo(). The handle must be closed with InetClose().
 | Wait: The number of bytes downloaded.
 | Background: A handle is returned. To determine if there was an error with the download, use InetGetInfo(). The handle must be closed with InetClose().
 | Wait: Sets @error to non-zero and returns 0.

Remarks

Internet Explorer 3 or greater must be installed for this function to work.

The URL parameter should be in the form "http://www.somesite.com/path/file.html" - just like an address you would type into your web browser.

To use a username and password when connecting simply prefix the servername with "username:password@", e.g.
"http://myuser:mypassword@www.somesite.com"

Notes about the "background" Parameter

By default the function waits until the download has finished before returning. If the background parameter is set to 1 the function returns immediately and the download continues in the background. The function InetGetInfo() can be used to check the status of the download. It takes the handle returned from InetGet().

Multiple downloads are supported if they are started in background mode.

To abort a download call InetClose() and pass it the handle returned by InetGet().

By default AutoIt forces a connection before starting a download. For dial-up users this will prompt to go online or dial the modem (depending on how the system is configured). The options value 16 disables this behavior. Disabling the behavior can be useful for persistent connects (Broadband, LAN). However, it is also required to work around certain issues in Windows Vista and Windows 7.

Related

InetGetSize, InetRead, InetGetInfo, InetClose, HttpSetProxy, FtpSetProxy, HttpSetUserAgent

Example

InetGet("http://www.mozilla.org", @TempDir & "\mozilla.html")
InetGet("http://www.autoitscript.com", @TempDir & "autoitscript.html", 1)
InetGet("ftp://ftp.mozilla.org/pub/mozilla.org/README", @TempDir & "\Mozilla-README.txt", 1)

; Advanced example - downloading in the background
Local $hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @TempDir & "\update.dat", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload) ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $nBytes)


Function InetGetInfo

Function Reference

InetGetInfo

Returns detailed data for a handle returned from InetGet().

InetGetInfo( [ handle [, index ]] )

Parameters

handle | [optional] A handle return from InetGet().
index | [optional] The index for the data to retrieve. If this value is -1 an array containing all of the below data will be returned. 0 - Bytes read so far (this is updated while the download progresses). 1 - The size of the download (this may not always be present). 2 - Set to True if the download is complete, False if the download is still ongoing. 3 - True if the download was successful. If this is False then the next data member will be non-zero. 4 - The error value for the download. The value itself is arbitrary. Testing that the value is non-zero is sufficient for determining if an error occurred. 5 - The extended value for the download. The value is arbitrary and is primarily only useful to the AutoIt developers.

Return Value

Success - The request data.
Failure - An empty string and @error is set to non-zero.

Remarks

If called with no arguments then the total number of active downloads will be returned.

This function can be called in a loop to query the number of bytes download or to pause until a download is complete.

Related

InetGet

Example

#Alternate
Local $hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @TempDir & "\update.dat", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $aData = InetGetInfo($hDownload) ; Get all information.
InetClose($hDownload) ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $aData[0] & @CRLF & _
"Size: " & $aData[1] & @CRLF & _
"Complete?: " & $aData[2] & @CRLF & _
"Successful?: " & $aData[3] & @CRLF & _
"@error: " & $aData[4] & @CRLF & _
"@extended: " & $aData[5] & @CRLF)


Function InetGetSize

Function Reference

InetGetSize

Returns the size (in bytes) of a file located on the internet.

InetGetSize ( "URL" [, options ] )

Parameters

URL | URL of the file to download. See remarks below.
options | [optional] 0 = (default) Get the file from local cache if available. 1 = Forces a reload from the remote site. 2 = Ignore all SSL errors (with HTTPS connections). 4 = Use ASCII when transfering files with the FTP protocol (Can not be combined with flag 8). 8 = Use BINARY when transfering files with the FTP protocol (Can not be combined with flag 4). This is the default transfer mode if none are provided.

Return Value

Success: | Returns the size of the file in bytes.
Failure: | Returns 0 and sets @error to non-zero.

Remarks

Internet Explorer 3 or greater must be installed for this function to work. (For ftp:// URLs IE 5 is required!)

The URL parameter should be in the form "http://www.somesite.com/path/file.html" - just like an address you would type into your web browser.

To use a username and password when connecting simply prefix the servername with "username:password@", e.g.
"http://myuser:mypassword@www.somesite.com"

Not all servers will correctly give the file size, especially when using a proxy server.

Related

InetGet, InetRead, HttpSetProxy, FtpSetProxy, HttpSetUserAgent

Example

Local $nSize = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat")
MsgBox(0, "Size of remote file:", $nSize)


Function InetRead

Function Reference

InetRead

Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.

InetRead ( "URL" [, options ] )

Parameters

URL | URL of the file to download. See remarks below.
options | [optional] 0 = (default) Get the file from local cache if available. 1 = Forces a reload from the remote site. 2 = Ignore all SSL errors (with HTTPS connections). 4 = Use ASCII when transfering files with the FTP protocol (Can not be combined with flag 8). 8 = Use BINARY when transfering files with the FTP protocol (Can not be combined with flag 4). This is the default transfer mode if none are provided. 16 = By-pass forcing the connection online (See remarks).

Return Value

Success: | A binary string and @extended set to the number of bytes downloaded.
Failure: | Sets @error to non-zero and returns an empty string.

Remarks

Internet Explorer 3 or greater must be installed for this function to work.

The URL parameter should be in the form "http://www.somesite.com/path/file.html" - just like an address you would type into your web browser.

To use a username and password when connecting simply prefix the servername with "username:password@", e.g.
"http://myuser:mypassword@www.somesite.com"

The returned data is in binary format. The BinaryToString() function can be used to convert the data to a string.

By default AutoIt forces a connection before starting a download. For dial-up users this will prompt to go online or dial the modem (depending on how the system is configured). The options value 16 disables this behavior. Disabling the behavior can be useful for persistent connects (Broadband, LAN). However, it is also required to work around certain issues in Windows Vista and Windows 7.

Related

InetGet, InetGetSize, HttpSetProxy, FtpSetProxy, HttpSetUserAgent

Example

Local $sData = InetRead("http://www.autoitscript.com/autoit3/files/beta/update.dat")
Local $nBytesRead = @extended
MsgBox(4096, "", "Bytes read: " & $nBytesRead & @CRLF & @CRLF & BinaryToString($sData))


Function Ping

Function Reference

Ping

Pings a host and returns the roundtrip-time.

Ping ( "address/hostname" [, timeout] )

Parameters

address/hostname | Can be i.e. "www.autoitscript.com" or "87.106.244.38".
timeout | [optional] Is the time to wait for an answer in milliseconds (default is 4000).

Return Value

Success: | Returns the roundtrip-time in milliseconds ( greater than 0 ).
Failure: | Returns 0 if host is not pingable or other network errors occurred and sets @error. (See Remarks)

Remarks

When the function fails (returns 0) @error contains extended information:
1 = Host is offline
2 = Host is unreachable
3 = Bad destination
4 = Other errors

Related

None.

Example

$var = Ping("www.AutoItScript.com",250)
If $var Then; also possible: If @error = 0 Then ...
Msgbox(0,"Status","Online, roundtrip was:" & $var)
Else
Msgbox(0,"Status","An error occured with number: " & @error)
EndIf


Function TCPAccept

Function Reference

TCPAccept

Permits an incoming connection attempt on a socket.

TCPAccept ( mainsocket )

Parameters

mainsocket The main socket identifier (SocketID) as returned by a TCPListen function.

Return Value

Success: | Returns connected socket identifier.
Failure: | Returns -1 and set @error
@error: | windows API WSAGetError return value (see MSDN).

Remarks

Related

TCPStartup, TCPListen, TCPTimeout (Option), TCPCloseSocket, TCPRecv

Example

;SERVER!! Start Me First !!!!!!!!!!!!!!!
$g_IP = "127.0.0.1"

; Start The TCP Services
;==============================================
TCPStartUp()

; Create a Listening "SOCKET"
;==============================================
$MainSocket = TCPListen($g_IP, 65432, 100 )
If $MainSocket = -1 Then Exit

; look for client connection
;--------------------
While 1
$ConnectedSocket = TCPAccept( $MainSocket)
If $ConnectedSocket >= 0 Then
msgbox(0,"","my server - Client Connected")
exit
EndIf
Wend


Function TCPCloseSocket

Function Reference

TCPCloseSocket

Closes a TCP socket.

TCPCloseSocket ( socket )

Parameters

socket The socket identifier (SocketID) as returned by a TCPListen or TCPAccept functions.

Return Value

Success: | Returns 1.
Failure: | Returns 0 and set @error
@error: | windows API WSAGetError return value (see MSDN).

Remarks

None.

Related

TCPStartup, TCPListen, TCPAccept, TCPShutdown

Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)

;==============================================
;==============================================
;SERVER!! Start Me First !!!!!!!!!!!!!!!
;==============================================
;==============================================

; Initialize a variable to represent a connection
;==============================================
Global $ConnectedSocket = -1

Global $MainSocket

Example()

Func Example()
OnAutoItExitRegister("Cleanup")

Local $g_IP, $RogueSocket, $GOOEY, $edit, $input, $butt, $msg
Local $ret, $recv

$g_IP = "127.0.0.1"

; Start The TCP Services
;==============================================
TCPStartup()

; Create a Listening "SOCKET"
;==============================================
$MainSocket = TCPListen($g_IP, 65432, 100)
If $MainSocket = -1 Then Exit
$RogueSocket = -1

; Create a GUI for chatting
;==============================================
$GOOEY = GUICreate("my server", 300, 200)
$edit = GUICtrlCreateEdit("", 10, 40, 280, 150, $WS_DISABLED)
$input = GUICtrlCreateInput("", 10, 10, 200, 20)
$butt = GUICtrlCreateButton("Send", 210, 10, 80, 20, $BS_DEFPUSHBUTTON)
GUISetState()

; GUI Message Loop
;==============================================
While 1
$msg = GUIGetMsg()

; GUI Closed
;--------------------
If $msg = $GUI_EVENT_CLOSE Then ExitLoop

; User Pressed SEND
;--------------------
If $msg = $butt Then
If $ConnectedSocket > -1 Then
$ret = TCPSend($ConnectedSocket, GUICtrlRead($input))
If @error Or $ret < 0 Then
; ERROR OCCURRED, CLOSE SOCKET AND RESET ConnectedSocket to -1
;----------------------------------------------------------------
TCPCloseSocket($ConnectedSocket)
WinSetTitle($GOOEY, "", "my server - Client Disconnected")
$ConnectedSocket = -1
ElseIf $ret > 0 Then
; UPDATE EDIT CONTROL WITH DATA WE SENT
;----------------------------------------------------------------
GUICtrlSetData($edit, GUICtrlRead($edit) & GUICtrlRead($input) & @CRLF)
EndIf
EndIf
GUICtrlSetData($input, "")
EndIf

If $RogueSocket > 0 Then
$recv = TCPRecv($RogueSocket, 512)
If Not @error Then
TCPCloseSocket($RogueSocket)
$RogueSocket = -1
EndIf
EndIf

; If no connection look for one
;--------------------
If $ConnectedSocket = -1 Then
$ConnectedSocket = TCPAccept($MainSocket)
If $ConnectedSocket < 0 Then
$ConnectedSocket = -1
Else
WinSetTitle($GOOEY, "", "my server - Client Connected")
EndIf

; If connected try to read some data
;--------------------
Else
; EXECUTE AN UNCONDITIONAL ACCEPT IN CASE ANOTHER CLIENT TRIES TO CONNECT
;----------------------------------------------------------------
$RogueSocket = TCPAccept($MainSocket)
If $RogueSocket > 0 Then
TCPSend($RogueSocket, "~~rejected")
EndIf

$recv = TCPRecv($ConnectedSocket, 512)

If $recv <> "" And $recv <> "~~bye" Then
; UPDATE EDIT CONTROL WITH DATA WE RECEIVED
;----------------------------------------------------------------
GUICtrlSetData($edit, GUICtrlRead($edit) & ">" & $recv & @CRLF)

ElseIf @error Or $recv = "~~bye" Then
; ERROR OCCURRED, CLOSE SOCKET AND RESET ConnectedSocket to -1
;----------------------------------------------------------------
WinSetTitle($GOOEY, "", "my server - Client Disconnected")
TCPCloseSocket($ConnectedSocket)
$ConnectedSocket = -1
EndIf
EndIf
WEnd

GUIDelete($GOOEY)
EndFunc ;==>Example

Func Cleanup()
;ON SCRIPT EXIT close opened sockets and shutdown TCP service
;----------------------------------------------------------------------
If $ConnectedSocket > -1 Then
TCPSend($ConnectedSocket, "~~bye")
Sleep(2000)
TCPRecv($ConnectedSocket, 512)
TCPCloseSocket($ConnectedSocket)
EndIf
TCPCloseSocket($MainSocket)
TCPShutdown()
EndFunc ;==>Cleanup


Function TCPConnect

Function Reference

TCPConnect

Create a socket connected to an existing server.

TCPConnect ( IPAddr, port )

Parameters

IPAddr | Internet Protocol dotted address(IpV4) as "192.162.1.1".
port | port on which the created socket will be connected.

Return Value

Success: | Returns main socket identifier.
Failure: | Returns -1 or 0 and set @error.
@error: | 1 IPAddr is incorrect.
 | 2 port is incorrect.
 | windows API WSAGetError return value (see MSDN).

Remarks

This function is used by a client to communicate with the server.

Related

TCPStartup, TCPListen, TCPTimeout (Option), TCPRecv, TCPSend

Example

;CLIENT!!!!!!!! Start SERVER First... dummy!!
$g_IP = "127.0.0.1"

; Start The TCP Services
;==============================================
TCPStartUp()

; Connect to a Listening "SOCKET"
;==============================================
$socket = TCPConnect( $g_IP, 65432 )
If $socket = -1 Then Exit


Function TCPListen

Function Reference

TCPListen

Creates a socket listening for an incoming connection.

TCPListen ( IPAddr, port [, MaxPendingConnection] )

Parameters

IPAddr | Internet Protocol dotted address(IpV4) as "192.162.1.1".
port | port on which the created socket will be connected.
MaxPendingConnection | [optional] Maximum length of the queue of pending connections. By default the maximum reasonable value will be set.

Return Value

Success: | Returns main socket identifier.
Failure: | Returns -1 or 0 and set @error.
@error: | 1 IPAddr is incorrect.
 | 2 port is incorrect.
 | windows API WSAGetError return value (see MSDN).

Remarks

None.

Related

TCPStartup, TCPConnect, TCPAccept, TCPTimeout (Option), TCPCloseSocket, TCPSend, TCPShutdown

Example

;SERVER!! Start Me First !!!!!!!!!!!!!!!
$g_IP = "127.0.0.1"

; Start The TCP Services
;==============================================
TCPStartUp()

; Create a Listening "SOCKET"
;==============================================
$MainSocket = TCPListen($g_IP, 65432, 100 )
If $MainSocket = -1 Then Exit


Function TCPNameToIP

Function Reference

TCPNameToIP

Converts an Internet name to IP address.

TCPNameToIP ( name )

Parameters

name String containing an Internet name.

Return Value

Success: | Returns string containing IP address corresponding to the name.
Failure: | Returns "" and set @error.
@error: | windows API WSAGetError return value (see MSDN).

Remarks

TCPStartup is needed before this call.

Related

TCPStartup

Example

TCPStartup()

msgbox(0,"IP???",TCPNameToIP("TheMachineNextToYOU"))


Function TCPRecv

Function Reference

TCPRecv

Receives data from a connected socket.

TCPRecv ( mainsocket, maxlen [, flag] )

Parameters

mainsocket | The connected socket identifier (SocketID) as returned by a TCPAccept or a TCPConnect function.
maxlen | max # of characters to receive.
flag | [optional] Forces the function to return binary data if set to 1 (default is 0, and will auto detect between binary/string).

Return Value

Success: | Returns binary/string sent by the connected socket.
Failure: | Returns "" and set @error
@error: | -1 Socket error
 | windows API WSAGetError return value (see MSDN).

Remarks

For backwards compatibility reasons this function will try to return strings by default. If null (0x00) characters are received then the return value will be a binary type.
To force the function to always return binary data (the most sensible option) then use the "flag" parameter set to 1.

Related

BinaryLen, BinaryMid, TCPStartup, TCPAccept, TCPConnect, TCPTimeout (Option)

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

;==============================================
;==============================================
;SERVER!! Start Me First !!!!!!!!!!!!!!!
;==============================================
;==============================================

Example()

Func Example()
; Set Some reusable info
; Set your Public IP address (@IPAddress1) here.
; Local $szServerPC = @ComputerName
; Local $szIPADDRESS = TCPNameToIP($szServerPC)
Local $szIPADDRESS = @IPAddress1
Local $nPORT = 33891
Local $MainSocket, $GOOEY, $edit, $ConnectedSocket, $szIP_Accepted
Local $msg, $recv

; Start The TCP Services
;==============================================
TCPStartup()

; Create a Listening "SOCKET".
; Using your IP Address and Port 33891.
;==============================================
$MainSocket = TCPListen($szIPADDRESS, $nPORT)

; If the Socket creation fails, exit.
If $MainSocket = -1 Then Exit

; Create a GUI for messages
;==============================================
$GOOEY = GUICreate("My Server (IP: " & $szIPADDRESS & ")", 300, 200)
$edit = GUICtrlCreateEdit("", 10, 10, 280, 180)
GUISetState()

; Initialize a variable to represent a connection
;==============================================
$ConnectedSocket = -1

;Wait for and Accept a connection
;==============================================
Do
$ConnectedSocket = TCPAccept($MainSocket)
Until $ConnectedSocket <> -1

; Get IP of client connecting
$szIP_Accepted = SocketToIP($ConnectedSocket)

; GUI Message Loop
;==============================================
While 1
$msg = GUIGetMsg()

; GUI Closed
;--------------------
If $msg = $GUI_EVENT_CLOSE Then ExitLoop

; Try to receive (up to) 2048 bytes
;----------------------------------------------------------------
$recv = TCPRecv($ConnectedSocket, 2048)

; If the receive failed with @error then the socket has disconnected
;----------------------------------------------------------------
If @error Then ExitLoop

; Update the edit control with what we have received
;----------------------------------------------------------------
If $recv <> "" Then GUICtrlSetData($edit, _
$szIP_Accepted & " > " & $recv & @CRLF & GUICtrlRead($edit))
WEnd

If $ConnectedSocket <> -1 Then TCPCloseSocket($ConnectedSocket)

TCPShutdown()
EndFunc ;==>Example

; Function to return IP Address from a connected socket.
;----------------------------------------------------------------------
Func SocketToIP($SHOCKET)
Local $sockaddr, $aRet

$sockaddr = DllStructCreate("short;ushort;uint;char[8]")

$aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, _
"ptr", DllStructGetPtr($sockaddr), "int*", DllStructGetSize($sockaddr))
If Not @error And $aRet[0] = 0 Then
$aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "int", DllStructGetData($sockaddr, 3))
If Not @error Then $aRet = $aRet[0]
Else
$aRet = 0
EndIf

$sockaddr = 0

Return $aRet
EndFunc ;==>SocketToIP


Function TCPSend

Function Reference

TCPSend

Sends data on a connected socket.

TCPSend ( mainsocket, data )

Parameters

mainsocket | The connected socket identifier (SocketID) as returned by a TCPConnect function.
data | binary/string to be send to the connected socket.

Return Value

Success: | Returns number of bytes sent to the connected socket.
Failure: | Returns 0 and set @error.
@error: | windows API WSAGetError return value (see MSDN).

Remarks

None.

Related

TCPStartup, TCPConnect, TCPListen, TCPTimeout (Option)

Example

Opt('MustDeclareVars', 1)

;==============================================
;==============================================
;CLIENT! Start Me after starting the SERVER!!!!!!!!!!!!!!!
;==============================================
;==============================================

Example()

Func Example()
; Set Some reusable info
;--------------------------
Local $ConnectedSocket, $szData
; Set $szIPADDRESS to wherever the SERVER is. We will change a PC name into an IP Address
; Local $szServerPC = @ComputerName
; Local $szIPADDRESS = TCPNameToIP($szServerPC)
Local $szIPADDRESS = @IPAddress1
Local $nPORT = 33891

; Start The TCP Services
;==============================================
TCPStartup()

; Initialize a variable to represent a connection
;==============================================
$ConnectedSocket = -1

;Attempt to connect to SERVER at its IP and PORT 33891
;=======================================================
$ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)

; If there is an error... show it
If @error Then
MsgBox(4112, "Error", "TCPConnect failed with WSA error: " & @error)
; If there is no error loop an inputbox for data
; to send to the SERVER.
Else
;Loop forever asking for data to send to the SERVER
While 1
; InputBox for data to transmit
$szData = InputBox("Data for Server", @LF & @LF & "Enter data to transmit to the SERVER:")

; If they cancel the InputBox or leave it blank we exit our forever loop
If @error Or $szData = "" Then ExitLoop

; We should have data in $szData... lets attempt to send it through our connected socket.
TCPSend($ConnectedSocket, $szData)

; If the send failed with @error then the socket has disconnected
;----------------------------------------------------------------
If @error Then ExitLoop
WEnd
EndIf
EndFunc ;==>Example


Function TCPShutdown, UDPShutdown

Function Reference

TCPShutdown, UDPShutdown

Stops TCP/UDP services.

TCPShutdown ( )
UDPShutdown ( )

Parameters

None.

Return Value

Success: | Returns 1.
Failure: | Returns 0 and set @error.
@error: | windows API WSACleanup return value (see MSDN).

Remarks

A script must call one TCPShutdown() call for every successful TCPStartup() call.
UDPShutdown() is just an alias of TCPShutdown().

Related

TCPStartup, TCPListen, TCPCloseSocket, UDPCloseSocket

Example

TCPStartup() ; To start TCP services

TCPShutdown ( ) ; To stop TCP services


Function TCPStartup, UDPStartup

Function Reference

TCPStartup, UDPStartup

Starts TCP or UDP services.

TCPStartup ( )
UDPStartup ( )

Parameters

None.

Return Value

Success: | Returns 1.
Failure: | Returns 0 and set @error.
@error: | windows API WSAStartup return value (see MSDN).

Remarks

There must be a TCPShutdown() call to avoid memory consomption.
A script must call one TCPShutdown() call for every successful TCPStartup() call.
UDPStartup() is just an alias of TCPStartup().

Related

TCPShutdown, TCPListen, TCPCloseSocket, UDPCloseSocket, TCPAccept, TCPConnect, TCPNameToIP, TCPRecv, TCPSend

Example

TCPStartup ( ) ; To start TCP services


Function UDPBind

Function Reference

UDPBind

Create a socket bound to an incoming connection.

UDPBind ( IPAddr, port )

Parameters

IPAddr | Internet Protocol dotted address(IpV4) as "192.162.1.1".
port | port on which the created socket will be bound.

Return Value

Success: | Returns an array : $array[1] contains the real socket, $array[2] contains the specified IP address and $array[3] contains the port. We need this information in subsequent calls to UDPSend(), where we pass this socket structure/array.
Failure: | Set @error
@error: | 1 IPAddr is incorrect.
 | 2 port is incorrect.
 | windows API WSAGetError return value (see MSDN).

Remarks

None.

Related

UDPRecv, UDPOpen, UDPCloseSocket, UDPSend

Example

;SERVER!! Start Me First !!!!!!!!!!!!!!!
$g_IP = "127.0.0.1"

; Start The UDP Services
;==============================================
UDPStartUp()

; Create a Listening "SOCKET"
;==============================================
$socket = UDPBind($g_IP, 65432)
If @error <> 0 Then Exit


Function UDPCloseSocket

Function Reference

UDPCloseSocket

Close a UDP socket.

UDPCloseSocket ( socketarray )

Parameters

socketarray The socket/array as returned by a UDPBind or UDPOpen functions.

Return Value

Success: | Returns 1.
Failure: | Returns 0 and set @error.
@error: | -1, -2 or -3 invalid socketarray.
 | windows API WSAGetError return value (see MSDN).

Remarks

None.

Related

UDPBind, UDPOpen, TCPShutdown, TCPStartup

Example

;SERVER!! Start Me First !!!!!!!!!!!!!!!
$g_IP = "127.0.0.1"

; Start The UDP Services
;==============================================
UDPStartUp()

; Register the cleanup function.
OnAutoItExitRegister("Cleanup")

; Create a Listening "SOCKET"
;==============================================
$socket = UDPBind($g_IP, 65432)
If @error <> 0 Then Exit

;--- Your code here

Func Cleanup()
UDPCloseSocket($socket)
UDPShutdown()
EndFunc


Function UDPOpen

Function Reference

UDPOpen

Open a socket connected to an existing server .

UDPOpen ( IPAddr, port [, flag] )

Parameters

IPAddr | Internet Protocol dotted address(IpV4) as "192.162.1.1".
port | port on which the created socket will be connected.
flag | [optional] 0 (Default) - No additional options are set. 1 - Allow the broadcasting on the address "255.255.255.255".

Return Value

Success: | Returns an array : $array[1] contains the real socket, $array[2] contains the specified IP address and $array[3] contains the port. We need this information in subsequent calls to UDPSend(), where we pass this socket structure/array.
Failure: | Returns $array[0]=0 and set @error.
@error: | windows API WSAGetError return value (see MSDN).

Remarks

This function is used by a client to communicate with the server.

Related

UDPBind, UDPSend, UDPCloseSocket, UDPRecv

Example

;CLIENT!!!!!!!! Start SERVER First... dummy!!
$g_IP = "127.0.0.1"

; Start The UDP Services
;==============================================
UDPStartUp()

; Connect to a Listening "SOCKET"
;==============================================
$socket = UDPOpen( $g_IP, 65432 )
If @error <> 0 Then Exit


Function UDPRecv

Function Reference

UDPRecv

Receives data from a opened socket

UDPRecv ( socketarray, maxlen [, flag] )

Parameters

socketarray | The socket/array as returned by a UDPBind function.
maxlen | max # of characters to receive.
flag | [optional] Forces the function to return binary data if set to 1 (default is 0, and will auto detect between binary/string). Forces the function to return receive from IP/port if set to 2. Results are returned in an Array : [0] data, [1] from IP, [2] from Port. If you want both just use 3.

Return Value

Success: | Returns binary/string sent by the opened socket or an array if flag = 2 or 3.
Failure: | Returns "" and set @error.
@error: | -1, -2 or -3 invalid socketarray.
 | windows API WSAGetError return value (see MSDN).

Remarks

For backwards compatibility reasons this function will try to return strings by default. If null (0x00) characters are received then the return value will be a binary type.
To force the function to always return binary data (the most sensible option) then use the "flag" parameter set to 1.

Related

BinaryLen, BinaryMid, UDPBind, UDPOpen

Example

;;This is the UDP Server
;;Start this first

; Start The UDP Services
;==============================================
UDPStartup()

; Register the cleanup function.
OnAutoItExitRegister("Cleanup")

; Bind to a SOCKET
;==============================================
$socket = UDPBind("127.0.0.1", 65532)
If @error <> 0 Then Exit

While 1
$data = UDPRecv($socket, 50)
If $data <> "" Then
MsgBox(0, "UDP DATA", $data, 1)
EndIf
sleep(100)
WEnd

Func Cleanup()
UDPCloseSocket($socket)
UDPShutdown()
EndFunc


Function UDPSend

Function Reference

UDPSend

Sends data on an opened socket

UDPSend ( socketarray, data)

Parameters

socketarray | The main socket/array as returned by a UDPOpen function.
data | binary/string to be sent to the connected socket

Return Value

Success: | Returns number of bytes sent to the opened socket.
Failure: | Sets @error.
@error: | -1, -2 or -3 invalid socketarray.
 | 1 IPAddr is incorrect.
 | 2 port is incorrect.
 | windows API WSAGetError return value (see MSDN).

Remarks

None.

Related

UDPOpen, UDPBind

Example

;;This is the UDP Client
;;Start the server first

; Start The UDP Services
;==============================================
UDPStartup()

; Register the cleanup function.
OnAutoItExitRegister("Cleanup")

; Open a "SOCKET"
;==============================================
$socket = UDPOpen("127.0.0.1", 65532)
If @error <> 0 Then Exit

$n=0
While 1
Sleep(2000)
$n = $n + 1
$status = UDPSend($socket, "Message #" & $n)
If $status = 0 then
MsgBox(0, "ERROR", "Error while sending UDP message: " & @error)
Exit
EndIf
WEnd

Func Cleanup()
UDPCloseSocket($socket)
UDPShutdown()
EndFunc


Functions

Obj/COM functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
ObjCreate | Creates a reference to a COM object from the given classname.
ObjEvent | Handles incoming events from the given Object.
ObjGet | Retrieves a reference to a COM object from an existing process or filename.
ObjName | Returns the name or interface description of an Object


Function ObjCreate

Function Reference

ObjCreate

Creates a reference to a COM object from the given classname.

ObjCreate ( "classname" [, "servername" [,"username", ["password"]]] )

Parameters

classname | The class of the object in the following format: "appname.objectype"
servername | [optional] name of a remote computer from which the object must be obtained.
username | [optional] name of a usercode on the remote computer You have to enter this in the format "computer\usercode" or "domain\usercode".
password | [optional] password for the usercode on the remote computer.

Return Value

Success: | Returns an object.
Failure: | Returns 0 and sets @error to 1.

Remarks

Use ObjCreate() if you want to have a new instance of the referring application.
If you want to connect to an existing process, use ObjGet() instead.

Keep in mind that not all computers have the same set of Objects. So always check for errors after calling ObjCreate().

The following requirements apply if you want to access objects on remote computers:
-The user running the script must have the appropriate permissions.
-The Object on the remote computer must support DCOM (Distributed COM)
-The remote computer must have 'Remote Registry Service' and 'File and Printer sharing' services running.

See the Obj/COM Reference for more information about Objects.

Related

GUICtrlCreateObj, IsObj, ObjEvent, ObjGet, ObjName

Example

; Example 1
;
; Counting the number of open shell windows

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object
$oShellWindows=$oShell.windows ; Get the collection of open shell Windows

if Isobj($oShellWindows) then

$string="" ; String for displaying purposes

for $Window in $oShellWindows ; Count all existing shell windows
$String = $String & $Window.LocationName & @CRLF
next

Msgbox(0,"Shell Windows","You have the following shell windows:" & @CRLF & @CRLF & $String);

endif
exit

; Example 2
;
; Open the MediaPlayer on a REMOTE computer
$oRemoteMedia = ObjCreate("MediaPlayer.MediaPlayer.1","name-of-remote-computer")

If not @error then
Msgbox(0,"Remote ObjCreate Test","ObjCreate() of a remote Mediaplayer Object successful !")
$oRemoteMedia.Open( @WindowsDir & "\media\Windows XP Startup.wav") ; Play sound if file is present
Else
Msgbox(0,"Remote ObjCreate Test","Failed to open remote Object. Error code: " & hex(@error,8))
Endif


Function ObjEvent

Function Reference

ObjEvent

Handles incoming events from the given Object.

ObjEvent ( $ObjectVar, "functionprefix" [, "interface name"] )
ObjEvent ( "AutoIt.Error" [, "function name"] )

Parameters

$ObjectVar | A variable containing an Object from which you want to receive events
"functionprefix" | The prefix of the functions you define to handle receiving events. The prefix is appended by the Objects method name.
"interface name" | [optional] name of an Event interface to use. Note: It must be a supported as outgoing for the Object AND it must be of type DISPATCH.

Return Value

Success: | Returns an object or a function name.
Failure: | Returns "" and sets @error to 1.

Remarks

The first format is used to receive Events from the given Object.
To receive a specific event, create an AutoIt function name using
the given prefix appended with the event name.

The second format is used for COM Error Handling. If any COM error
occurs, the given function is being called.
If the second parameter is omitted, it will return the name of the
current Error handler function, if present.

See the Obj/COM Reference for a detailed explanation.

Related

ObjGet, IsObj, ObjCreate, GUICtrlCreateObj

Example

; ObjEvent example

ProgressOn("Example", "Loading page...")
$oIE=ObjCreate("InternetExplorer.Application.1") ; Create Internet Explorer application
$SinkObject=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents2") ; Assign events to UDFs starting with IEEvent_

; Do some browsing activities
$oIE.Visible=1
$oIE.RegisterAsDropTarget = 1
$oIE.RegisterAsBrowser = 1
$oIE.Navigate( "http://www.AutoItScript.com/" )

sleep(3000) ; Give it time to load the web page

$SinkObject=0 ; Stop IE Events
$oIE.Quit ; Quit IE
$oIE=0
exit

; one of many Internet Explorer Event Functions

Func IEEvent_ProgressChange($Progress,$ProgressMax)
$percent = Int( ($Progress * 100) / $ProgressMax )
If $percent >= 0 And $percent <= 100 Then
ProgressSet ( $percent , $percent & " percent to go." , "loading web page" )
EndIf

EndFunc

Exit

; COM Error Handler example
; -------------------------

$oIE=ObjCreate("InternetExplorer.Application.1") ; Create Internet Explorer application

Global $g_eventerror = 0 ; to be checked to know if com error occurs. Must be reset after handling.

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initialize a COM error handler

$oIE.UnknownMethod ; Deliberately call an undefined method

If $g_eventerror then
$g_eventerror = 0
Msgbox (0,"AutoItCOM test","Test passed: We got an error number: " & @error)
Else
Msgbox (0,"AutoItCOM test","Test failed!")
Endif

Exit

; This is my custom defined error handler
Func MyErrFunc()

Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext _
)

Local $err = $oMyError.number
If $err = 0 Then $err = -1

$g_eventerror = $err ; to check for after this function returns
Endfunc


Function ObjGet

Function Reference

ObjGet

Retrieves a reference to a COM object from an existing process or filename.

ObjGet ( "filename" [, "classname"] )

Parameters

filename | The full path and name to the file containing the object (See remarks).
classname | [optional] The class of the object in the following format: "appname.objectype"

Return Value

Success: | Returns an object.
Failure: | Returns 0 and sets @error to 1.

Remarks

The filename is optional if you want to use only the class name, but the parameter
can't be omitted. Use an empty string if you only want to use the classname.
Like: $Object = ObjGet("","Excel.Application")

If you want to use a filename, the classname is optional. It's only required when
multiple classes are defined to the same file type and you want to access a
specific class.

Keep in mind that not all computers have the same set of Objects. So always check for errors after calling ObjGet().

See the Obj/COM Reference for more information about Objects.

Related

GUICtrlCreateObj, IsObj, ObjCreate, ObjEvent, ObjName

Example

; Example getting an Object using it's class name
;
; Excel must be activated for this example to be successfull

$oExcel = ObjGet("","Excel.Application") ; Get an existing Excel Object

if @error then
Msgbox (0,"ExcelTest","Error Getting an active Excel Object. Error code: " & hex(@error,8))
exit
endif

$oExcel.Visible = 1 ; Let the guy show himself
$oExcel.workbooks.add ; Add a new workbook
exit

; Example getting an Object using a file name
;
; An Excel file with filename Worksheet.xls must be created in the root directory
; of the C:\ drive in order for this example to work.

$FileName="C:\Worksheet.xls"

if not FileExists($FileName) then
Msgbox (0,"Excel File Test","Can't run this test, because you didn't create the Excel file "& $FileName)
Exit
endif

$oExcelDoc = ObjGet($FileName) ; Get an Excel Object from an existing filename

if IsObj($oExcelDoc) then

; Tip: Uncomment these lines to make Excel visible (credit: DaleHohm)
; $oExcelDoc.Windows(1).Visible = 1; Set the first worksheet in the workbook visible
; $oExcelDoc.Application.Visible = 1; Set the application visible (without this Excel will exit)

$String = "" ; String for displaying purposes

; Some document properties do not return a value, we will ignore those.
$OEvent=ObjEvent("AutoIt.Error","nothing"); Equal to VBscript's On Error Resume Next

For $Property In $oExcelDoc.BuiltinDocumentProperties
$String = $String & $Property.Name & ":" & $Property.Value & @CRLF
Next

Msgbox(0,"Excel File Test","The document properties of " & $FileName & " are:" & @CRLF & @CRLF & $String)

$oExcelDoc.Close ; Close the Excel document

else
Msgbox (0,"Excel File Test","Error: Could not open "& $FileName & " as an Excel Object.")
endif


Function ObjName

Function Reference

ObjName

Returns the name or interface description of an Object

ObjName ( $Objectvariable [,Flag] )

Parameters

$Objectvariable | A variable containing an Object whose name you want to retrieve
Flag | [optional] 1 = Name of the dispatch interface being used (default) 2 = Description of the (document) Object 3 = The ProgID of the Object 4 = The DLL file from with the Object was created (if supported) 5 = Filename and position of the toolbox icon (if supported)

Return Value

Success: | Returns a string representing the name
Failure: | Sets @error and Returns ""

Remarks

Not all Objects support flags 2 to 5. Always test for @error in these cases.

Related

IsObj, ObjGet, ObjCreate

Example

$oInternet = ObjCreate("InternetExplorer.Application")
$oInternet.Navigate( "http://www.google.com" ) ; Opening a web page that contains a form
sleep(4000) ; Give the page time to load

$oDoc = $oInternet.document ; Example object to test
$oForm = $oDoc.forms(0) ; Example object to test

msgbox(0,"","Interface name of $oInternet is: " & ObjName($oInternet) & @CRLF & _
"Object name of $oInternet is: " & ObjName($oInternet,2) & @CRLF & _
"Interface name of $oDoc is: " & ObjName($oDoc) & @CRLF & _
"Object name of $oDoc is: " & ObjName($oDoc,2) & @CRLF & _
"Interface name of $oForm is: " & ObjName($oForm) & @CRLF & _
"Object name of $oForm is: " & ObjName($oForm,2))


Functions

Process functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
DllCall | Dynamically calls a function in a DLL.
DllCallbackFree | Frees a previously created handle created with DllCallbackRegister.
DllCallbackGetPtr | Returns the pointer to a callback function that can be passed to the Win32 API.
DllCallbackRegister | Creates a user-defined DLL Callback function.
DllClose | Closes a previously opened DLL.
DllOpen | Opens a DLL file for use in DllCall.
DllStructCreate | Creates a C/C++ style structure to be used in DllCall.
DllStructGetData | Returns the data of an element of the struct.
DllStructGetPtr | Returns the pointer to the struct or an element in the struct.
DllStructGetSize | Returns the size of the struct in bytes.
DllStructSetData | Sets the data in of an element in the struct.
PluginOpen |
PluginClose |
ProcessClose | Terminates a named process.
ProcessExists | Checks to see if a specified process exists.
ProcessGetStats | Returns an array about Memory or IO infos of a running process.
ProcessSetPriority | Changes the priority of a process
ProcessList | Returns an array listing the currently running processes (names and PIDs).
ProcessWait | Pauses script execution until a given process exists.
ProcessWaitClose | Pauses script execution until a given process does not exist.
Run | Runs an external program.
RunWait | Runs an external program and pauses script execution until the program finishes.
RunAs | Runs an external program under the context of a different user.
RunAsWait | Runs an external program under the context of a different user and pauses script execution until the program finishes.
ShellExecute | Runs an external program using the ShellExecute API.
ShellExecuteWait | Runs an external program using the ShellExecute API and pauses script execution until it finishes.
Shutdown | Shuts down the system.
StderrRead | Reads from the STDERR stream of a previously run child process.
StdinWrite | Writes a number of characters to the STDIN stream of a previously run child process.
StdioClose | Closes all resources associated with a process previously run with STDIO redirection.
StdoutRead | Reads from the STDOUT stream of a previously run child process.


Function DllCall

Function Reference

DllCall

Dynamically calls a function in a DLL.

DllCall ( "dll", "return type", "function" [, type1, param1 [, type n, param n]] )

Parameters

dll | The filename of the DLL to use. e.g. "user32.dll". A handle obtained from DllOpen can also be used (See Remarks).
return type | The return type of the function (see below).
function | The name, eg. "MessageBox" or the ordinal value, e.g. 62, of the function in the DLL to call.
type1 | [optional] The type of the parameter (see remarks).
param1 | [optional] The actual parameter (see remarks).
type n | [optional] The type of the nth parameter (see remarks).
param n | [optional] The actual nth parameter (see remarks).

Valid Types are:
Type | Details
none | no value (only valid for return type - equivalent to void in C)
BYTE | an unsigned 8 bit integer
BOOLEAN | an unsigned 8 bit integer
short | a 16 bit integer
USHORT | an unsigned 16 bit integer
WORD | an unsigned 16 bit integer
int | a 32 bit integer
long | a 32 bit integer
BOOL | a 32 bit integer
UINT | an unsigned 32 bit integer
ULONG | an unsigned 32 bit integer
DWORD | an unsigned 32 bit integer
INT64 | a 64 bit integer
UINT64 | an unsigned 64 bit integer
ptr | a general pointer (void *)
HWND | a window handle (pointer)
HANDLE | an handle (pointer)
float | a single precision floating point number
double | a double precision floating point number
INT_PTR, LONG_PTR, LRESULT, LPARAM | an integer big enough to hold a pointer when running on x86 or x64 versions of AutoIt.
UINT_PTR, ULONG_PTR, DWORD_PTR, WPARAM | an unsigned integer big enough to hold a pointer when running on x86 or x64 versions of AutoIt.
str | an ANSI string (a minimum of 65536 chars is allocated).
wstr | a UNICODE wide character string (a minimum of 65536 chars is allocated).
* | Add * to the end of another type to pass it by reference. For example "int*" passes a pointer to an "int" type.

Conversions from Windows API types to AutoIt types:
WINDOWS API Type | AutoIt Type
LPCSTR/LPSTR | str
LPCWSTR/LPWSTR | wstr
LPVOID | ptr
LPxyz | xyz*
HINSTANCE | handle
HRESULT | long
LONGLONG/LARGE_INTEGER | INT64
ULONGLONG/ULARGE_INTEGER | UINT64
SIZE_T | ULONG_PTR
To use nested structures inside a structure you must re-define the nested structure. For example, a structure containing 2 POINT structures ("long;long") would be declared as "long;long;long;long". The first two long values correspond to the first POINT structure and the second two values correspond to the second POINT structure.
For more Windows API types see MSDN.

Return Value

Success: | @error = 0.
Failure: | set @error
@error: | 1 unable to use the DLL file,
 | 2 unknown "return type",
 | 3 "function" not found in the DLL file,
 | 4 bad number of parameters.
See remarks.

Remarks

If a dll filename is given then the DLL is automatically loaded and then closed at the end of the call. If you want to manually control the loading and unloading of the DLL then you should use DllOpen and DllClose and use a handle instead of a filename in this function.

By default, AutoIt uses the 'stdcall' calling method. To use the 'cdecl' method place ':cdecl' after the return type.
DllCall("SQLite.dll", "int:cdecl", "sqlite3_open", "str", $sDatabase_Filename , "long*", 0).

By default, AutoIt tries to use the ANSI version of a function name, i.e. MessageBoxA is attempted when MessageBox is given as the function name. To call the unicode version use MessageBoxW.

If the function call fails then @error is set to 1. Otherwise an array is returned that contains the function return value and a copy of all the parameters (including parameters that the function may have modified when passed by reference).
$return[0] = function return value
$return[1] = param1
$return[2] = param2
...
$return[n] = paramn

Related

DllCallbackFree, DllCallbackGetPtr, DllCallbackRegister, DllOpen, DllClose, DllStructCreate, DllStructGetPtr

Example

; *******************************************************
; Example 1 - calling the MessageBox API directly
; *******************************************************

$result = DllCall("user32.dll", "int", "MessageBox", "hwnd", 0, "str", "Some text", "str", "Some title", "int", 0)

; *******************************************************
; Example 2 - calling a function that modifies parameters
; *******************************************************

$hwnd = WinGetHandle("[CLASS:Notepad]")
$result = DllCall("user32.dll", "int", "GetWindowText", "hwnd", $hwnd, "str", "", "int", 32768)
msgbox(0, "", $result[0]) ; number of chars returned
msgbox(0, "", $result[2]) ; Text returned in param 2

; *******************************************************
; Example 3 - Show the Windows PickIconDlg
; *******************************************************

$sFileName = @SystemDir & '\shell32.dll'

; Create a structure to store the icon index
$stIcon = DllStructCreate("int")
$stString = DLLStructCreate("wchar[260]")
$structsize = DllStructGetSize($stString)/2
DllStructSetData($stString, 1, $sFileName)

; Run the PickIconDlg - '62' is the ordinal value for this function
DllCall("shell32.dll", "none", 62, "hwnd", 0, "ptr", DllStructGetPtr($stString), "int", $structsize, "ptr", DllStructGetPtr($stIcon))

$sFileName = DllStructGetData($stString, 1)
$nIconIndex = DllStructGetData($stIcon, 1)

; Show the new filename and icon index
Msgbox(0, "Info", "Last selected file: " & $sFileName & @LF & "Icon-Index: " & $nIconIndex)


Function DllCallbackFree

Function Reference

DllCallbackFree

Frees a previously created handle created with DllCallbackRegister.

DllCallbackFree ( handle )

Parameters

handle The DllCallback handle, as returned by a previous call to DllCallbackRegister.

Return Value

None.

Remarks

Upon termination, AutoIt automatically closes any handles it opened but calling DllCallbackFree is still a good idea.

Related

DllCall, DllCallbackGetPtr, DllCallbackRegister

Example

; Create callback function
$handle = DLLCallbackRegister ("_EnumWindowsProc", "int", "hwnd;lparam")

; Call EnumWindows
DllCall("user32.dll", "int", "EnumWindows", "ptr", DllCallbackGetPtr($handle), "lparam", 10)

; Delete callback function
DllCallbackFree($handle)

; Callback Procedure
Func _EnumWindowsProc($hWnd, $lParam)
If WinGetTitle($hWnd) <> "" And BitAnd(WinGetState($hWnd), 2) Then
$res = MsgBox(1, WinGetTitle($hWnd), "$hWnd=" & $hWnd & @CRLF & "lParam=" & $lParam & @CRLF & "$hWnd(type)=" & VarGetType($hWnd))
If $res = 2 Then Return 0 ; Cancel clicked, return 0 to stop enumeration
EndIf
Return 1 ; Return 1 to continue enumeration
EndFunc


Function DllCallbackGetPtr

Function Reference

DllCallbackGetPtr

Returns the pointer to a callback function that can be passed to the Win32 API.

DllCallbackGetPtr ( handle )

Parameters

handle A DllCallback handle returned from DllCallbackRegister.

Return Value

Success: | The pointer to the callback function.
Failure: | 0.

Remarks

Use DllCallbackGetPtr to pass the address of a callback function to the Win32 API when using DllCall.

Related

DllCall, DllCallBackRegister, DllCallbackFree

Example

; Create callback function
$handle = DLLCallbackRegister ("_EnumWindowsProc", "int", "hwnd;lparam")

; Call EnumWindows
DllCall("user32.dll", "int", "EnumWindows", "ptr", DllCallbackGetPtr($handle), "lparam", 10)

; Delete callback function
DllCallbackFree($handle)

; Callback Procedure
Func _EnumWindowsProc($hWnd, $lParam)
If WinGetTitle($hWnd) <> "" And BitAnd(WinGetState($hWnd), 2) Then
$res = MsgBox(1, WinGetTitle($hWnd), "$hWnd=" & $hWnd & @CRLF & "lParam=" & $lParam & @CRLF & "$hWnd(type)=" & VarGetType($hWnd))
If $res = 2 Then Return 0 ; Cancel clicked, return 0 to stop enumeration
EndIf
Return 1 ; Return 1 to continue enumeration
EndFunc


Function DllCallbackRegister

Function Reference

DllCallbackRegister

Creates a user-defined DLL Callback function.

DllCallbackRegister ( "function", "return type", "params" )

Parameters

function | The name of the User Defined Function to call.
return type | The return type and calling convention of the function (see DllCall).
params | A semi-colon separated list of parameters that will be passed to this function. Uses DllCall types.

Return Value

Success: | Returns a dll "handle" to be used with DllCallbackGetPtr and DllCallbackFree functions.
Failure: | Returns 0 if error occurs.

Remarks

When finished working with a callback, call the DllCallbackFree function to close it. AutoIt normally closes all files upon termination, but explicitly calling DllCallbackFree is still a good idea.

Related

DllCall, DllCallbackFree, DllCallbackGetPtr

Example

; Create callback function
$handle = DLLCallbackRegister ("_EnumWindowsProc", "int", "hwnd;lparam")

; Call EnumWindows
DllCall("user32.dll", "int", "EnumWindows", "ptr", DllCallbackGetPtr($handle), "lparam", 10)

; Delete callback function
DllCallbackFree($handle)

; Callback Procedure
Func _EnumWindowsProc($hWnd, $lParam)
If WinGetTitle($hWnd) <> "" And BitAnd(WinGetState($hWnd), 2) Then
$res = MsgBox(1, WinGetTitle($hWnd), "$hWnd=" & $hWnd & @CRLF & "lParam=" & $lParam & @CRLF & "$hWnd(type)=" & VarGetType($hWnd))
If $res = 2 Then Return 0 ; Cancel clicked, return 0 to stop enumeration
EndIf
Return 1 ; Return 1 to continue enumeration
EndFunc


Function DllClose

Function Reference

DllClose

Closes a previously opened DLL.

DllClose ( dllhandle )

Parameters

dllhandle The handle of a dll, as returned by a previous call to DllOpen.

Return Value

None.

Remarks

Upon termination, AutoIt automatically closes any dlls it opened but calling DllClose is still a good idea.

Related

DllCall, DllOpen

Example

$dll = DllOpen("user32.dll")
$result = DllCall($dll, "int", "MessageBox", "hwnd", 0, "str", "Some text", "str", "Some title", "int", 0)
DllClose($dll)


Function DllOpen

Function Reference

DllOpen

Opens a DLL file for use in DllCall.

DllOpen ( "filename" )

Parameters

filename Filename of the DLL file to open.

Return Value

Success: | Returns a dll "handle" to be used with subsequent Dll functions.
Failure: | Returns -1 if error occurs.

Remarks

When finished working with a dll, call the DllClose function to close it. AutoIt normally closes all files upon termination, but explicitly calling DllClose is still a good idea.

Related

DllCall, DllClose

Example

$dll = DllOpen("user32.dll")
$result = DllCall($dll, "int", "MessageBox", "hwnd", 0, "str", "Some text", "str", "Some title", "int", 0)
DllClose($dll)


Function DllStructCreate

Function Reference

DllStructCreate

Creates a C/C++ style structure to be used in DllCall.

DllStructCreate ( "Struct" [,Pointer] )

Parameters

"Struct" | A string representing the structure to create (See Remarks).
Pointer | [optional] If supplied the struct will not allocate memory but use the pointer supplied.

Return Value

Success: | A variable for use with DllStruct calls.
Failure: | 0.
@Error: | 0 = No Error.
 | 1 = Variable passed to DllStructCreate was not a string.
 | 2 = There is an unknown Data Type in the string passed.
 | 3 = Failed to allocate the memory needed for the struct, or Pointer = 0.
 | 4 = Error allocating memory for the passed string.

Type | Details
BYTE | 8bit(1byte) unsigned char
BOOLEAN | 8bit(1byte) unsigned char
CHAR | 8bit(1byte) ASCII char
WCHAR | 16bit(2byte) UNICODE wide char
short | 16bit(2bytes) signed integer
USHORT | 16bit(2bytes) unsigned integer
WORD | 16bit(2bytes) unsigned integer
int | 32bit(4bytes) signed integer
long | 32bit(4bytes) signed integer
BOOL | 32bit(4bytes) signed integer
UINT | 32bit(4bytes) unsigned integer
ULONG | 32bit(4bytes) unsigned integer
DWORD | 32bit(4bytes) unsigned integer
INT64 | 64bit(8bytes) signed integer
UINT64 | 64bit(8bytes) unsigned integer
ptr | 32 or 64bit unsigned integer (depending on if the x86 or x64 version of AutoIt is used)
HWND | 32bit(4bytes) integer
HANDLE | 32bit(4bytes) integer
float | 32bit(4bytes) floating point
double | 64bit(8bytes) floating point
INT_PTR, LONG_PTR, LRESULT, LPARAM | 32 or 64bit signed integer (depending on if the x86 or x64 version of AutoIt is used)
UINT_PTR, ULONG_PTR, DWORD_PTR, WPARAM | 32 or 64bit unsigned integer (depending on if the x86 or x64 version of AutoIt is used)

Remarks

Each data type must be separated by a semi-colon ';'.

Create arrays by adding '[size]' after the data type: DllStructCreate("int;char[128]")

An elementname can be added similar to a C-style declaration: DllStructCreate("int n;char buffer[128]").
This dataname can be used in place of the element in other DllStruct... functions. The dataname must be alphanumeric or an underscore.

To use a different alignment prefix the structure with the align keyword. The default value for n is 8. Valid values are 1, 2, 4, 8, and 16. The alignment of a member will be on a boundary that is either a multiple of n or a multiple of the size of the member, whichever is smaller. This is equivalent to the #pragma pack option with the Microsoft Visual C++ compiler.

DllStructCreate("short;int") ; structure is 8 bytes, the "int" is at offset 4
DllStructCreate("align 2;short;int") ; structure is 6 bytes, the "int" is at offset 2

DllStructCreate("byte;double") ; structure is 16 bytes, the "double" is at offset 8
DllStructCreate("align 4;byte;double") ; structure is 12 bytes, the "double" is at offset 4

If a change of alignment is needed "align" can be use before the first element which need to be changed.
"align" or "align 8" leads to default alignment.

To release allocated memory just set the returned variable to 0.

Related

DllCall, DllStructGetData, DllStructSetData, DllStructGetPtr, DllStructGetSize, IsDllStruct

Example

;=========================================================
; Create the struct
; struct {
; int var1;
; unsigned char var2;
; unsigned int var3;
; char var4[128];
; }
;=========================================================
$str = "int var1;ubyte var2;uint var3;char var4[128]"
$a = DllStructCreate($str)
if @error Then
MsgBox(0,"","Error in DllStructCreate " & @error);
exit
endif

;=========================================================
; Set data in the struct
; struct.var1 = -1;
; struct.var2 = 255;
; struct.var3 = INT_MAX; -1 will be typecasted to (unsigned int)
; strcpy(struct.var4,"Hello");
; struct.var4[0] = 'h';
;=========================================================
DllStructSetData($a,"var1",-1)
DllStructSetData($a,"var2",255)
DllStructSetData($a,"var3",-1)
DllStructSetData($a,"var4","Hello")
DllStructSetData($a,"var4",Asc("h"),1)

;=========================================================
; Display info in the struct
;=========================================================
MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($a) & @CRLF & _
"Struct pointer: " & DllStructGetPtr($a) & @CRLF & _
"Data:" & @CRLF & _
DllStructGetData($a,1) & @CRLF & _
DllStructGetData($a,2) & @CRLF & _
DllStructGetData($a,3) & @CRLF & _
DllStructGetData($a,4))

;=========================================================
; Free the memory allocated for the struct if needed
;=========================================================
$a=0


Function DllStructGetData

Function Reference

DllStructGetData

Returns the data of an element of the struct.

DllStructGetData ( Struct, Element [, index ] )

Parameters

Struct | The struct returned by DllStructCreate.
Element | Which element of the struct you want to access, starting at 1 or the elementname as defined in DllStructCreate.
index | [optional] For elements that are an array this specifies the 1-based index to retrieve. if omitted or the Default keyword then the entire array is retrieved (Useful for quickly retrieving strings). Not used for non-array elements.
*char[n], byte[n] and ubyte[n] return all element data when index is omitted.

Return Value

Success: | Data in the element of the struct.
Failure: | 0.
@Error: | 0 = No Error.
 | 1 = Struct not a correct struct returned by DllStructCreate.
 | 2 = Element value out of range.
 | 3 = index would be outside of the struct.
 | 4 = Element data type is unknown
 | 5 = index <= 0.

Remarks

When the element is char[n] and index is omitted the data returned is a String,
when the element is byte[n] or ubyte[n] and index is omitted the data returned is a binary type,
otherwise it always returns a number.

Related

DllStructCreate, DllStructSetData

Example

$p = DllStructCreate("dword dwOSVersionInfoSize;dword dwMajorVersion;dword dwMinorVersion;dword dwBuildNumber;dword dwPlatformId;char szCSDVersion[128]")

;think of this as p->dwOSVersionInfoSize = sizeof(OSVERSIONINFO)
DllStructSetData($p, "dwOSVersionInfoSize", DllStructGetSize($p))

;make the DllCall
$ret = DllCall("kernel32.dll","int","GetVersionEx","ptr",DllStructGetPtr($p))

if Not $ret[0] Then
MsgBox(0,"DllCall Error","DllCall Failed")
exit
EndIf

;get the returned values
$major = DllStructGetData($p,"dwMajorVersion")
$minor = DllStructGetData($p,"dwMinorVersion")
$build = DllStructGetData($p,"dwBuildNumber")
$platform = DllStructGetData($p,"dwPlatformId")
$version = DllStructGetData($p,"szCSDVersion")

;free the struct
$p =0

msgbox(0,"","Major: " & $major & @CRLF & _
"Minor: " & $minor & @CRLF & _
"Build: " & $build & @CRLF & _
"Platform ID: " & $platform & @CRLF & _
"Version: " & $version)


Function DllStructGetPtr

Function Reference

DllStructGetPtr

Returns the pointer to the struct or an element in the struct.

DllStructGetPtr ( Struct [,Element])

Parameters

Struct | The struct returned by DllStructCreate.
Element | [optional] The element of the struct who's pointer you need, starting at 1 or the elementname as defined in DllStructCreate.

Return Value

Success: | The pointer to the struct.
Failure: | 0.
@Error: | 0 = No Error.
 | 1 = Struct not a correct struct returned by DllStructCreate.
 | 2 = Element is out of bounds.

Remarks

Used in DllCall.

Related

DllCall, DllStructCreate

Example

;example1
;get a window handle and use WinGetPos to get the windows' rectangle
$hwnd = WinGetHandle("")
$coor = WinGetPos($hwnd)

;create the struct
$rect = DllStructCreate("int;int;int;int")

;make the DllCall
DLLCall("user32.dll","int","GetWindowRect", _
"hwnd",$hwnd, _
"ptr",DllStructGetPtr($rect)) ; use DllStructGetPtr when calling DllCall

;get the returned rectangle
$l = DllStructGetData($rect,1)
$t = DllStructGetData($rect,2)
$r = DllStructGetData($rect,3)
$b = DllStructGetData($rect,4)

;free the struct
$rect = 0

;display the results of WinGetPos and the returned rectangle
MsgBox(0,"The Larry Test :)","WinGetPos(): (" & $coor[0] & "," & $coor[1] & _
") (" & $coor[2] + $coor[0] & "," & $coor[3] + $coor[1] & ")" & @CRLF & _
"GetWindowRect(): (" & $l & "," & $t & ") (" & $r & "," & $b & ")")

;example2
; DllStructGetPtr referencing an item
$a = DllStructCreate("int")
if @error Then
MsgBox(0,"","Error in DllStructCreate " & @error);
exit
endif

$b = DllStructCreate("uint",DllStructGetPtr($a,1))
if @error Then
MsgBox(0,"","Error in DllStructCreate " & @error);
exit
endif

$c = DllStructCreate("float",DllStructGetPtr($a,1))
if @error Then
MsgBox(0,"","Error in DllStructCreate " & @error);
exit
endif

;set the data
DllStructSetData($a,1,-1)

;=========================================================
; Display the different data types of the same data
;=========================================================
MsgBox(0,"DllStruct", _
"int: " & DllStructGetData($a,1) & @CRLF & _
"uint: " & DllStructGetData($b,1) & @CRLF & _
"float: " & DllStructGetData($c,1) & @CRLF & _
"")

; release memory allocated
$a = 0


Function DllStructGetSize

Function Reference

DllStructGetSize

Returns the size of the struct in bytes.

DllStructGetSize ( Struct )

Parameters

Struct The struct returned by DllStructCreate.

Return Value

Success: | The size of the struct in bytes.
Failure: | 0.
@Error: | 0 = No Error.
 | 1 = Struct not a correct struct returned by DllStructCreate.

Remarks

Used when data in the struct needs to hold the struct size.

Related

DllStructCreate, DllStructSetData

Example

;=========================================================
; Create the struct
; struct {
; int var1;
; unsigned char var2;
; unsigned int var3;
; char var4[128];
; }
;=========================================================
$str = "int;ubyte;uint;char[128]"
$a = DllStructCreate($str)
if @error Then
MsgBox(0,"","Error in DllStructCreate " & @error);
exit
endif

;=========================================================
; Set data in the struct
; struct.var1 = -1;
; struct.var2 = 255;
; struct.var3 = INT_MAX; -1 will be typecasted to (unsigned int)
; strcpy(struct.var4,"Hello");
; struct.var4[0] = 'h';
;=========================================================
DllStructSetData($a,1,-1)
DllStructSetData($a,2,255)
DllStructSetData($a,3,-1)
DllStructSetData($a,4,"Hello")
DllStructSetData($a,4,Asc("h"),1)

;=========================================================
; Display info in the struct
;=========================================================
MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($a) & @CRLF & _
"Struct pointer: " & DllStructGetPtr($a) & @CRLF & _
"Data:" & @CRLF & _
DllStructGetData($a,1) & @CRLF & _
DllStructGetData($a,2) & @CRLF & _
DllStructGetData($a,3) & @CRLF & _
DllStructGetData($a,4))

;=========================================================
; Free the memory allocated for the struct
;=========================================================
$a = 0


Function DllStructSetData

Function Reference

DllStructSetData

Sets the data in of an element in the struct.

DllStructSetData ( Struct, Element, value [, index ] )

Parameters

Struct | The struct returned by DllStructCreate.
Element | Which element of the struct you want to access, starting at 1 or the element name as defined in DllStructCreate.
value | The new value to place in the struct.
index | [optional] For elements that are an array this specifies the 1-based index to set. if omitted or the Default keyword then as much of the value as possible will be set in element starting at index 1 (Useful for quickly setting strings). Not used for non-array elements.

Return Value

Success: | value, which is read back from the struct.
Failure: | 0.
@Error: | 0 = No Error.
 | 1 = Struct not a correct struct returned by DllStructCreate.
 | 2 = Element value out of range.
 | 3 = index would be outside of the struct.
 | 4 = Element data type is unknown
 | 5 = index <= 0.

Remarks

When the element is char[n], byte[n] or ubyte[n] the data can be a string otherwise it has to be a number.

Related

DllStructCreate, DllStructGetData, DllStructGetSize

Example

;=========================================================
; Create the struct
; struct {
; int var1;
; unsigned char var2;
; unsigned int var3;
; char var4[128];
; }
;=========================================================
$str = "int;ubyte;uint;char[128]"
$a = DllStructCreate($str)
if @error Then
MsgBox(0,"","Error in DllStructCreate " & @error);
exit
endif

;=========================================================
; Set data in the struct
; struct.var1 = -1;
; struct.var2 = 255;
; struct.var3 = INT_MAX; -1 will be typecasted to (unsigned int)
; strcpy(struct.var4,"Hello");
; struct.var4[0] = 'h';
;=========================================================
DllStructSetData($a,1,-1)
DllStructSetData($a,2,255)
DllStructSetData($a,3,-1)
DllStructSetData($a,4,"Hello")
DllStructSetData($a,4,Asc("h"),1)

;=========================================================
; Display info in the struct
;=========================================================
MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($a) & @CRLF & _
"Struct pointer: " & DllStructGetPtr($a) & @CRLF & _
"Data:" & @CRLF & _
DllStructGetData($a,1) & @CRLF & _
DllStructGetData($a,2) & @CRLF & _
DllStructGetData($a,3) & @CRLF & _
DllStructGetData($a,4))

;=========================================================
; Free the memory allocated for the struct
;=========================================================
$a = 0


Function PluginOpen

Warning: This feature is experimental. It may not work, may contain bugs or may be changed or removed without notice.

DO NOT REPORT BUGS OR REQUEST NEW FEATURES FOR THIS FEATURE.

USE AT YOUR OWN RISK.

Function Reference

PluginOpen

Open a plugin file.

PluginOpen ( filename )

Parameters

filename Filename of the plugin file to open.

Return Value

Success: | Returns a dll "handle" to be used to close the plugin.
Failure: | Returns 0.

Remarks

None.

Related

PluginClose

Example

$handle = PluginOpen("example.dll")


Function PluginClose

Warning: This feature is experimental. It may not work, may contain bugs or may be changed or removed without notice.

DO NOT REPORT BUGS OR REQUEST NEW FEATURES FOR THIS FEATURE.

USE AT YOUR OWN RISK.

Function Reference

PluginClose

Close a plugin file

PluginClose ( dllhandle )

Parameters

dllhandle The handle of a dll, as returned by a previous call to PluginOpen.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

PluginOpen

Example

$handle = PluginOpen("example.dll")

PluginFunc1(0.1, 0.2) ; will call the plugin function with 2 parameters

PluginClose($handle)


Function ProcessClose

Function Reference

ProcessClose

Terminates a named process.

ProcessClose ( "process")

Parameters

process The name or PID of the process to terminate.

Return Value

Success: | Returns 1.
Failure: | Returns 0 and set @error to:
 | 1 = OpenProcess failed
 | 2 = AdjustTokenPrivileges Failed
 | 3 = TerminateProcess Failed
 | 4 = Cannot verify if process exists

Remarks

Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"

If multiple processes have the same name, the one with the highest PID is terminated--regardless of how recently the process was spawned.

PID is the unique number which identifies a Process. A PID can be obtained through the ProcessExists or Run commands.

The process is polled approximately every 250 milliseconds.

Related

ProcessExists, ProcessWait, ProcessWaitClose, Run, WinClose, ProcessList, RunAs, Shutdown, WinKill

Example

ProcessClose("notepad.exe")

$PID = ProcessExists("notepad.exe") ; Will return the PID or 0 if the process isn't found.
If $PID Then ProcessClose($PID)


Function ProcessExists

Function Reference

ProcessExists

Checks to see if a specified process exists.

ProcessExists ( "process" )

Parameters

process The name or PID of the process to check.

Return Value

Success: | Returns the PID of the process.
Failure: | Returns 0 if process does not exist.

Remarks

Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"

PID is the unique number which identifies a Process.

The process is polled approximately every 250 milliseconds.

Related

ProcessClose, ProcessWait, ProcessWaitClose, WinExists, ProcessList

Example

If ProcessExists("notepad.exe") Then
MsgBox(0, "Example", "Notepad is running.")
EndIf


Function ProcessGetStats

Function Reference

ProcessGetStats

Returns an array about Memory or IO infos of a running process.

ProcessGetStats ( ["process" [, type]] )

Parameters

process | [optional] The name or PID of the process to get infos from. Default (-1) is the current process.
type | [optional] 0 = (default) memory infos, 1 = IO infos.

Return Value

Success: | An array of infos data (See Remarks).
Failure: | 0.

Remarks

The array returned is mono-dimensional and is made up as follows:

Type = 0 : Memory Stats

$array[0] = WorkingSetSize
$array[1] = PeakWorkingSetSize

Type = 1 : IO Stats

$array[0] = number of read operations performed.
$array[1] = number of write operations performed.
$array[2] = number of I/O operations performed, other than read and write operations.
$array[3] = number of bytes read.
$array[4] = number of bytes write.
$array[5] = number of bytes transferred during operations other than read and write operations.

Related

ProcessList

Example

; retrieve memory infos of the current running process
$mem = ProcessGetStats()

; retrieve IO infos of the current running process
$IO = ProcessGetStats(-1, 1)


Function ProcessSetPriority

Function Reference

ProcessSetPriority

Changes the priority of a process

ProcessSetPriority ( "process", priority)

Parameters

process | The name or PID of the process to check.
priority | A flag which determines what priority to set 0 - Idle/Low 1 - Below Normal 2 - Normal 3 - Above Normal 4 - High 5 - Realtime (Use with caution, may make the system unstable)

Return Value

Success: | Returns 1.
Failure: | Returns 0 and sets @error to 1. May set @error to 2 if attempting to use an unsupported priority class.

Remarks

None.

Related

ProcessList, _ProcessGetPriority

Example

Run("Notepad.exe")
ProcessSetPriority("notepad.exe", 0)
; Notepad should now have Idle/Low priority


Function ProcessList

Function Reference

ProcessList

Returns an array listing the currently running processes (names and PIDs).

ProcessList ( ["name"] )

Parameters

name [optional] If a name is given only processes of the same name will be returned.

Return Value

Success: | An array of process names and PIDs (See Remarks).
Failure: | @error is set to 1 when the list cannot be build.

Remarks

The array returned is two-dimensional and is made up as follows:
$array[0][0] = Number of processes
$array[1][0] = 1st Process name
$array[1][1] = 1st Process ID (PID)
$array[2][0] = 2nd Process name
$array[2][1] = 2nd Process ID (PID)
...
$array[n][0] = nth Process name
$array[n][1] = nth Process ID (PID)

The list can be empty if $array[0][0] = 0. No @error set in this case.

Related

ProcessClose, ProcessExists, ProcessSetPriority, ProcessWait, ProcessWaitClose, ProcessGetStats, WinGetProcess

Example

; List all processes
$list = ProcessList()
for $i = 1 to $list[0][0]
msgbox(0, $list[$i][0], $list[$i][1])
next

; List just notepad.exe processes
$list = ProcessList("notepad.exe")
for $i = 1 to $list[0][0]
msgbox(0, $list[$i][0], $list[$i][1])
next


Function ProcessWait

Function Reference

ProcessWait

Pauses script execution until a given process exists.

ProcessWait ( "process" [, timeout] )

Parameters

process | The name of the process to check.
timeout | [optional] Specifies how long to wait (in seconds). Default is to wait indefinitely.

Return Value

Success: | Returns Pid of the process.
Failure: | Returns 0 if the wait timed out.

Remarks

Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"

The process is polled approximately every 250 milliseconds.

This function is the only process function not to accept a PID. Because PIDs are allocated randomly, waiting for a particular PID to exist doesn't make sense.

Related

ProcessClose, ProcessExists, ProcessWaitClose, RunWait, WinWait, WinWaitActive, ProcessList, RunAsWait, WinGetProcess

Example

ProcessWait("notepad.exe")


Function ProcessWaitClose

Function Reference

ProcessWaitClose

Pauses script execution until a given process does not exist.

ProcessWaitClose ( "process" [, timeout] )

Parameters

process | The name or PID of the process to check.
timeout | [optional] Specifies how long to wait (in seconds). Default is to wait indefinitely.

Return Value

Success: | Returns 1 and sets @extended to the exit code of the process.
Failure: | Returns 0 if the wait timed out. On invalid PID @error is set to non-zero and @extended is set to 0xCCCCCCCC.

Remarks

Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"

PID is the unique number which identifies a Process. A PID can be obtained through the ProcessExists or Run commands.

The process is polled approximately every 250 milliseconds.

The return is 1 if the process was not existing.

Related

ProcessClose, ProcessExists, ProcessWait, RunWait, WinWaitClose, ProcessList, RunAsWait, WinGetProcess

Example

;waits until no instance of notepad.exe exists
ProcessWaitClose("notepad.exe")

; This will wait until this particular instance of notepad has exited
$PID = Run("notepad.exe")
ProcessWaitClose($PID)


Function Run

Function Reference

Run

Runs an external program.

Run ( "program" [, "workingdir" [, show_flag[, opt_flag ]]] )

Parameters

program | The full path of the program (EXE, BAT, COM, or PIF) to run (see remarks).
workingdir | [optional] The working directory. This is not the path to the program.
show_flag | [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window (or Default keyword) @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window
opt_flag | [optional] Controls various options related to how the parent and child process interact. 0x1 ($STDIN_CHILD) = Provide a handle to the child's STDIN stream 0x2 ($STDOUT_CHILD) = Provide a handle to the child's STDOUT stream 0x4 ($STDERR_CHILD) = Provide a handle to the child's STDERR stream 0x8 ($STDERR_MERGED) = Provides the same handle for STDOUT and STDERR. Implies both $STDOUT_CHILD and $STDERR_CHILD. 0x10 ($STDIO_INHERIT_PARENT) = Provide the child with the parent's STDIO streams. This flag can not be combined with any other STDIO flag. This flag is only useful when the parent is compiled as a Console application. 0x10000 ($RUN_CREATE_NEW_CONSOLE) = The child console process should be created with it's own window instead of using the parent's window. This flag is only useful when the parent is compiled as a Console application.

Return Value

Success: | The PID of the process that was launched.
Failure: | Returns 0 and sets @error to non-zero.

Remarks

Paths with spaces need to be enclosed in quotation marks.

To run DOS (console) commands, try Run(@ComSpec & " /c " & 'commandName', "", @SW_HIDE) ; don't forget " " before "/c"

After running the requested program the script continues. To pause execution of the script until the spawned program has finished use the RunWait function instead.

Providing the Standard I/O parameter with the proper values permits interaction with the child process through the StderrRead, StdinWrite and StdoutRead functions. Combine the flag values (or use $STDERR_CHILD, $STDIN_CHILD & $STDOUT_CHILD, defined in Constants.au3) to manage more than one stream.

In order for the streams to close, the following conditions must be met: 1) The child process has closed it's end of the stream (this happens when the child closes). 2) AutoIt must read any captured streams until there is no more data. 3) If STDIN is provided for the child, StdinWrite() must be called to close the stream. Once all streams are detected as no longer needed, all internal resources will automatically be freed.
StdioClose can be used to force the STDIO streams closed.

Related

RunWait, RunAs, RunAsWait, ShellExecute, ShellExecuteWait, StderrRead, StdinWrite, StdoutRead, StdioClose, ProcessClose, ConsoleRead

Example

Run(@WindowsDir & "\Notepad.exe", "", @SW_MAXIMIZE)


Function RunWait

Function Reference

RunWait

Runs an external program and pauses script execution until the program finishes.

RunWait ( "program" [, "workingdir" [, show_flag [, opt_flag ]]] )

Parameters

program | The full path of the program (EXE, BAT, COM, or PIF) to run (see remarks).
workingdir | [optional] The working directory. This is not the path to the program.
show_flag | [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window (or Default keyword) @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window
opt_flag | [optional] Controls various options related to how the parent and child process interact. 0x10000 ($RUN_CREATE_NEW_CONSOLE) = The child console process should be created with it's own window instead of using the parent's window. This flag is only useful when the parent is compiled as a Console application.

Return Value

Success: | Returns the exit code of the program that was run.
Failure: | Returns 0 and sets @error to non-zero.

Remarks

Paths with spaces need to be enclosed in quotation marks.

To run DOS commands, try RunWait(@ComSpec & " /c " & "commandName") ; don't forget " " before "/c"

After running the requested program the script pauses until the program terminates. To run a program and then immediately continue script execution use the Run function instead.

Some programs will appear to return immediately even though they are still running; these programs spawn another process - you may be able to use the ProcessWaitClose function to handle these cases.

Related

ProcessWait, ProcessWaitClose, Run, ShellExecute, ShellExecuteWait, RunAs, RunAsWait

Example

Local $val = RunWait(@WindowsDir & "\Notepad.exe", @WindowsDir, @SW_MAXIMIZE)
; script waits until Notepad closes
MsgBox(0, "Program returned with exit code:", $val)


Function RunAs

Function Reference

RunAs

Runs an external program under the context of a different user.

RunAs ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag ]]] )

Parameters

username | The username to log on with.
domain | The domain to authenticate against.
password | The password for the user.
logon_flag | 0 - Interactive logon with no profile. 1 - Interactive logon with profile. 2 - Network credentials only. 4 - Inherit the calling processes environment instead of the user's.
program | The full path of the program (EXE, BAT, COM, or PIF) to run (see remarks).
workingdir | [optional] The working directory. If not specified, then the value of @SystemDir will be used. This is not the path to the program.
show_flag | [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window (or Default keyword) @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window
opt_flag | [optional] Controls various options related to how the parent and child process interact. 0x1 ($STDIN_CHILD) = Provide a handle to the child's STDIN stream 0x2 ($STDOUT_CHILD) = Provide a handle to the child's STDOUT stream 0x4 ($STDERR_CHILD) = Provide a handle to the child's STDERR stream 0x8 ($STDERR_MERGED) = Provides the same handle for STDOUT and STDERR. Implies both $STDOUT_CHILD and $STDERR_CHILD. 0x10 ($STDIO_INHERIT_PARENT) = Provide the child with the parent's STDIO streams. This flag can not be combined with any other STDIO flag. This flag is only useful when the parent is compiled as a Console application. 0x10000 ($RUN_CREATE_NEW_CONSOLE) = The child console process should be created with it's own window instead of using the parent's window. This flag is only useful when the parent is compiled as a Console application.

Return Value

Success: | The PID of the process that was launched.
Failure: | Returns 0 and sets @error to non-zero.

Remarks

Paths with spaces need to be enclosed in quotation marks.

It is important to specify a working directory the user you are running as has access to, otherwise the function will fail.

It is recommended that you only load the user's profile is you are sure you need it. There is a small chance a profile can be stuck in memory under the right conditions. If a script using RunAs() happens to be running as the SYSTEM account (for example, if the script is running as a service) and the user's profile is loaded, then you must take care that the script remains running until the child process closes.

When running as an administrator, the Secondary Logon (RunAs) service must be enabled or this function will fail. This does not apply when running as the SYSTEM account.

After running the requested program the script continues. To pause execution of the script until the spawned program has finished use the RunAsWait function instead.

Providing the Standard I/O parameter with the proper values permits interaction with the child process through the StderrRead, StdinWrite and StdoutRead functions. Combine the flag values (or use $STDERR_CHILD, $STDIN_CHILD & $STDOUT_CHILD, defined in Constants.au3) to manage more than one stream.

In order for the streams to close, the following conditions must be met: 1) The child process has closed it's end of the stream (this happens when the child closes). 2) AutoIt must read any captured streams until there is no more data. 3) If STDIN is provided for the child, StdinWrite() must be called to close the stream. Once all streams are detected as no longer needed, all internal resources will automatically be freed.
StdioClose can be used to force the STDIO streams closed.

The "load profile" and "network credentials only" options are incompatible. Using both will produce undefined results.

There is an issue in the Windows XP generation of Windows which prevents STDIO redirection and the show flag from working. See Microsoft Knowledge Base article KB818858 for more information about which versions are affected as well as a hotfix for the issue. User's running Windows 2000, Windows XP SP2 or later, or Windows Vista are not affected.

Related

Run, RunWait, RunAsWait, ShellExecute, ShellExecuteWait, StderrRead, StdinWrite, StdoutRead, StdioClose, ProcessClose

Example

; Fill in the username and password appropriate for your system.
Local $sUserName = "Username"
Local $sPassword = "Password"

; Run a command prompt as the other user.
RunAs($sUserName, @ComputerName, $sPassword, 0, @ComSpec, @SystemDir)


Function RunAsWait

Function Reference

RunAsWait

Runs an external program under the context of a different user and pauses script execution until the program finishes.

RunAsWait ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag ]]] )

Parameters

username | The username to log on with.
domain | The domain to authenticate against.
password | The password for the user.
logon_flag | 0 - Interactive logon with no profile. 1 - Interactive logon with profile. 2 - Network credentials only. 4 - Inherit the calling processes environment instead of the user's.
program | The full path of the program (EXE, BAT, COM, or PIF) to run (see remarks).
workingdir | [optional] The working directory. If not specified, then the value of @SystemDir will be used. This is not the path to the program.
show_flag | [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window (or Default keyword) @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window
opt_flag | [optional] Controls various options related to how the parent and child process interact. 0x10000 ($RUN_CREATE_NEW_CONSOLE) = The child console process should be created with it's own window instead of using the parent's window. This flag is only useful when the parent is compiled as a Console application.

Return Value

Success: | Returns the exit code of the program that was run.
Failure: | Returns 0 and sets @error to non-zero.

Remarks

Paths with spaces need to be enclosed in quotation marks.

It is important to specify a working directory the user you are running as has access to, otherwise the function will fail.

It is recommended that you only load the user's profile is you are sure you need it. There is a small chance a profile can be stuck in memory under the right conditions. If a script using RunAs() happens to be running as the SYSTEM account (for example, if the script is running as a service) and the user's profile is loaded, then you must take care that the script remains running until the child process closes.

When running as an administrator, the Secondary Logon (RunAs) service must be enabled or this function will fail. This does not apply when running as the SYSTEM account.

After running the requested program the script pauses until the program terminates. To run a program and then immediately continue script execution use the RunAs function instead.

Some programs will appear to return immediately even though they are still running; these programs spawn another process - you may be able to use the ProcessWaitClose function to handle these cases.

The "load profile" and "network credentials only" options are incompatible. Using both will produce undefined results.

There is an issue in the Windows XP generation of Windows which prevents STDIO redirection and the show flag from working. See Microsoft Knowledge Base article KB818858 for more information about which versions are affected as well as a hotfix for the issue. User's running Windows 2000, Windows XP SP2 or later, or Windows Vista are not affected.

Related

ProcessWait, ProcessWaitClose, Run, RunWait, ShellExecute, ShellExecuteWait, RunAs

Example

; Fill in the username and password appropriate for your system.
Local $sUserName = "Username"
Local $sPassword = "Password"

; Run a command prompt as the other user.
Local $pid = RunAsWait($sUserName, @ComputerName, $sPassword, 0, @ComSpec, @SystemDir)

; Wait for the process to close.
ProcessWaitClose($pid)

; Show a message.
MsgBox(0, "", "The process we were waiting for has closed.")


Function ShellExecute

Function Reference

ShellExecute

Runs an external program using the ShellExecute API.

ShellExecute ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] )

Parameters

filename | The name of the file to run (EXE, .txt, .lnk, etc).
parameters | [optional] Any parameters for the program. Blank ("") uses none.
workingdir | [optional] The working directory. Blank ("") uses the current working directory.
verb | [optional] The "verb" to use, common verbs include: open = Opens the file specified. The file can be an executable file, a document file, or a folder edit = Launches an editor and opens the document for editing. If "filename" is not a document file, the function will fail print = Prints the document file specified. If "filename" is not a document file, the function will fail properties = Displays the file or folder's properties See remarks for more information on the default behavior when a verb is not specified.
showflag | [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window

Return Value

Success: | Returns 1.
Failure: | Returns 0 and sets @error to non-zero.

Remarks

After running the requested program the script continues. To pause execution of the script until the spawned program has finished use the ShellExecuteWait function instead.

When no verb is specified the default verb is used. The default verb is the verb configured in the registry. If no verb is set as default in the registry then the "open" verb is used. If the "open" verb is not present then the first verb listed in the registry is used (except on Windows 2000).

Related

ShellExecuteWait, Run, RunWait, RunAs, RunAsWait

Example

; Open Notepad
ShellExecute("Notepad.exe")

; Open a .txt file with it's default editor
ShellExecute("myfile.txt", "", @ScriptDir, "edit")


Function ShellExecuteWait

Function Reference

ShellExecuteWait

Runs an external program using the ShellExecute API and pauses script execution until it finishes.

ShellExecuteWait ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] )

Parameters

filename | The name of the file to run (EXE, .txt, .lnk, etc).
parameters | [optional] Any parameters for the program. Blank ("") uses none.
workingdir | [optional] The working directory. Blank ("") uses the current working directory.
verb | [optional] The "verb" to use, common verbs include: open = Opens the file specified. The file can be an executable file, a document file, or a folder edit = Launches an editor and opens the document for editing. If "filename" is not a document file, the function will fail print = Prints the document file specified. If "filename" is not a document file, the function will fail properties = Displays the file or folder's properties See remarks for more information on the default behavior when a verb is not specified.
showflag | [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window

Return Value

Success: | Returns the exit code of the program that was run.
Failure: | Returns 0 and sets @error to non-zero.

Remarks

After running the requested program the script pauses until the requested program terminates

When no verb is specified the default verb is used. The default verb is the verb configured in the registry. If no verb is set as default in the registry then the "open" verb is used. If the "open" verb is not present then the first verb listed in the registry is used (except on Windows 2000).

Related

ShellExecute, Run, RunWait, RunAs, RunAsWait

Example

$val = ShellExecuteWait("Notepad.exe")

; script waits until Notepad closes
MsgBox(0, "Program returned with exit code:", $val)


Function Shutdown

Function Reference

Shutdown

Shuts down the system.

Shutdown ( code [, reason] )

Parameters

code | A combination of shutdown codes. See "remarks".
reason | [optional] user shudown reason code.

Return Value

Success: | Returns 1.
Failure: | Returns 0 and @error is set to GetLastError().

Remarks

The shutdown code is a combination of the following values:
0 = Logoff
1 = Shutdown
2 = Reboot
4 = Force
8 = Power down
16= Force if hung
32= Standby
64= Hibernate

Add the required values together. To shutdown and power down, for example, the code would be 9 (shutdown + power down = 1 + 8 = 9).

Standby or Hibernate are ignored if other codes are set.

Related

ProcessClose

Example

Shutdown(6) ;Force a reboot


Function StderrRead

Function Reference

StderrRead

Reads from the STDERR stream of a previously run child process.

StderrRead ( process_id[, peek = false[, binary = false]] )

Parameters

process_id | The process ID of a child process, as returned by a previous call to Run.
peek | [optional] If true the function does not remove the read characters from the stream.
binary | [optional] If true the function reads the data as binary instead of text (default is text).

Return Value

Success: | Returns the data read. @extended contains the number of bytes read.
Failure: | Sets @error to non-zero if EOF is reached, STDERR was not redirected for the process or other error.

Remarks

StderrRead reads from the console standard output stream of a child process, which is normally used by console applications to write to the screen. During the call to Run for the child process you wish to read from the STD I/O parameter must have included the value of $STDERR_CHILD (4) for this function to work properly (see the Run function).
StderrRead does not block, it will return immediately. In order to get all data, it must be called in a loop.
Peeking on the stream does not remove the data from the buffer, however, it does return the available data as normal.
By default, data is returned in text format. By using the binary option, the data will be returned in binary format.

Related

StdoutRead, StdinWrite, StdioClose, Run, RunAs

Example

; Demonstrates StdoutRead()
#include <Constants.au3>

Local $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $line
While 1
$line = StdoutRead($foo)
If @error Then ExitLoop
MsgBox(0, "STDOUT read:", $line)
Wend

While 1
$line = StderrRead($foo)
If @error Then ExitLoop
MsgBox(0, "STDERR read:", $line)
Wend

MsgBox(0, "Debug", "Exiting...")


Function StdinWrite

Function Reference

StdinWrite

Writes a number of characters to the STDIN stream of a previously run child process.

StdinWrite ( process_id[, data] )

Parameters

process_id | The process ID of a child process, as returned by a previous call to Run.
data | [optional] The data you wish to output. This may either be text or binary.

Return Value

Success: | Returns the number of characters written.
Failure: | Sets @error to non-zero if STDIN was not redirected for the process or other error.

Remarks

StdinWrite writes to the console standard input stream for a child process, which is normally used by console applications to read input from the user i.e. from the keyboard. During the call to Run for the child process you wish to write to the STD I/O parameter must have included the value of $STDIN_CHILD (1) for this function to work properly (see the Run function).

The optional second parameter is the string that you wish StdinWrite to write to the stream. If the function is called with no second argument, StdinWrite closes the stream and invalidates it for further writing.

The stream is a first-in first-out buffer with an arbitrary limited size; if at any time when this function is called (unless it's being called to close the stream) there is no room for more characters to be written to the stream, the StdinWrite function will block (pause) and not return until the child process closes the stream or reads enough characters from the stream to permit the write procedure to complete. This means that the AutoIt process will be halted, and there will be no processing of hotkeys, GUI messages, etc. until the child process reads from the STDIN stream.

Characters are converted to ANSI before being written.

Binary data is written as-is. It will not be converted to a string. To print the hex representation of binary data, use the String() function to explicitly cast the data to a string.

Related

StdoutRead, StderrRead, StdioClose, Run, RunAs

Example

; Demonstrates the use of StdinWrite()
#include <Constants.au3>

Local $foo = Run("sort.exe", @SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD)
; Write string to be sorted to child sort.exe's STDIN
StdinWrite($foo, "rat" & @CRLF & "cat" & @CRLF & "bat" & @CRLF)
; Calling with no 2nd arg closes stream
StdinWrite($foo)

; Read from child's STDOUT and show
Local $data
While True
$data &= StdoutRead($foo)
If @error Then ExitLoop
Sleep(25)
WEnd
MsgBox(0, "Debug", $data)


Function StdioClose

Function Reference

StdioClose

Closes all resources associated with a process previously run with STDIO redirection.

StdioClose ( process_id )

Parameters

process_id The process ID of a child process, as returned by a previous call to Run.

Return Value

Success: | Non-zero.
Failure: | 0 if the process did not have STDIO redirection or was already closed.

Remarks

This function closes all handles and releases all resources related to STDIO. It will no longer be possible to read the STDIO data from the process. Any pending data will be lost.

Related

StdoutRead, StderrRead, StdinWrite, Run, RunAs

Example

; Demonstrates StdioClose()
#include <Constants.au3>

Local $pid = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_MERGED + $STDOUT_CHILD)
StdioClose($pid)

; No data will be read because we closed all the streams we would read from.
Local $line
While 1
$line = StdoutRead($pid)
If @error Then ExitLoop
MsgBox(0, "STDOUT read:", $line)
Wend

While 1
$line = StderrRead($pid)
If @error Then ExitLoop
MsgBox(0, "STDERR read:", $line)
Wend

MsgBox(0, "Debug", "Exiting...")


Function StdoutRead

Function Reference

StdoutRead

Reads from the STDOUT stream of a previously run child process.

StdoutRead ( process_id[, peek = false[, binary = false]] )

Parameters

process_id | The process ID of a child process, as returned by a previous call to Run.
peek | [optional] If true the function does not remove the read characters from the stream.
binary | [optional] If true the function reads the data as binary instead of text (default is text).

Return Value

Success: | Returns the data read. @extended contains the number of bytes read.
Failure: | Sets @error to non-zero if EOF is reached, STDOUT was not redirected for the process or other error.

Remarks

StdoutRead reads from the console standard output stream of a child process, which is normally used by console applications to write to the screen. During the call to Run for the child process you wish to read from the STD I/O parameter must have included the value of $STDOUT_CHILD (2) for this function to work properly (see the Run function).
StdoutRead does not block, it will return immediately. In order to get all data, it must be called in a loop.
Peeking on the stream does not remove the data from the buffer, however, it does return the available data as normal.
By default, data is returned in text format. By using the binary option, the data will be returned in binary format.

Related

StderrRead, StdinWrite, StdioClose, Run, RunAs

Example

; Demonstrates StdoutRead()
#include <Constants.au3>

Local $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $line
While 1
$line = StdoutRead($foo)
If @error Then ExitLoop
MsgBox(0, "STDOUT read:", $line)
Wend

While 1
$line = StderrRead($foo)
If @error Then ExitLoop
MsgBox(0, "STDERR read:", $line)
Wend

MsgBox(0, "Debug", "Exiting...")


Functions

Registry functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
RegDelete | Deletes a key or value from the registry.
RegEnumKey | Reads the name of a subkey according to it's instance.
RegEnumVal | Reads the name of a value according to it's instance.
RegRead | Reads a value from the registry.
RegWrite | Creates a key or value in the registry.


Function RegDelete

Function Reference

RegDelete

Deletes a key or value from the registry.

RegDelete ( "keyname" [, "valuename"] )

Parameters

keyname | The registry key to delete.
valuename | [optional] The valuename to delete.

Return Value

Success: | Returns 1.
Special: | Returns 0 if the key/value does not exist.
Failure: | Returns 2 if error deleting key/value.
 | @error can be set to following values :
 | 1 if unable to open requested key
 | 2 if unable to open requested main key
 | 3 if unable to remote connect to the registry
 | -1 if unable to delete requested value
 | -2 if unable to delete requested key/value

Remarks

A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC").

When running on 64-bit Windows if you want to delete a key or value specific to the 64-bit environment you have to suffix the HK... with 64 i.e. HKLM64.

To access the (Default) value use "" (a blank string) for the valuename.

Deleting from the registry is potentially dangerous--please exercise caution!

It is possible to access remote registries by using a keyname in the form "\\computername\keyname". To use this feature you must have the correct access rights.

Related

RegRead, RegWrite, RegEnumKey, RegEnumVal

Example

RegDelete("HKEY_CURRENT_USER\Software\Test", "TestKey")

RegWrite("HKEY_CURRENT_USER\Software\Test")
RegWrite("HKEY_CURRENT_USER\Software\Test1")


Function RegEnumKey

Function Reference

RegEnumKey

Reads the name of a subkey according to it's instance.

RegEnumKey ( "keyname", instance )

Parameters

keyname | The registry key to read.
instance | The 1-based key instance to retrieve

Return Value

Success: | Returns the requested subkey name..
Failure: | Returns an empty string and sets @error to:
 | 1 if unable to open requested key
 | 2 if unable to open requested main key
 | 3 if unable to remote connect to the registry
 | -1 if unable to retrieve requested subkey (key instance out of range)

Remarks

A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC").

When running on 64-bit Windows if you want to enum a key specific to the 64-bit environment you have to suffix the HK... with 64 i.e. HKLM64.

Related

RegEnumVal, RegDelete, RegWrite

Example

For $i= 1 to 10
$var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE", $i)
If @error <> 0 then ExitLoop
MsgBox(4096, "SubKey #" & $i & " under HKLM\Software: ", $var)
Next


Function RegEnumVal

Function Reference

RegEnumVal

Reads the name of a value according to it's instance.

RegEnumVal ( "keyname", instance )

Parameters

keyname | The registry key to read.
instance | The 1-based value instance to retrieve

Return Value

Success: | Returns the requested registry value. @EXTENDED is set to the type of the value.
Failure: | Returns an empty string and sets @error to:
 | 1 if unable to open requested key
 | 2 if unable to open requested main key
 | 3 if unable to remote connect to the registry
 | -1 if unable to retrieve requested value name (value instance out of range)

Remarks

A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC").

When running on 64-bit Windows if you want to enum a value specific to the 64-bit environment you have to suffix the HK... with 64 i.e. HKLM64.

Related

RegEnumKey, RegDelete, RegWrite

Example

For $i = 1 to 100
$var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\Autoit", $i)
if @error <> 0 Then ExitLoop
MsgBox(4096, "Value Name #" & $i & " under in AutoIt3 key", $var)
next


Function RegRead

Function Reference

RegRead

Reads a value from the registry.

RegRead ( "keyname", "valuename" )

Parameters

keyname | The registry key to read.
valuename | The value to read.

Return Value

Success: | Returns the requested registry value. @EXTENDED is set to the type of the value $REG_... . These types are defined in the "Constants.au3" include file.
Failure: | Returns "" and sets the @error flag:
 | 1 if unable to open requested key
 | 2 if unable to open requested main key
 | 3 if unable to remote connect to the registry
 | -1 if unable to open requested value
 | -2 if value type not supported

Remarks

A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC").

When running on 64-bit Windows if you want to read a value specific to the 64-bit environment you have to suffix the HK... with 64 i.e. HKLM64.

AutoIt supports registry keys of type REG_BINARY, REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, and REG_DWORD.

To access the (Default) value use "" (a blank string) for the valuename.

When reading a REG_BINARY key the result is a binary datatype (in previous versions it was a string of hex characters).

When reading a REG_MULTI_SZ key the multiple entries are separated by @LF - use with StringSplit(..., @LF) to get each entry.

It is possible to access remote registries by using a keyname in the form "\\computername\keyname". To use this feature you must have the correct access rights.

Related

RegDelete, RegWrite, StringSplit

Example

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")
MsgBox(4096, "Program files are in:", $var)


Function RegWrite

Function Reference

RegWrite

Creates a key or value in the registry.

RegWrite ( "keyname" [,"valuename" [, "type" [, value]]] )

Parameters

keyname | The registry key to write to. If no other parameters are specified this key will simply be created.
valuename | [optional] The valuename to write to.
type | [optional] Type of key to write: "REG_SZ", "REG_MULTI_SZ", "REG_EXPAND_SZ", "REG_DWORD", "REG_QWORD", or "REG_BINARY".
value | [optional] The value to write.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if error writing registry key or value.
 | @error can be set to following values :
 | 1 if unable to open requested key
 | 2 if unable to open requested main key
 | 3 if unable to remote connect to the registry
 | -1 if unable to open requested value
 | -2 if value type not supported

Remarks

A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC").

When running on 64-bit Windows if you want to write a key or value specific to the 64-bit environment you have to suffix the HK... with 64 i.e. HKLM64.

AutoIt supports registry keys of type REG_BINARY, REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, REG_QWORD, and REG_DWORD.

To access the (Default) value use "" (a blank string) for the valuename.

When writing a REG_MULTI_SZ key you must separate each value with @LF. The value must NOT end with @LF unless you want ant empty substring (see example).

It is possible to access remote registries by using a keyname in the form "\\computername\keyname". To use this feature you must have the correct access rights on NT/2000/XP/2003.

Related

RegDelete, RegRead, RegEnumKey, RegEnumVal

Example

; Write a single REG_SZ value
RegWrite("HKEY_CURRENT_USER\Software\Test", "TestKey", "REG_SZ", "Hello this is a test")

; Write the REG_MULTI_SZ value of "line1" and "line2"
RegWrite("HKEY_CURRENT_USER\Software\Test", "TestKey1", "REG_MULTI_SZ", "line1" & @LF & "line2")

; Write the REG_MULTI_SZ value of "line1"
RegWrite("HKEY_CURRENT_USER\Software\Test", "TestKey2", "REG_MULTI_SZ", "line1")

; always add and extra null string
RegWrite("HKEY_CURRENT_USER\Software\Test", "TestKey3", "REG_MULTI_SZ", "line1" & @LF & "line2" & @LF)
RegWrite("HKEY_CURRENT_USER\Software\Test", "TestKey4", "REG_MULTI_SZ", "line1" & @LF & @LF & "line2" & @LF)

; empty REG_MULTI_SZ
RegWrite("HKEY_CURRENT_USER\Software\Test", "TestKey5", "REG_MULTI_SZ", "")

; create just the key
RegWrite("HKEY_CURRENT_USER\Software\Test1")


Functions

String functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
StringAddCR | Takes a string and prefixes all linefeed characters ( Chr(10) ) with a carriage return character ( Chr(13) ).
StringCompare | Compares two strings with options.
StringInStr | Checks if a string contains a given substring.
StringIsAlNum | Checks if a string contains only alphanumeric characters.
StringIsAlpha | Checks if a string contains only alphabetic characters.
StringIsASCII | Checks if a string contains only ASCII characters in the range 0x00 - 0x7f (0 - 127).
StringIsDigit | Checks if a string contains only digit (0-9) characters.
StringIsFloat | Checks if a string is a floating point number.
StringFormat | Returns a formatted string (similar to the C sprintf() function).
StringFromASCIIArray | Converts an array of ASCII codes to a string.
StringIsInt | Checks if a string is an integer.
StringIsLower | Checks if a string contains only lowercase characters.
StringIsSpace | Checks if a string contains only whitespace characters.
StringIsUpper | Checks if a string contains only uppercase characters.
StringIsXDigit | Checks if a string contains only hexadecimal digit (0-9, A-F) characters.
StringLeft | Returns a number of characters from the left-hand side of a string.
StringLen | Returns the number of characters in a string.
StringLower | Converts a string to lowercase.
StringMid | Extracts a number of characters from a string.
StringRegExp | Check if a string fits a given regular expression pattern.
StringRegExpReplace | Replace text in a string based on regular expressions.
StringReplace | Replaces substrings in a string.
StringRight | Returns a number of characters from the right-hand side of a string.
StringSplit | Splits up a string into substrings depending on the given delimiters.
StringStripCR | Removes all carriage return values ( Chr(13) ) from a string.
StringStripWS | Strips the white space in a string.
StringToASCIIArray | Converts a string to an array containing the ASCII code of each character.
StringTrimLeft | Trims a number of characters from the left hand side of a string.
StringTrimRight | Trims a number of characters from the right hand side of a string.
StringUpper | Converts a string to uppercase.


Function StringAddCR

Function Reference

StringAddCR

Takes a string and prefixes all linefeed characters ( Chr(10) ) with a carriage return character ( Chr(13) ).

StringAddCR ( "string" )

Parameters

string The string to convert.

Return Value

Returns the string with all instances of linefeed characters ( @LF ) prefixed with a carriage return character ( @CR ).

Remarks

None.

Related

StringStripCR, StringReplace

Example

$old = "Notepad" & @LF & "expects" & @LF & "CRLF text."
$new = StringAddCR($old)


Function StringCompare

Function Reference

StringCompare

Compares two strings with options.

StringCompare ( "string1", "string2" [, casesense] )

Parameters

string1 | The first string to evaluate.
string2 | The second string to evaluate.
casesense | [optional] Flag to indicate if the operations should be case sensitive. 0 = not case sensitive, using the user's locale (default) 1 = case sensitive 2 = not case sensitive, using a basic/faster comparison

Return Value

0 | string1 and string2 are equal
> 0 | string1 is greater than string2
< 0 | string1 is less than string2

Remarks

None.

Related

StringInStr, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper

Example

$result = StringCompare("MELÓN", "melón")
MsgBox(0, "StringCompare Result (mode 0):", $result)

$result = StringCompare("MELÓN", "melón", 1)
MsgBox(0, "StringCompare Result (mode 1):", $result)

$result = StringCompare("MELÓN", "melón", 2)
MsgBox(0, "StringCompare Result (mode 2):", $result)


Function StringInStr

Function Reference

StringInStr

Checks if a string contains a given substring.

StringInStr ( "string", "substring" [, casesense [, occurrence [, start [, count]]]] )

Parameters

string | The string to evaluate.
substring | The substring to search for.
casesense | [optional] Flag to indicate if the operations should be case sensitive. 0 = not case sensitive, using the user's locale (default) 1 = case sensitive 2 = not case sensitive, using a basic/faster comparison
occurrence | [optional] Which occurrence of the substring to find in the string. Use a negative occurrence to search from the right side. The default value is 1 (finds first occurrence).
start | [optional] The starting position of the search.
count | [optional] The number of characters to search. This effectively limits the search to a portion of the full string. See remarks.

Return Value

Success: | Returns the position of the substring.
Failure: | Returns 0 if substring not found.
@Error | 0 - Normal operation
 | 1 - Invalid "start" or "occurence" parameter given.

Remarks

The first character position is 1.

The count parameter must be longer than the substring being searched for. The count parameter (combined with the start parameter) effectively limits the search to a substring of the full string. The following two statements are equivalent:
StringInStr("the string to search", "string", 0, 1, 1, 11)
StringInStr(StringMid("the string to search", 1, 11), "string")

Related

StringCompare, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper, StringRegExp, StringSplit

Example

$result = StringInStr("I am a String", "RING")
MsgBox(0, "Search result:", $result)

$location = StringInStr("How much wood could a woodchuck chuck is a woodchuck could chuck wood?", "wood", 0, 3) ; Find the 3rd occurance of "wood"


Function StringIsAlNum

Function Reference

StringIsAlNum

Checks if a string contains only alphanumeric characters.

StringIsAlNum ( "string" )

Parameters

string The string to check

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string contains non-alphanumeric characters.

Remarks

Keep in mind that any whitespace will cause StringIsAlNum to return 0.

Related

StringIsAlpha, StringIsASCII, StringIsDigit, StringIsLower, StringIsSpace, StringIsUpper, StringIsXDigit, StringUpper, StringLower

Example

$x = "This is a sentence with whitespace."
MsgBox(0,"StringIsAlNum returns:", StringIsAlNum($x))


Function StringIsAlpha

Function Reference

StringIsAlpha

Checks if a string contains only alphabetic characters.

StringIsAlpha ( "string" )

Parameters

string The string to check

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string contains non-alphabetic characters.

Remarks

Keep in mind that any whitespace will cause StringIsAlpha to return 0.

Related

StringIsAlNum, StringIsASCII, StringIsDigit, StringIsLower, StringIsSpace, StringIsUpper, StringIsXDigit, StringUpper, StringLower

Example

$x = "This is a sentence with whitespace."
MsgBox(0,"StringIsAlpha returns:", StringIsAlpha($x))


Function StringIsASCII

Function Reference

StringIsASCII

Checks if a string contains only ASCII characters in the range 0x00 - 0x7f (0 - 127).

StringIsASCII ( "string" )

Parameters

string The string to check

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string contains extended ASCII characters.

Remarks

None.

Related

StringIsAlNum, StringIsAlpha, StringIsDigit, StringIsLower, StringIsSpace, StringIsUpper, StringIsXDigit, StringUpper, StringLower

Example

$x = StringIsASCII("This is a sentence.")
MsgBox(0,"StringIsASCII returns:", $x)


Function StringIsDigit

Function Reference

StringIsDigit

Checks if a string contains only digit (0-9) characters.

StringIsDigit ( "string" )

Parameters

string The string to check

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string contains non-digits.

Remarks

See examples.

Related

StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsLower, StringIsSpace, StringIsUpper, StringIsXDigit, StringIsInt

Example

StringIsDigit("12333") ;returns 1
StringIsDigit("1.5") ;returns 0 due to decimal point
StringIsDigit("1 2 3") ;returns 0 due to whitespace
StringIsDigit("") ;returns 0


Function StringIsFloat

Function Reference

StringIsFloat

Checks if a string is a floating point number.

StringIsFloat ( "string" )

Parameters

string The string or expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if not floating point format.

Remarks

A string is a float if it contains at least one decimal digit and exactly one period; the only other character allowed is an optional plus or minus at the beginning. (StringIsFloat does not accept a comma character as the decimal point even if the computer Locale settings use that symbol.) If parameter is not a string, its value is converted to a string. See examples.

Related

StringIsInt, IsFloat

Example

StringIsFloat("1.5") ;returns 1
StringIsFloat("7.") ;returns 1 since contains decimal
StringIsFloat("-.0") ;returns 1
StringIsFloat("3/4") ;returns 0 since '3' slash '4' is not a float
StringIsFloat("2") ; returns 0 since '2' is an interger, not a float

StringIsFloat(1.5) ;returns 1 since 1.5 converted to string contain .
StringIsFloat(1.0) ;returns 0 since 1.0 converted to string does not contain .


Function StringFormat

Function Reference

StringFormat

Returns a formatted string (similar to the C sprintf() function).

StringFormat ( "format control", var1 [, ... var32] )

Parameters

format control | The format and flags to use (see Remarks).
var1...var32 | Up to 32 variables that will be output according to the "format control".

Return Value

Return the formatted string according to "variable format" defined in the "format control" parameter.

Remarks

To prevent buffer overflow, each "variable" is limited to 65535 characters.
Escape characters can be contain in the "format control" such as \n (@LF), \r (@CR), \t (@TAB]. So if you want to have a "\" you need to use \\, samething for "%" %%.

"variable format" is; %[flags] [width] [.precision] type

Width Specification

The second optional field of the format specification is the width specification. The width argument is a nonnegative decimal integer controlling the minimum number of characters printed. If the number of characters in the output value is less than the specified width, blanks are added to the left or the right of the values — depending on whether the – flag (for left alignment) is specified — until the minimum width is reached. If width is prefixed with 0, zeros are added until the minimum width is reached (not useful for left-aligned numbers).

The width specification never causes a value to be truncated. If the number of characters in the output value is greater than the specified width, or if width is not given, all characters of the value are printed (subject to the precision specification).

Type Specification

Type | Variable type | Output format
d, i | Integer | Signed decimal integer.
o | Integer | Unsigned octal integer.
u | Integer | Unsigned decimal integer.
x | Integer | Unsigned hexadecimal integer, using "abcdef".
X | Integer | Unsigned hexadecimal integer, using "ABCDEF".
e | Float | Signed value having the form [ - ]d.dddd e [sign]ddd where d is a single decimal digit, dddd is one or more decimal digits, ddd is exactly three decimal digits, and sign is + or -.
E | Float | Identical to the e format except that E rather than e introduces the exponent.
f | Float | Signed value having the form [ - ]dddd.dddd, where dddd is one or more decimal digits. The number of digits before the decimal point depends on the magnitude of the number, and the number of digits after the decimal point depends on the requested precision.
g | Float | Signed value printed in f or e format, whichever is more compact for the given value and precision. The e format is used only when the exponent of the value is less than -4 or greater than or equal to the precision argument. Trailing zeros are truncated, and the decimal point appears only if one or more digits follow it.
G | Float | Identical to the g format, except that E, rather than e, introduces the exponent (where appropriate).
s | String | String.

Flag Specification

Flag | Meaning | Default
- | Left align the result within the given field width. | Right align.
+ | Prefix the output value with a sign (+ or -) if the output value is of a signed type. | Sign appears only for negative signed values (-).
0 | If width is prefixed with 0, zeros are added until the minimum width is reached. If 0 and - appear, the 0 is ignored. If 0 is specified with an integer format (i, u, x, X, o, d) the 0 is ignored. | No padding.
Blank | Prefix the output value with a blank if the output value is signed and positive; the blank is ignored if both the blank and + flags appear. | No blank appears.
# | When used with the o, x, or X format, the # flag prefixes any nonzero output value with 0, 0x, or 0X, respectively. | No blank appears.
# | When used with the e, E, or f format, the # flag forces the output value to contain a decimal point in all cases. | Decimal point appears only if digits follow it.
# | When used with the g or G format, the # flag forces the output value to contain a decimal point in all cases and prevents the truncation of trailing zeros. Ignored when used with c, d, i, u, or s. | Decimal point appears only if digits follow it. Trailing zeros are truncated.

Precision Specification

The third optional field of the format specification is the precision specification. It specifies a nonnegative decimal integer, preceded by a period (.), which specifies the number of characters to be printed, the number of decimal places, or the number of significant digits (see Table below). Unlike the width specification, the precision specification can cause either truncation of the output value or rounding of a floating-point value. If precision is specified as 0 and the value to be converted is 0, the result is no characters output, as shown below:

StringFormat( "%.0d", 0 ); /* No characters return */

How Precision Values Affect Type

Type | Meaning | Default
d, i, u, o, x, X | The precision specifies the minimum number of digits to be printed. If the number of digits in the argument is less than precision, the output value is padded on the left with zeros. The value is not truncated when the number of digits exceeds precision. | Default precision is 1.
e, E | The precision specifies the number of digits to be printed after the decimal point. The last printed digit is rounded. | Default precision is 6; if precision is 0 or the period (.) appears without a number following it, no decimal point is printed.
f | The precision value specifies the number of digits after the decimal point. If a decimal point appears, at least one digit appears before it. The value is rounded to the appropriate number of digits. | Default precision is 6; if precision is 0, or if the period (.) appears without a number following it, no decimal point is printed.
g, G | The precision specifies the maximum number of significant digits printed. | Six significant digits are printed, with any trailing zeros truncated.
s | The precision specifies the maximum number of characters to be printed. Characters in excess of precision are not printed. | Characters are printed until a null character is encountered.

Related

None.

Example

$n = 43951789;
$u = -43951789;

; notice the double %%, this prints a literal '%' character
printf("%%d = '%d'\n", $n); '43951789' standard integer representation
printf("%%e = '%e'\n", $n); '4.395179e+007' scientific notation
printf("%%u = '%u'\n", $n); '43951789' unsigned integer representation of a positive integer
printf("%%u <0 = '%u'\n", $u); '4251015507' unsigned integer representation of a negative integer
printf("%%f = '%f'\n", $n); '43951789.000000' floating point representation
printf("%%.2f = '%.2f'\n", $n); '43951789.00' floating point representation 2 digits after the decimal point
printf("%%o = '%o'\n", $n); '247523255' octal representation
printf("%%s = '%s'\n", $n); '43951789' string representation
printf("%%x = '%x'\n", $n); '29ea6ad' hexadecimal representation (lower-case)
printf("%%X = '%X'\n", $n); '29EA6AD' hexadecimal representation (upper-case)

printf("%%+d = '%+d'\n", $n); '+43951789' sign specifier on a positive integer
printf("%%+d <0= '%+d'\n", $u); '-43951789' sign specifier on a negative integer

$s = 'monkey';
$t = 'many monkeys';

printf("%%s = [%s]\n", $s); [monkey] standard string output
printf("%%10s = [%10s]\n", $s); [ monkey] right-justification with spaces
printf("%%-10s = [%-10s]\n", $s); [monkey ] left-justification with spaces
printf("%%010s = [%010s]\n", $s); [0000monkey] zero-padding works on strings too
printf("%%10.10s = [%10.10s]\n", $t); [many monke] left-justification but with a cutoff of 10 characters

printf("%04d-%02d-%02d\n", 2008, 4, 1);

Func Printf($format, $var1, $var2=-1, $var3=-1)
If $var2=-1 Then
ConsoleWrite(StringFormat($format, $var1))
Else
ConsoleWrite(StringFormat($format, $var1, $var2, $var3))
EndIf
EndFunc


Function StringFromASCIIArray

Function Reference

StringFromASCIIArray

Converts an array of ASCII codes to a string.

StringFromASCIIArray( array, [ start [, end [, encoding ] ] ] )

Parameters

array | The array of ASCII codes to convert to characters.
start | [optional] The 0-based index to start processing from (Default: 0).
end | [optional] The 0-based index to end processing at (Default: UBound($array) - 1).
encoding | [optional] The array contains values in the specified character set: 0 - UTF-16 (Default) 1 - ANSI 2 - UTF-8

Return Value

Success: | A string with character representations of the ASCII codes.
Failure: | Returns an empty string and sets @error to non-zero. @error can be:
 | 1 - Input is not an array.
 | 2 - Invalid start index.

Remarks

The returned string may contain embedded Chr(0) but will still be a string type. Most string functions will stop at the first Chr(0) found, however, if access to the entire contents of the string is required then the StringToBinary() function can convert it into a BinaryString preserving all the data.

If you attempt to create an array manually (As opposed to using an array returned from StringToASCIIArray()) then the codes in the array must be specified in UNICODE.

Related

StringToASCIIArray

Example

#include <Array.au3> ; For _ArrayDisplay()

; Convert the string to an array.
Local $a = StringToASCIIArray("abc")

; Display the array to see that it contains the ASCII
; values for each character.
_ArrayDisplay($a)

; Now convert the array into a string.
Local $s = StringFromASCIIArray($a)

; Display the string to see that it matches the original input.
MsgBox(0, "", $s)


Function StringIsInt

Function Reference

StringIsInt

Checks if a string is an integer.

StringIsInt ( "string" )

Parameters

string The string to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string cannot be an integer.

Remarks

StringIsInt also returns 1 for non-string integer expressions; however, StringIsInt returns 0 for hexadecimal expressions such as "4ff0". The only punctuation allowed is either a plus or a minus at the beginning of the string.

Related

StringIsFloat, StringIsDigit, IsInt

Example

StringIsInt("+42") ;returns 1
StringIsInt("-00") ;returns 1
StringIsInt("1.0") ;returns 0 due to the decimal point
StringIsInt(1.0) ;returns 1 due to number-string conversion
StringIsInt("1+2") ;returns 0 due to plus sign


Function StringIsLower

Function Reference

StringIsLower

Checks if a string contains only lowercase characters.

StringIsLower ( "string" )

Parameters

string The string to check

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string contains non-lowercase characters.

Remarks

Note that digits/punctuation/whitespace will cause StringIsLower to return 0.

Related

StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsDigit, StringIsSpace, StringIsUpper, StringIsXDigit, StringUpper, StringLower

Example

If StringIsLower("abcfoo") Then
MsgBox(0, "Result:", "String contained only lowercase letters")
EndIf


Function StringIsSpace

Function Reference

StringIsSpace

Checks if a string contains only whitespace characters.

StringIsSpace ( "string" )

Parameters

string The string to check

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string contains non-whitespace characters.

Remarks

Whitespace includes Chr(9) thru Chr(13) which are HorizontalTab, LineFeed, VerticalTab, FormFeed, and CarriageReturn.

Whitespace also includes the standard space ( Chr(32) ).

Related

StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsDigit, StringIsLower, StringIsUpper, StringIsXDigit, StringUpper, StringLower, StringStripCR, StringStripWS

Example

$x = " " & @LF & Chr(11) & @TAB & " " & @CRLF
If StringIsSpace($x) Then
MsgBox(0,"", "String only contained whitespace characters.")
EndIf


Function StringIsUpper

Function Reference

StringIsUpper

Checks if a string contains only uppercase characters.

StringIsUpper ( "string" )

Parameters

string The string to check

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string contains non-uppercase characters.

Remarks

Note that digits/punctuation/whitespace will cause StringIsUpper to return 0.

Related

StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsDigit, StringIsLower, StringIsSpace, StringIsXDigit, StringUpper, StringLower

Example

If StringIsUpper("ABCDF") Then
MsgBox(4096, "", "String contains only UPPERCASE letters")
EndIf


Function StringIsXDigit

Function Reference

StringIsXDigit

Checks if a string contains only hexadecimal digit (0-9, A-F) characters.

StringIsXDigit ( "string" )

Parameters

string The string to check

Return Value

Success: | Returns 1.
Failure: | Returns 0 if string contains non-hexadecimal characters.

Remarks

Valid characters are 0123456789abcdefABCDEF Note that a string containing whitespace or the "0x" prefix will cause StringIsXDigit to return 0.

Related

StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsDigit, StringIsLower, StringIsSpace, StringIsUpper, StringUpper, StringLower

Example

StringIsXDigit("00FC") ;returns 1
StringIsXDigit("2570") ;returns 1
StringIsXDigit("a cafe") ;returns 0 due to space
StringIsXDigit(1 + 2.0) ;returns 1 due to number-string conversion


Function StringLeft

Function Reference

StringLeft

Returns a number of characters from the left-hand side of a string.

StringLeft ( "string", count )

Parameters

string | The string to evaluate.
count | The number of characters to get.

Return Value

Returns a string containing the leftmost count characters of the string.

Remarks

If count exceeds string length, the entire string is returned.
If count is negative, an empty string is returned.

Related

StringInStr, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper, StringCompare, StringReplace, StringSplit

Example

$result = StringLeft("I am a string", 3)
MsgBox(0, "Leftmost 3 characters are:", $result)


Function StringLen

Function Reference

StringLen

Returns the number of characters in a string.

StringLen ( "string" )

Parameters

string The string to evaluate.

Return Value

Returns the length of the string.

Remarks

A numeric expression is automatically evaluated and converted to a string.

Related

StringInStr, StringLeft, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper, StringCompare, StringReplace, StringSplit

Example

$len = StringLen("How long am I?")
MsgBox(0, "String length is:", $len)


Function StringLower

Function Reference

StringLower

Converts a string to lowercase.

StringLower ( "string" )

Parameters

string The string to convert.

Return Value

Returns the string converted to lowercase.

Remarks

None.

Related

StringIsLower, StringIsUpper, StringInStr, StringLeft, StringLen, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper, StringCompare, StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsSpace, StringIsXDigit, StringReplace, StringSplit

Example

$var = StringLower("I Am A String")
MsgBox(0, "String converted to lowercase is:", $var)


Function StringMid

Function Reference

StringMid

Extracts a number of characters from a string.

StringMid ( "string", start [, count] )

Parameters

string | The string to evaluate.
start | The character position to start. (1 = first character)
count | [optional] The number of characters to extract. By default the entire remainder of the string.

Return Value

Returns the extracted string.

Remarks

If start is out-of-bounds, an empty string is returned. If start is valid but count is out-of-bounds, the entire remainder of the string is returned.

Related

StringInStr, StringLeft, StringLen, StringLower, StringRight, StringTrimLeft, StringTrimRight, StringUpper, StringCompare, StringReplace, StringSplit

Example

$var = StringMid("I am a string", 3, 2)
MsgBox(0, "2 chars extracted from position 3 are:", $var)


Function StringRegExp

Function Reference

StringRegExp

Check if a string fits a given regular expression pattern.

StringRegExp ( "test", "pattern" [, flag ] [, offset ] ] )

Parameters

test | The string to check
pattern | The regular expression to compare.
flag | [optional] A number to indicate how the function behaves. See below for details. The default is 0.
offset | [optional] The string position to start the match (starts at 1) The default is 1.

Flag | Values
0 | Returns 1 (matched) or 0 (no match)
1 | Return array of matches.
2 | Return array of matches including the full match (Perl / PHP style).
3 | Return array of global matches.
4 | Return an array of arrays containing global matches including the full match (Perl / PHP style).

Return Value

Flag = 0 :
@Error | Meaning
2 | Bad pattern. @Extended = offset of error in pattern.

Flag = 1 or 2 :
@Error | Meaning
0 | Array is valid. Check @Extended for next offset
1 | Array is invalid. No matches.
2 | Bad pattern, array is invalid. @Extended = offset of error in pattern.

Flag = 3 or 4 :
@Error | Meaning
0 | Array is valid.
1 | Array is invalid. No matches.
2 | Bad pattern, array is invalid. @Extended = offset of error in pattern.

Remarks

The flag parameter can have one of 5 values (0 through 4). 0 gives a true (1) or false (0) as to whether the pattern was found or not. 1 and 2 find the first match and returns it in an array. 3 and 4 find multiple hits and fills the array with all the matching text. 2 and 4 include the full matching text as the first record, not just the capturing groups, which is all you get with flag 1 and 3.

Regular expression notation is a compact way of specifying a pattern for strings that can be searched. Regular expressions are character strings in which plain text characters indicate what text should exist in the target string, and a some characters are given special meanings to indicate what variability is allowed in the target string. AutoIt regular expressions are normally case-sensitive.

Regular expressions are constructed of one or more of the following simple regular expression specifiers. If the character is not in the following table, then it will match only itself.

Repeating characters (*, +, ?, {...} ) will try to match the largest set possible, which allows the following characters to match as well, unless followed immediately by a question mark; then it will find the smallest pattern that allows the following characters to match as well.

Nested groups are allowed, but keep in mind that all the groups, except non-capturing groups, assign to the returned array, with the outer groups assigning after the inner groups.

Complete description can be found here

Caution: bad regular expressions can produce a quasi-infinite loop hogging the CPU, and can even cause a crash.

Matching Characters

[ ... ] | Match any character in the set. e.g. [aeiou] matches any lower-case vowel. A contiguous set can be defined using a dash between the starting and ending characters. e.g. [a-z] matches any lower case character. To include a dash (-) in a set, use it as the first or last character of the set. To include a closing bracket in a set, use it as the first character of the set. e.g. [][] will match either [ or ]. Note that special characters do not retain their special meanings inside a set, with the exception of \\, \^, \-,\[ and \] match the escaped character inside a set.
[^ ... ] | Match any character not in the set. e.g. [^0-9] matches any non-digit. To include a caret (^) in a set, put it after the beginning of the set or escape it (\^).
[:class:] | Match a character in the given class of characters. Valid classes are: alpha (any alphabetic character), alnum (any alphanumeric character), lower (any lower-case letter), upper (any upper-case letter), digit (any decimal digit 0-9), xdigit (any hexadecimal digit, 0-9, A-F, a-f), space (any whitespace character), blank (only a space or tab), print (any printable character), graph (any printable character except spaces), cntrl (any control character [ascii 127 or <32]) or punct (any punctuation character). So [0-9] is equivalent to [[:digit:]].
[^:class:] | Match any character not in the class, but only if the first character.
( ... ) | Group. The elements in the group are treated in order and can be repeated together. e.g. (ab)+ will match "ab" or "abab", but not "aba". A group will also store the text matched for use in back-references and in the array returned by the function, depending on flag value.
(?i) | Case-insensitivity flag. This does not operate as a group. It tells the regular expression engine to do case-insensitive matching from that point on.
(?-i) | (default) Case-sensitivity flag. This does not operate as a group. It tells the regular expression engine to do case-sensitive matching from that point on.
(?: ... ) | Non-capturing group. Behaves just like a normal group, but does not record the matching characters in the array nor can the matched text be used for back-referencing.
(?i: ... ) | Case-insensitive non-capturing group. Behaves just like a non-capturing group, but performs case-insensitive matches within the group.
(?-i: ... ) | Case-sensitive non-capturing group. Behaves just like a non-capturing group, but performs case-sensitive matches within the group.
(?m) | ^ and $ match newlines within data.
(?s) | . matches anything including newline. (by default "." don't match newline)
(?x) | Ignore whitespace and # comments.
(?U) | Invert greediness of quantifiers.
. | Match any single character (except newline).
| | Or. The expression on one side or the other can be matched.
\ | Escape a special character (have it match the actual character) or introduce a special character type (see below).
\\ | Match an actual backslash (\).
\a | Alarm, that is, the BEL character (chr(7)).
\A | Match only at beginning of string.
\b | Matches at a word boundary.
\B | Matches when not at a word boundary.
\c | Match a control character, based on the next character. For example, \cM matches ctrl-M.
\d | Match any digit (0-9).
\D | Match any non-digit.
\e | Match an escape character (chr(27)).
\E | end case modification.
\f | Match an formfeed character (chr(12)).
\h | any horizontal whitespace character.
\H | any character that is not a horizontal whitespace character.
\n | Match a linefeed (@LF, chr(10)).
\Q | quote (disable) pattern metacharacters till \E.
\r | Match a carriage return (@CR, chr(13)).
\s | Match any whitespace character: Chr(9) through Chr(13) which are Horizontal Tab, Line Feed, Vertical Tab, Form Feed, and Carriage Return, and the standard space ( Chr(32) ).
\S | Match any non-whitespace character.
\t | Match a tab character (chr(9)).
\v | any vertical whitespace character.
\V | any character that is not a vertical whitespace character.
\w | Match any "word" character: a-z, A-Z, 0-9 or underscore (_).
\W | Match any non-word character.
\### | Match the ascii character whose code is given or back-reference. Can be up to 3 octal digits. Match back-reference if found. Match the prior group number given exactly. For example, ([:alpha:])\1 would match a double letter.
\x## | Match the ascii character whose code is given in hexadecimal. Can be up to 2 digits.
\z | Match only at end of string.
\Z | Match only at end of string, or before newline at the end.

Repeating Characters

{x} | Repeat the previous character, set or group exactly x times.
{x,} | Repeat the previous character, set or group at least x times.
{0,x} | Repeat the previous character, set or group at most x times.
{x, y} | Repeat the previous character, set or group between x and y times, inclusive.
* | Repeat the previous character, set or group 0 or more times. Equivalent to {0,}
+ | Repeat the previous character, set or group 1 or more times. Equivalent to {1,}
? | The previous character, set or group may or may not appear. Equivalent to {0, 1}
? (after a repeating character) | Find the smallest match instead of the largest.

Character Classes

[:alnum:] | letters and digits
[:alpha:] | letters
[:ascii:] | character codes 0 - 127
[:blank:] | space or tab only
[:cntrl:] | control characters
[:digit:] | decimal digits (same as \d)
[:graph:] | printing characters, excluding space
[:lower:] | lower case letters
[:print:] | printing characters, including space
[:punct:] | printing characters, excluding letters and digits
[:space:] | white space (not quite the same as \s, it include VT: chr(11) )
[:upper:] | upper case letters
[:word:] | "word" characters (same as \w)
[:xdigit:] | hexadecimal digits

Related

StringInStr, StringRegExpReplace

Example

;Option 1, using offset
$nOffset = 1
While 1
$array = StringRegExp('<test>a</test> <test>b</test> <test>c</Test>', '<(?i)test>(.*?)</(?i)test>', 1, $nOffset)

If @error = 0 Then
$nOffset = @extended
Else
ExitLoop
EndIf
for $i = 0 to UBound($array) - 1
msgbox(0, "RegExp Test with Option 1 - " & $i, $array[$i])
Next
WEnd

;Option 2, single return, php/preg_match() style
$array = StringRegExp('<test>a</test> <test>b</test> <test>c</Test>', '<(?i)test>(.*?)</(?i)test>', 2)
for $i = 0 to UBound($array) - 1
msgbox(0, "RegExp Test with Option 2 - " & $i, $array[$i])
Next

;Option 3, global return, old AutoIt style
$array = StringRegExp('<test>a</test> <test>b</test> <test>c</Test>', '<(?i)test>(.*?)</(?i)test>', 3)

for $i = 0 to UBound($array) - 1
msgbox(0, "RegExp Test with Option 3 - " & $i, $array[$i])
Next

;Option 4, global return, php/preg_match_all() style
$array = StringRegExp('F1oF2oF3o', '(F.o)*?', 4)

for $i = 0 to UBound($array) - 1

$match = $array[$i]
for $j = 0 to UBound($match) - 1
msgbox(0, "cRegExp Test with Option 4 - " & $i & ',' & $j, $match[$j])
Next
Next


Function StringRegExpReplace

Function Reference

StringRegExpReplace

Replace text in a string based on regular expressions.

StringRegExpReplace ( "test", "pattern", "replace", [ count ] )

Parameters

test | The string to check
pattern | The regular expression to compare. See StringRegExp for pattern definition characters.
replace | The text to replace the regular expression matching text with. To insert matched group text, \0 - \9 (or $0 - $9) can be used as back-references.
count | [optional] The number of times to execute the replacement in the string. The default is 0. Use 0 for global replacement.

Return Value

@Error | Meaning
0 | Executed properly. Check @Extended for the number of replacements performed.
2 | Pattern invalid. @Extended = offset of error in pattern.

Remarks

To separate back-references from actual (replaced) numbers, wrap it with half-round brackets, i.e: "${1}5".

Related

StringRegExp

Example

Test1()
Test2()

; This example demonstrates a basic replacement. It replaces the vowels aeiou
; with the @ character.
Func Test1()
Local $sInput = "Where have all the flowers gone, long time passing?"
Local $sOutput = StringRegExpReplace($sInput, "[aeiou]", "@")
Display($sInput, $sOutput)
EndFunc ; Test1()

; The following example demonstrates using back-references to change the date
; from MM/DD/YYYY to DD.MM.YYYY
Func Test2()
Local $sInput = 'some text1 12/31/2009 01:02:03 some text2' & @CRLF & _
'some text3 02/28/2009 11:22:33 some text4'
Local $sOutput = StringRegExpReplace($sInput, '(\d{2})/(\d{2})/(\d{4})', ' $2.$1.$3 ')
Display($sInput, $sOutput)
EndFunc ; Test2()

Func Display($sInput, $sOutput)
; Format the output.
Local $sMsg = StringFormat("Input:\t%s\n\nOutput:\t%s", $sInput, $sOutput)
MsgBox(0, "Results", $sMsg)
EndFunc ; Display()


Function StringReplace

Function Reference

StringReplace

Replaces substrings in a string.

StringReplace ( "string", "searchstring/start", "replacestring" [, occurrence [, casesense]] )

Parameters

string | The string to evaluate.
searchstring/start | The substring to search for or the character position to start the replacement.
replacestring | The replacement string.
occurrence | [optional] The number of times to replace the searchstring. Use a negative occurrence to replace from the right side. 0 = all searchstrings will be replaced (default)
casesense | [optional] Flag to indicate if the operations should be case sensitive. 0 = not case sensitive, using the user's locale (default) 1 = case sensitive 2 = not case sensitive, using a basic/faster comparison

Return Value

Returns the new string, the number of replacements performed is stored in @extended.

Remarks

By default or if count is positive the search/replace is performed left-to-right. Thus, StringReplace("aaa", "aa", "bb") returns "bba"

If the start method is used the occurrence and casesense parameters are ignored. If the replacestring cannot be stored a blank string is returned and @error is set to 1.

Related

StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper, StringStripWS, StringAddCR

Example

$text = StringReplace("this is a line of text", " ", "-")
$numreplacements = @extended
MsgBox(0, "New string is", $text)
MsgBox(0, "The number of replacements done was", $numreplacements)


Function StringRight

Function Reference

StringRight

Returns a number of characters from the right-hand side of a string.

StringRight ( "string", count )

Parameters

string | The string to evaluate.
count | The number of characters to get.

Return Value

Returns a string containing the rightmost count characters of the string.

Remarks

If count exceeds string length, the entire string is returned.
If count is negative, an empty string is returned.

Related

StringInStr, StringLeft, StringLen, StringLower, StringMid, StringTrimLeft, StringTrimRight, StringUpper, StringCompare, StringReplace, StringSplit

Example

$var = StringRight("I am a string", 3)
MsgBox(0, "Rightmost 3 characters are:", $var)


Function StringSplit

Function Reference

StringSplit

Splits up a string into substrings depending on the given delimiters.

StringSplit ( "string", "delimiters" [, flag ] )

Parameters

string | The string to evaluate.
delimiters | One or more characters to use as delimiters (case sensitive).
flag | [optional] Changes how the string split works, add mutliple flag values together if required: flag = 0 (default), each character in the delimiter string will mark where to split the string flag = 1, entire delimiter string is needed to mark the split flag = 2, disable the return the count in the first element - effectively makes the array 0-based (must use UBound() to get the size in this case).

Return Value

Returns an array, by default the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the delimited strings. If flag = 2 then the count is not return in the first element.
If no delimiters were found @error is set to 1, the count is 1 ($array[0]) and the full string is returned ($array[1]).

Remarks

If you use a blank string "" for the delimiters, each character will be returned as an element.

If the delimiter you wish to use is a substring instead of individual single characters, see the example below.

StringSplit is very useful as an alternative to StringInStr and as a means to populate an array.

Caution if you use the macro @CRLF you are referring to a 2 character string so you will generate extra blanks lines.

Related

StringInStr, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper

Example

$days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",")
;$days[1] contains "Sun" ... $days[7] contains "Sat"

$text = "This\nline\ncontains\nC-style breaks."
$array = StringSplit($text, '\n', 1)


Function StringStripCR

Function Reference

StringStripCR

Removes all carriage return values ( Chr(13) ) from a string.

StringStripCR ( "string" )

Parameters

string The string to convert.

Return Value

Returns the string with all instances of the @CR character (Chr(13)) removed.

Remarks

None.

Related

StringAddCR, StringStripWS, StringIsSpace

Example

$result = StringStripCR("I am a string" & Chr(13) & Chr(10))
MsgBox(0, "String stripped of all CR characters is:", $result)


Function StringStripWS

Function Reference

StringStripWS

Strips the white space in a string.

StringStripWS ( "string", flag )

Parameters

string | The string to strip.
flag | Flag to indicate the type of stripping that should be performed (add the flags together for multiple operations): 1 = strip leading white space 2 = strip trailing white space 4 = strip double (or more) spaces between words 8 = strip all spaces (over-rides all other flags)

Return Value

Returns the new string stripped of the requested white space.

Remarks

Whitespace includes Chr(9) thru Chr(13) which are HorizontalTab, LineFeed, VerticalTab, FormFeed, and CarriageReturn. Whitespace also includes the null string ( Chr(0) ) and the standard space ( Chr(32) ).

To strip single spaces between words, use the function StringReplace.

Related

StringStripCR, StringIsSpace, StringReplace

Example

$text = StringStripWS(" this is a line of text ", 3)
MsgBox(0, "Stripped from both ends", $text)


Function StringToASCIIArray

Function Reference

StringToASCIIArray

Converts a string to an array containing the ASCII code of each character.

StringToASCIIArray( "string", [ start [, end [, encoding ] ] ] )

Parameters

"string" | The string to convert to an array of ASCII codes.
start | [optional] The 0-based position to start processing from (Default: 0).
end | [optional] The 0-based position to end processing at (Default: StringLen("string")).
encoding | [optional] The returned array will contain values in the specified character set: 0 - UTF-16 (Default) 1 - ANSI 2 - UTF-8

Return Value

Success: | An array where each element is the UNICODE code of the character at the corresponding position.
Failure: | Returns an empty string.

Remarks

The string may contain embedded Chr(0). These will appear in the returned array as well as any data past them. Processing only stops when the end of the string is reached or the user specified end.

In order to convert binary data to an array using this function it must first be converted to a string with the BinaryToString() function.

Related

StringFromASCIIArray, BinaryToString

Example

#include <Array.au3> ; For _ArrayDisplay()

Local $a = StringToASCIIArray("abc")
_ArrayDisplay($a)


Function StringTrimLeft

Function Reference

StringTrimLeft

Trims a number of characters from the left hand side of a string.

StringTrimLeft ( "string", count )

Parameters

string | The string to evaluate.
count | The number of characters to trim.

Return Value

Returns the string trimmed by count characters from the left.

Remarks

If count is out-of-bounds, an empty string is returned.
StringTrimLeft($str, $n) is functionally equivalent to StringRight($str, StringLen($str) - $n)

Related

StringInStr, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimRight, StringUpper, StringCompare, StringReplace, StringSplit

Example

$result = StringTrimLeft("I am a string", 3)
MsgBox(0, "String without leftmost 3 characters is:", $result)


Function StringTrimRight

Function Reference

StringTrimRight

Trims a number of characters from the right hand side of a string.

StringTrimRight ( "string", count )

Parameters

string | The string to evaluate.
count | The number of characters to trim.

Return Value

Returns the string trimmed by count characters from the right.

Remarks

If count is out-of-bounds, an empty string is returned.
StringTrimRight($str, $n) is functionally equivalent to StringLeft($str, StringLen($str) - $n)

Related

StringInStr, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringUpper, StringCompare, StringReplace, StringSplit

Example

$result = StringTrimRight("I am a string", 3)
MsgBox(0, "String without rightmost 3 characters is:", $result)


Function StringUpper

Function Reference

StringUpper

Converts a string to uppercase.

StringUpper ( "string" )

Parameters

string The string to convert.

Return Value

Returns the string converted to uppercase.

Remarks

None.

Related

StringIsLower, StringIsUpper, StringInStr, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringCompare, StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsSpace, StringIsXDigit, StringReplace, StringSplit

Example

$result = StringUpper("I am 4-word string")
MsgBox(0, "String converted to uppercase is:", $result)


Functions

Timer and Delay functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
Sleep | Pause script execution.
TimerInit | Returns a timestamp (in milliseconds).
TimerDiff | Returns the difference in time from a previous call to TimerInit().


Function Sleep

Function Reference

Sleep

Pause script execution.

Sleep ( delay )

Parameters

delay Amount of time to pause (in milliseconds).

Return Value

None.

Remarks

Maximum sleep time is 2147483647 milliseconds (24 days).

Related

None.

Example

Sleep(5000) ;five seconds


Function TimerInit

Function Reference

TimerInit

Returns a timestamp (in milliseconds).

TimerInit ( )

Parameters

None.

Return Value

Returns a timestamp number (in milliseconds).

Remarks

None.

Related

TimerDiff

Example

$begin = TimerInit()
sleep(3000)
$dif = TimerDiff($begin)
MsgBox(0,"Time Difference",$dif)


Function TimerDiff

Function Reference

TimerDiff

Returns the difference in time from a previous call to TimerInit().

TimerDiff ( timestamp )

Parameters

timestamp timestamp returned from a previous call to TimerInit().

Return Value

Returns the time difference (in milliseconds) from a previous call to TimerInit().

Remarks

None.

Related

TimerInit

Example

$begin = TimerInit()
sleep(3000)
$dif = TimerDiff($begin)
MsgBox(0,"Time Difference",$dif)


Functions

Tray functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
TrayCreateItem | Creates a menuitem control for the tray.
TrayCreateMenu | Creates a menu control for the tray menu.
TrayItemDelete | Deletes a menu/item control from the tray menu.
TrayItemGetHandle | Returns the handle for a tray menu(item).
TrayItemGetState | Gets the current state of a control.
TrayItemGetText | Gets the itemtext of a tray menu/item control.
TrayItemSetOnEvent | Defines a user-defined function to be called when a tray item is clicked.
TrayItemSetState | Sets the state of a tray menu/item control.
TrayItemSetText | Sets the itemtext of a tray menu/item control.
TrayGetMsg | Polls the tray to see if any events have occurred.
TraySetClick | Sets the clickmode of the tray icon - what mouseclicks will display the tray menu.
TraySetIcon | Loads/Sets a specified tray icon.
TraySetOnEvent | Defines a user function to be called when a special tray action happens.
TraySetPauseIcon | Loads/Sets a specified tray pause icon.
TraySetState | Sets the state of the tray icon.
TraySetToolTip | (Re)Sets the tooltip text for the tray icon.
TrayTip | Displays a balloon tip from the AutoIt Icon. (2000/XP only)


Function TrayCreateItem

Function Reference

TrayCreateItem

Creates a menuitem control for the tray.

TrayCreateItem ( text [, menuID [, menuentry [, menuradioitem]]] )

Parameters

text | The text of the control.
menuID | [optional] Allows you to create a submenu in the referenced menu. If equal -1 it will be added 'behind' the last created item (default setting).
menuentry | [optional] Allows you to define the entry number to be created. The entries are numbered starting at 0. If equal -1 it will be added 'behind' the last created entry (default setting).
menuradioitem | [optional] 0 (default) = create a normal menuitem, 1 = create a menuradioitem.

Return Value

Success: | Returns the identifier (controlID) of the new tray menuitem.
Failure: | Returns 0.

Remarks

If the 'text' parameter is a blank string ( "" ) then a separator line is created.

By default, normal checked menuitems (not radio menuitems) will be automatically unchecked if you click it!
To turn off this behaviour use the value '2' in TrayMenuMode.

Radio menuitems are automatically grouped together and these groups are separated by a separator line or a normal item which is not a radio item.
By default, a clicked radio menuitem will be checked automatically and all other radio items in the same group will be unchecked!
To turn off this behaviour use the value '8' in TrayMenuMode.

Related

TrayItemSetState, TrayItemSetText, TrayGetMsg, TrayItemDelete, TrayItemSetOnEvent

Example

; ****************
; * First sample *
; ****************

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$prefsitem = TrayCreateItem("Preferences")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $prefsitem
Msgbox(64, "Preferences:", "OS:" & @OSVersion)
Case $msg = $aboutitem
Msgbox(64, "About:", "AutoIt3-Tray-sample.")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit

; *****************
; * Second sample *
; *****************

#Include <Constants.au3>
#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

; Let's create 2 radio menuitem groups
$radio1 = TrayCreateItem("Radio1", -1, -1, 1)
TrayItemSetState(-1, $TRAY_CHECKED)
$radio2 = TrayCreateItem("Radio2", -1, -1, 1)
$radio3 = TrayCreateItem("Radio3", -1, -1, 1)

TrayCreateItem("") ; Radio menuitem groups can be separated by a separator line or another norma menuitem

$radio4 = TrayCreateItem("Radio4", -1, -1, 1)
$radio5 = TrayCreateItem("Radio5", -1, -1, 1)
TrayItemSetState(-1, $TRAY_CHECKED)
$radio6 = TrayCreateItem("Radio6", -1, -1, 1)

TrayCreateItem("")

$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $aboutitem
Msgbox(64, "About:", "AutoIt3-Tray-sample with radio menuitem groups.")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit


Function TrayCreateMenu

Function Reference

TrayCreateMenu

Creates a menu control for the tray menu.

TrayCreateMenu ( "sub/menutext" [, menuID [, menuentry]] )

Parameters

sub/menutext | The sub/menu text.
menuID | [optional] If defined, allows you to create a submenu in the referenced menu. If equal -1 it refers to first level menu.
menuentry | [optional] Allows you to define the entry number to be created. The entries are numbered starting at 0.

Return Value

Success: | Returns the identifier (controlID) of the new tray menu.
Failure: | Returns 0.

Remarks

None.

Related

TrayItemSetState, TrayItemSetText, TrayGetMsg, TrayItemDelete

Example

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$settingsitem = TrayCreateMenu("Settings")
$displayitem = TrayCreateItem("Display", $settingsitem)
$printeritem = TrayCreateItem("Printer", $settingsitem)
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $aboutitem
Msgbox(64,"About:","AutoIt3-Tray-sample")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit


Function TrayItemDelete

Function Reference

TrayItemDelete

Deletes a menu/item control from the tray menu.

TrayItemDelete ( controlID )

Parameters

controlID The control identifier (controlID) as returned by a TrayCreateItem or TrayCreateMenu function.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

TrayCreateItem, TrayCreateMenu

Example

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$delitem = TrayCreateItem("Delete")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $aboutitem
Msgbox(64,"About:","AutoIt3-Tray-sample")
Case $msg = $delitem
TrayItemDelete($delitem)
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit


Function TrayItemGetHandle

Function Reference

TrayItemGetHandle

Returns the handle for a tray menu(item).

TrayItemGetHandle ( controlID )

Parameters

controlID The control identifier (controlID) as returned by a TrayCreateItem or TrayCreateMenu function.

Return Value

Success: | Returns the handle of the given control ID.
Failure: | Returns 0.

Remarks

To get the handle to the tray context menu itself use '0' as controlID.

Related

TrayItemGetState, TrayItemGetText

Example

#include <Constants.au3>

Opt("TrayMenuMode", 1) ; Don't show the default tray context menu

Global Const $MIM_APPLYTOSUBMENUS = 0x80000000
Global Const $MIM_BACKGROUND = 0x00000002

TraySetIcon("shell32.dll", 21)
TraySetToolTip("This is just a small example to show that colored tray menus" & @LF & "are easy possible under Windows 2000 and higher.")

$OptionsMenu = TrayCreateMenu("Options")
$OnTopItem = TrayCreateItem("Always On Top", $OptionsMenu)
TrayItemSetState(-1, $TRAY_CHECKED)
$RepeatItem = TrayCreateItem("Repeat Always", $OptionsMenu)
TrayCreateItem("")
$AboutItem = TrayCreateItem("About")
TrayCreateItem("")
$ExitItem = TrayCreateItem("Exit Sample")

SetMenuColor(0, 0xEEBB99) ; BGR color value, '0' means the tray context menu handle itself
SetMenuColor($OptionsMenu, 0x66BB99); BGR color value

While 1
$Msg = TrayGetMsg()

Switch $Msg
Case $ExitItem
ExitLoop

Case $AboutItem
Msgbox(64, "About...", "Colored tray menu sample")
EndSwitch
WEnd

Exit

; Apply the color to the menu
Func SetMenuColor($nMenuID, $nColor)
$hMenu = TrayItemGetHandle($nMenuID) ; Get the internal menu handle

$hBrush = DllCall("gdi32.dll", "hwnd", "CreateSolidBrush", "int", $nColor)
$hBrush = $hBrush[0]

Local $stMenuInfo = DllStructCreate("dword;dword;dword;uint;dword;dword;ptr")
DllStructSetData($stMenuInfo, 1, DllStructGetSize($stMenuInfo))
DllStructSetData($stMenuInfo, 2, BitOr($MIM_APPLYTOSUBMENUS, $MIM_BACKGROUND))
DllStructSetData($stMenuInfo, 5, $hBrush)

DllCall("user32.dll", "int", "SetMenuInfo", "hwnd", $hMenu, "ptr", DllStructGetPtr($stMenuInfo))
EndFunc


Function TrayItemGetState

Function Reference

TrayItemGetState

Gets the current state of a control.

TrayItemGetState ( [controlID] )

Parameters

controlID [optional] The control identifier (controlID) as returned by a TrayCreateItem or TrayCreateMenu function.

Return Value

Returns the state. See TrayItemSetState table for values.

Remarks

None.

Related

TrayItemSetState, TrayItemGetHandle

Example

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$getitem = TrayCreateItem("Get State")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $getitem
Msgbox(64,"State",TrayItemGetState($aboutitem))
Case $msg = $aboutitem
Msgbox(64,"About:","AutoIt3-Tray-sample")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit


Function TrayItemGetText

Function Reference

TrayItemGetText

Gets the itemtext of a tray menu/item control.

TrayItemGetText ( controlID )

Parameters

controlID The control identifier (controlID) as returned by a TrayCreateItem or TrayCreateMenu function.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

TrayItemSetText, TrayItemGetHandle

Example

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$getitem = TrayCreateItem("Get Text")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $getitem
Msgbox(64,"State",TrayItemGetText($aboutitem))
Case $msg = $aboutitem
Msgbox(64,"About:","AutoIt3-Tray-sample")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit


Function TrayItemSetOnEvent

Function Reference

TrayItemSetOnEvent

Defines a user-defined function to be called when a tray item is clicked.

TrayItemSetOnEvent ( itemID, "function" )

Parameters

itemID | The item identifier (itemID) as returned by a TrayCreateItem function.
function | The name of the user function to call.

Return Value

Success: | Returns 1.
Failure: | Returns 0.
@error: | 1 if the "function" is not defined.

Remarks

OnEvent functions are only called when the option TrayOnEventMode is set to 1 - when in this mode TrayGetMsg is NOT used at all.

Within the called user function the item identifier can be retrieved with @TRAY_ID.

If the function is an empty string "" the previous user-defined is disabled.

Related

TrayCreateItem, TrayGetMsg, TrayOnEventMode (Option), TraySetOnEvent

Example

#NoTrayIcon

Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

TraySetClick(16) ; Only secondary mouse button will show the tray menu.

$infoitem = TrayCreateItem("Info")
TrayItemSetOnEvent(-1,"ShowInfo")

TrayCreateItem("")

$exititem = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1,"ExitScript")

TraySetState()

While 1
Sleep(10) ; Idle loop
WEnd

Exit

; Functions
Func ShowInfo()
Msgbox(0,"Info","Tray OnEvent Demo")
EndFunc

Func ExitScript()
Exit
EndFunc


Function TrayItemSetState

Function Reference

TrayItemSetState

Sets the state of a tray menu/item control.

TrayItemSetState ( controlID, state )

Parameters

controlID | The control identifier (controlID) as returned by a TrayCreateItem or TrayCreateMenu function.
state | See the State table below.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

State table
State | Value | Comments
No Change | 0
$TRAY_CHECKED | 1 | Menuitem will be checked
$TRAY_UNCHECKED | 4 | Menuitem will be unchecked
$TRAY_ENABLE | 64 | Menuitem will be enabled
$TRAY_DISABLE | 128 | Menuitem will be greyed out
$TRAY_FOCUS | 256 | Menuitem will be selected
$TRAY_DEFAULT | 512 | Menuitem will be set as default menuitem

State values can be summed up as for example $TRAY_CHECKED + $TRAY_DEFAULT sets the menuitem in an checked and default state.

To reset/delete the $TRAY_DEFAULT-state for a menuitem just use this function on the item with another state, for instance with $TRAY_ENABLE.

The above constants are defined in #include <Constants.au3>

Related

TrayItemGetState, TrayCreateItem, TrayCreateMenu, TraySetState

Example

#Include <Constants.au3>
#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$chkitem = TrayCreateItem("Check it")
TrayCreateItem("")
$checkeditem = TrayCreateItem("Checked")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $chkitem
TrayItemSetState($checkeditem,$TRAY_CHECKED)
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit


Function TrayItemSetText

Function Reference

TrayItemSetText

Sets the itemtext of a tray menu/item control.

TrayItemSetText ( controlID, text )

Parameters

controlID | The control identifier (controlID) as returned by a TrayCreateItem or TrayCreateMenu function.
text | The new text of the tray menu/item control.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

To change the itemtext of the default menuitems (Script Paused/Exit) use the constants $TRAY_ITEM_EXIT and $TRAY_ITEM_PAUSE as controlID.

Related

TrayItemGetText, TrayCreateItem, TrayCreateMenu

Example

#Include <Constants.au3>
#NoTrayIcon

Opt("TrayAutoPause",0) ; Script will not be paused when clicking the tray icon.

$valitem = TrayCreateItem("Val:")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")

TraySetState()

TrayItemSetText($TRAY_ITEM_EXIT,"Exit Program")
TrayItemSetText($TRAY_ITEM_PAUSE,"Pause Program")

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $valitem
TrayItemSetText($valitem,"Val:" & Int(Random(1,10,1)))
Case $msg = $aboutitem
Msgbox(64,"About:","AutoIt3-Tray-sample")
EndSelect
WEnd

Exit


Function TrayGetMsg

Function Reference

TrayGetMsg

Polls the tray to see if any events have occurred.

TrayGetMsg ( )

Parameters

None.

Return Value

Returns an event.
The "event" returned is the control ID of the control sending the message, or it is a special event (like the mouse clicking on the tray icon). Or if there is no message, the event is 0.

Event IDs
0 | No event
Control ID | the ID of the control sending the message
$TRAY_EVENT_PRIMARYDOWN | the primary mouse button was pressed
$TRAY_EVENT_PRIMARYUP | the primary mouse button was released
$TRAY_EVENT_SECONDARYDOWN | the secondary mouse button was pressed
$TRAY_EVENT_SECONDARYUP | the secondary mouse button was released
$TRAY_EVENT_PRIMARYDOUBLE | the primary mouse button was double pressed
$TRAY_EVENT_SECONDARYDOUBLE | the secondary mouse button was double pressed

Remarks

This function automatically idles the CPU when required so that it can be safely used in tight loops without hogging all the CPU.

The above constants are defined in #include <Constants.au3>

Related

TrayCreateItem, TrayCreateMenu, TrayItemSetOnEvent

Example

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$settingsitem = TrayCreateMenu("Settings")
$displayitem = TrayCreateItem("Display", $settingsitem)
$printeritem = TrayCreateItem("Printer", $settingsitem)
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $aboutitem
Msgbox(64,"About:","AutoIt3-Tray-sample")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit


Function TraySetClick

Function Reference

TraySetClick

Sets the clickmode of the tray icon - what mouseclicks will display the tray menu.

TraySetClick ( flag )

Parameters

flag 0 = Tray menu will never be shown through a mouseclick
1 = Pressing primary mouse button
2 = Releasing primary mouse button
4 = Double-click primary mouse button
8 = Pressing secondary mouse button
16 = Releasing secondary mouse button
32 = Double-click secondary mouse button
64 = Hovering over the tray icon

Return Value

None.

Remarks

These flags are NOT tray event values!
Default value is "9" - pressing the primary or secondary mouse button will show the tray menu.

Related

TraySetOnEvent

Example

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$settingsitem = TrayCreateMenu("Settings")
$displayitem = TrayCreateItem("Display", $settingsitem)
$printeritem = TrayCreateItem("Printer", $settingsitem)
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")

TraySetState()
TraySetClick(16)

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $aboutitem
Msgbox(64,"About:","AutoIt3-Tray-sample")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd

Exit


Function TraySetIcon

Function Reference

TraySetIcon

Loads/Sets a specified tray icon.

TraySetIcon ( [filename [, iconID] )

Parameters

filename | [optional] The filename of the icon to be display in the tray.
iconID | [optional] Icon identifier if the file contain multiple icons.

Return Value

None.

Remarks

To reset the icon to the default, use the function with no parameters:
TraySetIcon().

Passing a positive number will reference the string equivalent icon name.
Passing a negative number causes 1-based "index" behaviour. Some Dll can have icon extracted just with negative numbers.

The filename parameter can be set to "blank", "info", "question", "stop" or "warning" to select some corresponding standard icon.

Related

TraySetPauseIcon, TraySetState

Example

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$exititem = TrayCreateItem("Exit")

TraySetState()

$start = 0
While 1
$msg = TrayGetMsg()
If $msg = $exititem Then ExitLoop
$diff = TimerDiff($start)
If $diff > 1000 Then
$num = -Random(0,100,1) ; negative to use ordinal numbering
ToolTip("#icon=" & $num)
TraySetIcon("Shell32.dll",$num)
$start = TimerInit()
EndIF
WEnd

Exit


Function TraySetOnEvent

Function Reference

TraySetOnEvent

Defines a user function to be called when a special tray action happens.

TraySetOnEvent ( specialID, "function" )

Parameters

specialID | See the Special ID table below.
function | The name of the user function to call.

Return Value

Success: | Returns 1.
Failure: | Returns 0.
@error: | 1 if the "function" is not defined.

Remarks

OnEvent functions are only called when the option TrayOnEventMode is set to 1 - when in this mode TrayGetMsg is NOT used at all.

Special ID table
Special Id | Value | Comments
$TRAY_EVENT_SHOWICON | -3 | The tray icon will be shown.
$TRAY_EVENT_HIDEICON | -4 | The tray icon will be hidden.
$TRAY_EVENT_FLASHICON | -5 | The user turned the tray icon flashing on.
$TRAY_EVENT_NOFLASHICON | -6 | The user turned the tray icon flashing off.
$TRAY_EVENT_PRIMARYDOWN | -7 | The primary mouse button was pressed on the tray icon.
$TRAY_EVENT_PRIMARYUP | -8 | The primary mouse button was released on the tray icon.
$TRAY_EVENT_SECONDARYDOWN | -9 | The secondary mouse button was pressed on the tray icon.
$TRAY_EVENT_SECONDARYUP | -10 | The secondary mouse button was released on the tray icon.
$TRAY_EVENT_MOUSEOVER | -11 | The mouse moves over the tray icon.
$TRAY_EVENT_PRIMARYDOUBLE | -13 | The primary mouse button was double pressed on the tray icon.
$TRAY_EVENT_SECONDARYDOUBLE | -14 | The secondary mouse button was double pressed on the tray icon.

If the function is an empty string "" the previous user-defined is disabled.

The above constants are defined in #include <Constants.au3>

Related

TrayOnEventMode (Option), TrayItemSetOnEvent, TraySetClick

Example

#include <Constants.au3>
#NoTrayIcon

Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$exit = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1,"ExitEvent")

TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"SpecialEvent")
TraySetOnEvent($TRAY_EVENT_SECONDARYUP,"SpecialEvent")

TraySetState()

While 1
Sleep(10) ; Idle loop
WEnd

Exit

; Functions
Func SpecialEvent()
Select
Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOUBLE
Msgbox(64,"SpecialEvent-Info","Primary mouse button double clicked.")
Case @TRAY_ID = $TRAY_EVENT_SECONDARYUP
Msgbox(64,"SpecialEvent-Info","Secondary mouse button clicked.")
EndSelect
EndFunc

Func ExitEvent()
Exit
EndFunc


Function TraySetPauseIcon

Function Reference

TraySetPauseIcon

Loads/Sets a specified tray pause icon.

TraySetPauseIcon ( [filename [, iconID] )

Parameters

filename | [optional] The filename of the icon to be display as pause icon in the tray.
iconID | [optional] Icon identifier if the file contain multiple icons.

Return Value

None.

Remarks

To reset the pause icon to the default (red cross), use the function with no parameters:
TraySetPauseIcon().

Passing a positive number will reference the string equivalent icon name.
Passing a negative number causes 1-based "index" behaviour. Some Dll can have icon extracted

just with negative numbers.

Related

TraySetIcon, TraySetState

Example

#NoTrayIcon

TraySetPauseIcon("shell32.dll",12)
TraySetState()

While 1
$msg = TrayGetMsg()
WEnd

Exit


Function TraySetState

Function Reference

TraySetState

Sets the state of the tray icon.

TraySetState ( [ flag ] )

Parameters

flag [optional] A combination of the following:
1 = Shows the tray icon (default)
2 = Destroys/Hides the tray icon
4 = Flashes the tray icon
8 = Stops tray icon flashing
16 = Resets the icon to the defaults (no flashing, default tip text)

Return Value

None.

Remarks

This function overrides the "TrayIconHide"-option and "#NoTrayIcon"-setting.
The normal and pause tray icon are NOT reset by this function!

Related

TrayItemSetState, TraySetIcon, TraySetPauseIcon

Example

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

$exititem = TrayCreateItem("Exit")

TraySetIcon("warning")
TraySetToolTip("SOS")

TraySetState() ; Show the tray icon

$toggle = 0

While 1
$msg = TrayGetMsg()
Select
Case $msg = 0
Sleep(1000)
If $toggle = 0 Then
TraySetState() ; Show the tray icon
$toggle = 1
Else
TraySetState(2) ; Hide the tray icon
$toggle = 0
EndIF
Case $msg = $exititem
ExitLoop
EndSelect

WEnd

Exit


Function TraySetToolTip

Function Reference

TraySetToolTip

(Re)Sets the tooltip text for the tray icon.

TraySetToolTip ( [text] )

Parameters

text [optional] The new text to be displayed as tooltip. The length is limited - see Remarks.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

In Windows 2000 and later the tooltip length is limited to 128 characters.

To reset the tooltip to the default text, use the function with no parameters:
TraySetToolTip().

The tooltip text is only changed when the tray icon is visible!

Related

TrayTip

Example

#NoTrayIcon

TraySetState()
TraySetToolTip("This is my new tooltip text!")

While 1
Sleep(10) ; Idle loop
WEnd

Exit


Function TrayTip

Function Reference

TrayTip

Displays a balloon tip from the AutoIt Icon. (2000/XP only)

TrayTip ( "title", "text", timeout [, option] )

Parameters

title | Text appears in bold at the top of the balloon tip. (63 characters maximum)
text | Message the balloon tip will display. (255 characters maximum)
timeout | A rough estimate of the time (in seconds) the balloon tip should be displayed. (Windows has a min and max of about 10-30 seconds but does not always honor a time in that range.)
option | [optional] See Remarks. 0=No icon (default), 1=Info icon, 2=Warning icon, 3=Error icon

Return Value

None.

Remarks

TrayTip works for only Windows 2000/XP or better.

A Tray tip will close if the AutoIt tray icon disappears. Consequently, the TrayTip may not appear if AutoItSetOption("TrayIconHide", 1) is set or if the user has disabled balloon tips via registry settings!

Windows XP usually plays a sound when displaying a balloon tip. This sound can be disabled by adding 16 to the options parameter or by setting an empty title.

To clear a balloon tip that is being displayed, call another tip with an empty text string (and any title).

Related

MsgBox, ToolTip, TrayIconHide (Option), TraySetToolTip

Example

TrayTip("I'm a title", "I'm the message", 5, 1)
MsgBox(4096,"", "Press OK to see another tip.")
TrayTip("clears any tray tip","",0)
TrayTip("", "A different tray tip.", 5)
Sleep(5000)


Functions

Variables and Conversions functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
Asc | Returns the ASCII code of a character.
AscW | Returns the unicode code of a character.
Chr | Returns a character corresponding to an ASCII code.
ChrW | Returns a character corresponding to a unicode code.
Assign | Assigns a variable by name with the data.
Binary | Returns the binary representation of an expression.
BinaryLen | Returns the number of bytes in a binary variant.
BinaryMid | Extracts a number of bytes from a binary variant.
BinaryToString | Converts a binary variant into a string.
Dec | Returns a numeric representation of a hexadecimal string.
Eval | Return the value of the variable defined by an string.
Hex | Returns a string representation of an integer or of a binary type converted to hexadecimal.
HWnd | Converts an expression into an HWND handle.
Int | Returns the integer (whole number) representation of an expression.
IsAdmin | Checks if the current user has full administrator privileges.
IsArray | Checks if a variable is an array type.
IsBinary | Checks if a variable or expression is a binary type.
IsBool | Checks if a variable's base type is boolean.
IsDeclared | Check if a variable has been declared.
IsDllStruct | Checks if a variable is a DllStruct type.
IsFloat | Checks if a variable or expression is a float-type.
IsHWnd | Checks if a variable's base type is a pointer and window handle.
IsInt | Checks if a variable or expression is an integer type.
IsKeyword | Checks if a variable is a keyword (for example, Default).
IsNumber | Checks if a variable's base type is numeric.
IsObj | Checks if a variable or expression is an object type.
IsPtr | Checks if a variable's base type is a pointer.
IsString | Checks if a variable is a string type.
Number | Returns the numeric representation of an expression.
Ptr | Converts an expression into a pointer variant.
String | Returns the string representation of an expression.
StringToBinary | Converts a string into binary data.
UBound | Returns the size of array dimensions.


Function Asc

Function Reference

Asc

Returns the ASCII code of a character.

Asc ( "char" )

Parameters

char The character to get the code for. If a string is used, the code for the first character is given.

Return Value

Returns the ASCII code of the specified char.

Remarks

See the Appendix for a complete ASCII table.
Asc("0") == 48, Asc("9") == 57, Asc("A") == 65, Asc("Z") == 90, Asc("a") == 97, Asc("z") == 122, etc.

Related

AscW, Chr, ChrW

Example

$code = Asc("A")
MsgBox(0, "ASCII code for A:", $code)


Function AscW

Function Reference

AscW

Returns the unicode code of a character.

AscW ( "char" )

Parameters

char The character to get the code for. If a string is used, the code for the first character is given.

Return Value

Returns the unicode code of the specified char.

Remarks

See the Appendix for a complete ASCII table.

Related

Asc, Chr, ChrW

Example

$code = AscW("A")
MsgBox(0, "Unicode code for A:", $code)


Function Chr

Function Reference

Chr

Returns a character corresponding to an ASCII code.

Chr ( ASCIIcode )

Parameters

ASCIIcode An ASCII code in the range 0-255 (e.g., 65 returns the capital letter A).

Return Value

Success: | Returns a string containing the ASCII representation of the given code.
Failure: | Returns a blank string and sets @error to 1 if the ASCIIcode is greater than 255.

Remarks

Chr(48) == "0", Chr(57) == "9", Chr(65) == "A", Chr(90) == "Z", Chr(97) == "a", Chr(122) = "z", etc.
A complete ASCII table is in the Appendix.

Related

Asc, AscW, ChrW, String

Example

$text = ""
For $i = 65 to 90
$text = $text & Chr($i)
Next
MsgBox(0, "Uppercase alphabet", $text)


Function ChrW

Function Reference

ChrW

Returns a character corresponding to a unicode code.

ChrW ( UNICODEcode )

Parameters

UNICODEcode A unicode code in the range 0-65535 (e.g., 65 returns the capital letter A).

Return Value

Success: | Returns a string containing the representation of the given code.
Failure: | Returns a blank string and sets @error to 1 if the UNICODEcode is greater than 65535.

Remarks

A complete ASCII table is in the Appendix.

Related

Asc, AscW, Chr, String

Example

$text = ""
For $i = 256 to 512
$text = $text & ChrW($i)
Next
MsgBox(0, "Unicode chars 256 to 512", $text)


Function Assign

Function Reference

Assign

Assigns a variable by name with the data.

Assign ( "varname", "data" [, flag] )

Parameters

varname | The name of the variable you wish to assign. Cannot be an array element.
data | The data you wish to assign to the variable.
flag | [optional] controls the way that variables are assigned (add required options together): 0 = (default) Create variable if required 1 = Force creation in local scope 2 = Force creation in global scope 4 = Fail if variable does not already exist

Return Value

Success: | Returns 1.
Failure: | Returns 0 if unable to create/assign the variable.

Remarks

If there is a need to use Assign() to create/write to a variable, then in most situations, Eval() should be used to read the variable and IsDeclared() should be used to check that the variable exists.

Related

Eval, IsDeclared, Execute

Example

Global $variable
If Assign("variable", "Hello") Then MsgBox(4096, "", $variable) ; Will print "Hello"


Function Binary

Function Reference

Binary

Returns the binary representation of an expression.

Binary ( expression )

Parameters

expression An expression to convert into binary/byte data.

Return Value

Returns a Binary variant.

Remarks

None.

Related

Int, Number, IsBinary, BinaryLen, BinaryMid, BinaryToString, StringToBinary

Example

$var = Binary("0x00204060")
;$var is the binary type
msgbox(0, "IsBinary", IsBinary($var))


Function BinaryLen

Function Reference

BinaryLen

Returns the number of bytes in a binary variant.

BinaryLen ( binary )

Parameters

binary The binary data to evaluate.

Return Value

Returns the length of the binary data in bytes.

Remarks

None.

Related

Binary, BinaryMid

Example

; Create the binary data 0x10203040
$binary = Binary("0x10203040")
MsgBox(0, "Length in bytes:", BinaryLen($binary) )


Function BinaryMid

Function Reference

BinaryMid

Extracts a number of bytes from a binary variant.

BinaryMid ( binary, start [, count] )

Parameters

binary | The binary data to evaluate.
start | The byte position to start. (1 = first byte)
count | [optional] The number of bytes to extract. By default the entire remainder of the binary data.

Return Value

Returns the extracted binary data.

Remarks

If start is out-of-bounds, an empty binary variant is returned. If start is valid but count is out-of-bounds, the entire remainder of the binary data is returned.

Related

Binary, BinaryLen

Example

; Create the binary data 0x10203040
$binary = Binary("0x10203040")
$extract = BinaryMid($binary, 2, 2)
MsgBox(0, "2nd and 3rd bytes are", $extract)


Function BinaryToString

Function Reference

BinaryToString

Converts a binary variant into a string.

BinaryToString ( expression [, flag] )

Parameters

expression | An expression to convert into a string.
flag | [optional] Changes how the binary data is converted: flag = 1 (default), binary data is taken to be ANSI flag = 2, binary data is taken to be UTF16 Little Endian flag = 3, binary data is taken to be UTF16 Big Endian flag = 4, binary data is taken to be UTF8

Return Value

Success: | The string representation of the binary data.
Failure: | An empty string. @error will bet set as follows:
 | 1 - Input string had zero length.
 | 2 - Input string had an odd number of bytes but was supposed to be UTF16 (must contain an even number of bytes to be valid UTF16).

Remarks

Unlike String() which returns a hexidecimal representation of binary data, this function will assume the binary data is a string value and convert it appropriately.

Related

Binary, IsBinary, String, StringToBinary, StringToASCIIArray

Example

; Binary ANSI to String
$buffer = StringToBinary("Hello - ??")
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer)
MsgBox(4096, "BinaryToString() ANSI representation" , $buffer)

; Binary UTF16-LE to String
$buffer = StringToBinary("Hello - ??", 2)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 2)
MsgBox(4096, "BinaryToString() UTF16-LE representation" , $buffer)

; Binary UTF16-BE to String
$buffer = StringToBinary("Hello - ??", 3)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 3)
MsgBox(4096, "BinaryToString() UTF16-BE representation" , $buffer)

; Binary UTF8 to String
$buffer = StringToBinary("Hello - ??", 4)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 4)
MsgBox(4096, "BinaryToString() UTF8 representation" , $buffer)


Function Dec

Function Reference

Dec

Returns a numeric representation of a hexadecimal string.

Dec ( "hex" )

Parameters

hex The hexadecimal string to convert.

Return Value

Success: | Returns a integer.
Failure: | Returns 0 sets @error to 1 an invalid hex string was used or if an overflow occurs.

Remarks

The function only works with numbers that fit in a 32 bit signed integer (-2147483648 to 2147483647)

Related

Hex

Example

$dec = Dec("FFFF") ;returns the number 65535


Function Eval

Function Reference

Eval

Return the value of the variable defined by an string.

Eval ( string )

Parameters

string string representing name of the variable.

Return Value

Success: | Returns the value of the variable.
Failure: | Returns "" (blank string) with @error set not to 0.

Remarks

If there is a need to use Eval() to to read a variable, the in most situations Assign() should be used to create/write to the variable and IsDeclared() should be used to check that the variable exists.

Related

IsDeclared, Assign, Execute

Example

Dim $a_b = 12
$s = Eval("a" & "_" & "b") ; $s is set to 12

$s =Eval("c") ; $s = "" and @error = 1


Function Hex

Function Reference

Hex

Returns a string representation of an integer or of a binary type converted to hexadecimal.

Hex ( expression [, length] )

Parameters

expression | The expression to convert.
length | [optional] Number of characters to be returned (up to 8) for integer. Characters are truncated from the left-hand side if length is too small. This parameter is ignored if the data is binary data.

Return Value

Success: | Returns a string of length characters, zero-padded if necessary for integer.
 | Returns the binary type converted.
Special: | Returns "" (blank string) if length is less than 1.
Failure: | Returns "" (blank string) and sets @error to 1 if length is greater than 8.

Remarks

The function only works with numbers that fit in a 32 bit signed integer (-2147483648 to 2147483647)

The function will also set @error to 1 if not enough digits were requested - the returned string will return the least significant digits in this case.

Related

Dec, BitAND, BitNOT, BitOR, BitRotate, BitShift, BitXOR

Example

$result = Hex(1033, 4) ;returns "0409"


Function HWnd

Function Reference

HWnd

Converts an expression into an HWND handle.

HWnd ( expression )

Parameters

expression An expression to convert into an HWND handle.

Return Value

Success: | If the value can be converted to an HWND, the HWND representation will be returned.
Failure: | If the HWND does not denote a valid window, a 0 (NULL) HWND will be returned and @error set to 1.

Remarks

Double numbers can not be converted to an HWND.
No literal string should be converted to an HWND because there is no guarantee that a given window will have the same HWND ever again. This is not strictly forbidden, but it is a programming mistake and should be avoided.

Related

Int, String, Number, Ptr

Example

Run("notepad.exe")
WinWait("[CLASS:Notepad]")
Local $hWnd = WinGetHandle("[CLASS:Notepad]")
Local $sHWND = String($hWnd) ; Convert to a string
WinSetState(HWnd($sHWND), "", @SW_MINIMIZE)
Sleep(5000) ; Notepad should be minimized
WinClose(HWnd($sHWND))


Function Int

Function Reference

Int

Returns the integer (whole number) representation of an expression.

Int ( expression )

Parameters

expression An expression to convert into an integer.

Return Value

Success: | Returns a integer.
Failure: | Returns 0 sets @error to 1 if not an integer, float or string.

Remarks

Fractional portions are truncated, so Int(1.999999) returns 1
Int(0/0) returns -9223372036854775807, if you were wondering.
This function makes minor corrects to floating point numbers to account for the imprecise nature of floating point numbers. For example, the floating point expression 0.7 + 0.2 + 0.1 produces a floating point number that is not quite 1.0. Int() corrects for this anomaly, however, certain extremely rare circumstances may lead to Int() returning an unexpected value (the odds of getting an unexpected value are less than if Int() did not attempt any correction at all).

Related

Number, String, Round, HWnd, Binary, Ceiling, Floor, Ptr

Example

$var = Int(10.793) ;$var is the integer 10


Function IsAdmin

Function Reference

IsAdmin

Checks if the current user has full administrator privileges.

IsAdmin ( )

Parameters

None.

Return Value

Success: | Returns 1 if the current user has administrator privileges.
Failure: | Returns 0 if user lacks admin privileges.

Remarks

It returns 1 under Windows Vista only if running with a full administrator token (i.e. #RequireAdmin has been used, or has already been elevated by UAC).

Related

#RequireAdmin

Example

If IsAdmin() Then MsgBox(0, "", "Admin rights detected")


Function IsArray

Function Reference

IsArray

Checks if a variable is an array type.

IsArray ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if parameter is not an array variable.

Remarks

Can be useful to validate array/non-array parameters to user-defined functions.

Related

IsFloat, IsInt, IsString, IsNumber, IsBool, IsHWnd, IsBinary, IsPtr, VarGetType

Example

$pos = WinGetPos("[CLASS:Notepad]")
If IsArray($pos) Then
MsgBox(0, "Window height", $pos[3])
EndIf


Function IsBinary

Function Reference

IsBinary

Checks if a variable or expression is a binary type.

IsBinary ( expression )

Parameters

expression The variable or expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if expression is not binary type.

Remarks

None.

Related

IsArray, IsFloat, IsInt, IsString, IsNumber, IsBool, IsHWnd, Binary, BinaryToString, StringToBinary, VarGetType

Example

$bin = Binary("0x00204060")
$str = "0x00204060"

msgbox(0, "IsBinary $bin", IsBinary($bin))
msgbox(0, "IsBinary $str", IsBinary($str))


Function IsBool

Function Reference

IsBool

Checks if a variable's base type is boolean.

IsBool ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if expression is not boolean type.

Remarks

Related

IsArray, IsFloat, IsInt, IsNumber, IsString, IsHWnd, IsBinary, IsPtr, VarGetType

Example

$b = true
If IsBool($b) Then Msgbox(0,"Success", "$b is a boolean variable")


Function IsDeclared

Function Reference

IsDeclared

Check if a variable has been declared.

IsDeclared ( expression )

Parameters

expression string representing name of the variable to be checked.

Return Value

Success: | Returns 1 for Global variable or variable declared outside functions.
Special: | -1 for Local variable.
Failure: | Return 0 when no variable can be found.

Remarks

If there is a need to use IsDeclared() to check that a variable exists, then in most situations Assign() should be used to create/write to the variable and Eval() should be used to read from the variable.

Related

Assign, Eval

Example

If Not IsDeclared ("a") then
MsgBox(0,"", "$a is NOT declared") ; $a has never been assigned
EndIf

$a=1

If IsDeclared ("a") then
MsgBox(0,"", "$a IS declared" ) ; due to previous $a=1 assignment
EndIf


Function IsDllStruct

Function Reference

IsDllStruct

Checks if a variable is a DllStruct type.

IsDllStruct ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if expression is not DllStruct type as return by DllStructCreate.

Remarks

None.

Related

DllStructCreate, VarGetType

Example

$struct = DllStructCreate("char[256]")
$x = IsDllStruct($struct)


Function IsFloat

Function Reference

IsFloat

Checks if a variable or expression is a float-type.

IsFloat ( variable )

Parameters

variable The variable or expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if expression is not float type.

Remarks

See examples.

Related

IsArray, IsInt, IsString, IsNumber, IsBool, IsHWnd, StringIsFloat, IsBinary, IsPtr, VarGetType

Example

IsFloat(3.14159) ;returns 1
IsFloat(3.000) ;returns 0 since value is integer 3
IsFloat(1/2 - 5) ;returns 1
IsFloat(1.5e3) ;returns 0 since 1.5e3 = 1500
IsFloat("12.345") ;returns 0 since is a string


Function IsHWnd

Function Reference

IsHWnd

Checks if a variable's base type is a pointer and window handle.

IsHWnd ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1 if the expression is a pointer type AND a valid window handle.
Failure: | Returns 0 if expression is not a pointer OR not a valid window handle.

Remarks

Related

IsArray, IsFloat, IsInt, IsPtr, IsString, IsNumber, IsBool, GUICtrlGetHandle, IsBinary, VarGetType

Example

Run("notepad.exe")
Local $hWnd = WinGetHandle("[CLASS:Notepad]")
If IsHWnd($hWnd) Then
MsgBox(4096, "", "It's a valid HWND")
Else
MsgBox(4096, "", "It's not an HWND")
EndIf


Function IsInt

Function Reference

IsInt

Checks if a variable or expression is an integer type.

IsInt ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if expression is not integer.

Remarks

IsInt(7.5 - 2.5) returns 1 (meaning true).

Related

IsArray, IsFloat, IsString, IsNumber, IsBool, IsHWnd, StringIsInt, IsBinary, IsPtr, VarGetType

Example

IsInt(-12345) ;returns 1
IsInt(3.0000) ;returns 1
IsInt("5432") ;returns 0 since is a string
IsInt(7.5 - 4.5) ;returns 1 since evaluates to integer 3


Function IsKeyword

Function Reference

IsKeyword

Checks if a variable is a keyword (for example, Default).

IsKeyword ( variable )

Parameters

variable The variable to check.

Return Value

Success: | Returns 1 if variable is a keyword.
Failure: | Returns 0 if variable is not a keyword.

Remarks

Related

Default, VarGetType

Example

$a = default
If IsKeyword($a) Then MsgBox(0,"Ok", "Yes it is")


Function IsNumber

Function Reference

IsNumber

Checks if a variable's base type is numeric.

IsNumber ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if expression is not numeric type.

Remarks

Variants can be of two base types: Strings and Numbers. Additionally, a number can be whole (integer) or fractional/floating-point.

Related

IsArray, IsFloat, IsInt, IsString, IsBool, IsHWnd, IsBinary, IsPtr

Example

IsNumber(42)


Function IsObj

Function Reference

IsObj

Checks if a variable or expression is an object type.

IsObj ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1 if expression is an object variable.
Failure: | Returns 0 if expression is not an object variable.

Remarks

Related

ObjGet, ObjCreate, GUICtrlCreateObj, ObjEvent, ObjName, VarGetType

Example

$oShell = ObjCreate("shell.application")
if not IsObj($oShell) then
Msgbox(0,"Error","$oShell is not an Object.")
else
Msgbox(0,"Error","Successfully created Object $oShell.")
endif


Function IsPtr

Function Reference

IsPtr

Checks if a variable's base type is a pointer.

IsPtr ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1 if the expression is a pointer type.
Failure: | Returns 0 if expression is not pointer type.

Remarks

Related

IsArray, IsFloat, IsHWnd, IsInt, IsString, IsNumber, IsBool, Ptr

Example

Run("notepad.exe")
Local $hWnd = WinGetHandle("[CLASS:Notepad]")
If IsPtr($hWnd) Then
MsgBox(4096, "", "It's a valid Ptr")
Else
MsgBox(4096, "", "It's not a valid Ptr")
EndIf


Function IsString

Function Reference

IsString

Checks if a variable is a string type.

IsString ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if expression is not string type.

Remarks

None.

Related

IsArray, IsFloat, IsInt, IsNumber, IsBool, IsHWnd, IsBinary, IsPtr, String, VarGetType

Example

$x = IsString("foo")


Function Number

Function Reference

Number

Returns the numeric representation of an expression.

Number ( expression )

Parameters

expression An expression to convert into a number.

Return Value

Returns a number.

Remarks

A string beginning with letters has a numeric value of zero. A string beginning with digits has non-numeric characters stripped.

Related

Int, String, Binary, Ceiling, Floor, HWnd, Ptr, Round

Example

$w = Number(1+2+10) ;returns 13
$x = Number("3.14") ;returns 3.14
$y = Number("24/7") ;returns 24
$z = Number("tmp3") ;returns 0


Function Ptr

Function Reference

Ptr

Converts an expression into a pointer variant.

Ptr ( expression )

Parameters

expression An expression to convert into a pointer variant.

Return Value

Returns the pointer representation of the expression.

Remarks

None.

Related

HWnd, Int, IsPtr, String, Number

Example


Function String

Function Reference

String

Returns the string representation of an expression.

String ( expression )

Parameters

expression An expression to convert into a string.

Return Value

Returns a string.

Remarks

Maximum string length is 2147483647 characters (but keep in mind that no line in an AutoIt script can exceed 4095 characters.)

Related

Int, Number, IsString, Chr, BinaryToString, ChrW, HWnd, Ptr, StringToBinary

Example

$var = String(10)
;$var is the string "10"


Function StringToBinary

Function Reference

StringToBinary

Converts a string into binary data.

StringToBinary ( expression [, flag] )

Parameters

expression | An expression to convert into binary data.
flag | [optional] Changes how the string is stored as binary: flag = 1 (default), binary data is ANSI flag = 2, binary data is UTF16 Little Endian flag = 3, binary data is UTF16 Big Endian flag = 4, binary data is UTF8

Return Value

Returns a binary variant.

Remarks

None.

Related

Binary, BinaryToString, IsBinary, String

Example

; Binary ANSI to String
$buffer = StringToBinary("Hello - ??")
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer)
MsgBox(4096, "BinaryToString() ANSI representation" , $buffer)

; Binary UTF16-LE to String
$buffer = StringToBinary("Hello - ??", 2)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 2)
MsgBox(4096, "BinaryToString() UTF16-LE representation" , $buffer)

; Binary UTF16-BE to String
$buffer = StringToBinary("Hello - ??", 3)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 3)
MsgBox(4096, "BinaryToString() UTF16-BE representation" , $buffer)

; Binary UTF8 to String
$buffer = StringToBinary("Hello - ??", 4)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 4)
MsgBox(4096, "BinaryToString() UTF8 representation" , $buffer)


Function UBound

Function Reference

UBound

Returns the size of array dimensions.

UBound ( Array [, Dimension] )

Parameters

Array | The array variable which is being queried.
Dimension | [optional] Which dimension of a multi-dimensioned array to report the size of. Default is 1, which is the first dimension. If this parameter is 0, the number of subscripts in the array is returned.

Return Value

Success: | Returns the size of the array dimension.
Failure: | Returns 0 and sets @error:
 | 1 = Array given is not an array.
 | 2 = Array dimension is invalid.

Remarks

Remember that the value returned by UBound is one greater than the index of an array's last element!

Related

Dim, ReDim

Example

Dim $myArray[10][20] ;element 0,0 to 9,19
$rows = UBound($myArray)
$cols = UBound($myArray, 2)
$dims = UBound($myArray, 0)

MsgBox(0, "The " & $dims & "-dimensional array has", _
$rows & " rows, " & $cols & " columns")

;Display $myArray's contents
$output = ""
For $r = 0 to UBound($myArray,1) - 1
$output = $output & @LF
For $c = 0 to UBound($myArray,2) - 1
$output = $output & $myArray[$r][$c] & " "
Next
Next
MsgBox(4096,"Array Contents", $output)


Functions

Window functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
WinActivate | Activates (gives focus to) a window.
WinActive | Checks to see if a specified window exists and is currently active.
WinClose | Closes a window.
WinExists | Checks to see if a specified window exists.
WinFlash | Flashes a window in the taskbar.
WinGetCaretPos | Returns the coordinates of the caret in the foreground window
WinGetClassList | Retrieves the classes from a window.
WinGetClientSize | Retrieves the size of a given window's client area.
WinGetHandle | Retrieves the internal handle of a window.
WinGetPos | Retrieves the position and size of a given window.
WinGetProcess | Retrieves the Process ID (PID) associated with a window.
WinGetState | Retrieves the state of a given window.
WinGetText | Retrieves the text from a window.
WinGetTitle | Retrieves the full title from a window.
WinKill | Forces a window to close.
WinList | Retrieves a list of windows.
WinMenuSelectItem | Invokes a menu item of a window.
WinMinimizeAll | Minimizes all windows.
WinMinimizeAllUndo | Undoes a previous WinMinimizeAll function.
WinMove | Moves and/or resizes a window.
WinSetOnTop | Change a window's "Always On Top" attribute.
WinSetState | Shows, hides, minimizes, maximizes, or restores a window.
WinSetTitle | Changes the title of a window.
WinSetTrans | Sets the transparency of a window. (Windows 2000/XP or later)
WinWait | Pauses execution of the script until the requested window exists.
WinWaitActive | Pauses execution of the script until the requested window is active.
WinWaitClose | Pauses execution of the script until the requested window does not exist.
WinWaitNotActive | Pauses execution of the script until the requested window is not active.


Functions

Controls functions Reference

Below is a complete list of the functions available in AutoIt. Click on a function name for a detailed description.

Function | Description
ControlClick | Sends a mouse click command to a given control.
ControlCommand | Sends a command to a control.
ControlDisable | Disables or "grays-out" a control.
ControlEnable | Enables a "grayed-out" control.
ControlFocus | Sets input focus to a given control on a window.
ControlGetFocus | Returns the ControlRef# of the control that has keyboard focus within a specified window.
ControlGetHandle | Retrieves the internal handle of a control.
ControlGetPos | Retrieves the position and size of a control relative to it's window.
ControlGetText | Retrieves text from a control.
ControlHide | Hides a control.
ControlListView | Sends a command to a ListView32 control.
ControlMove | Moves a control within a window.
ControlSend | Sends a string of characters to a control.
ControlSetText | Sets text of a control.
ControlShow | Shows a control that was hidden.
ControlTreeView | Sends a command to a TreeView32 control.
StatusbarGetText | Retrieves the text from a standard status bar control.


Function ControlClick

Function Reference

ControlClick

Sends a mouse click command to a given control.

ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.
button | [optional] The button to click, "left", "right", "middle", "main", "menu", "primary", "secondary". Default is the left button.
clicks | [optional] The number of times to click the mouse. Default is 1.
x | [optional] The x position to click within the control. Default is center.
y | [optional] The y position to click within the control. Default is center.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

Some controls will resist clicking unless they are the active window. Use the WinActivate() function to force the control's window to the top before using ControlClick().
Using 2 for the number of clicks will send a double-click message to the control - this can even be used to launch programs from an explorer control!

If the user has swapped the left and right mouse buttons in the control panel, then the behaviour of the buttons is different. "Left" and "right" always click those buttons, whether the buttons are swapped or not. The "primary" or "main" button will be the main click, whether or not the buttons are swapped. The "secondary" or "menu" buttons will usually bring up the context menu, whether the buttons are swapped or not.

Button | Normal | Swapped
"" | Left | Left
"left" | Left | Left
"middle" | Middle | Middle
"right" | Right | Right
"primary" | Left | Right
"main" | Left | Right
"secondary" | Right | Left
"menu" | Right | Left

Related

ControlCommand, MouseClick, WinActivate

Example

ControlClick("[CLASS:Notepad]", "", "MDIClient1")


Function ControlCommand

Function Reference

ControlCommand

Sends a command to a control.

ControlCommand ( "title", "text", controlID, "command" [, "option"] )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.
command | The command to send to the control.
option | [optional] Additional parameter required by some commands.

Return Value

Depends on command as table below shows. In case of an error (such as an invalid command or window/control), @error=1.
Command, Option | Return Value
"IsVisible", "" | Returns 1 if Control is visible, 0 otherwise
"IsEnabled", "" | Returns 1 if Control is enabled, 0 otherwise
"ShowDropDown", "" | Drops a ComboBox
"HideDropDown", "" | Undrops a ComboBox
"AddString", 'string' | Adds a string to the end in a ListBox or ComboBox
"DelString", occurrence | Deletes a string according to occurrence in a ListBox or ComboBox
"FindString", 'string' | Returns occurrence ref of the exact string in a ListBox or ComboBox
"SetCurrentSelection", occurrence | Sets selection to occurrence ref in a ListBox or ComboBox
"SelectString", 'string' | Sets selection according to string in a ListBox or ComboBox
"IsChecked", "" | Returns 1 if Button is checked, 0 otherwise
"Check", "" | Checks radio or check Button
"UnCheck", "" | Unchecks radio or check Button
"GetCurrentLine", "" | Returns the line # where the caret is in an Edit
"GetCurrentCol", "" | Returns the column # where the caret is in an Edit
"GetCurrentSelection", "" | Returns name of the currently selected item in a ListBox or ComboBox
"GetLineCount", "" | Returns # of lines in an Edit
"GetLine", line# | Returns text at line # passed of an Edit
"GetSelected", "" | Returns selected text of an Edit
"EditPaste", 'string' | Pastes the 'string' at the Edit's caret position
"CurrentTab", "" | Returns the current Tab shown of a SysTabControl32
"TabRight", "" | Moves to the next tab to the right of a SysTabControl32
"TabLeft", "" | Moves to the next tab to the left of a SysTabControl32
"SendCommandID", Command ID | Simulates the WM_COMMAND message. Usually used for ToolbarWindow32 controls - use the ToolBar tab of Au3Info to get the Command ID.

Remarks

Some controls will resist automation unless they are the active window. Use the WinActive() function to force the control's window to the top before using ControlCommand() on these controls.

Certain commands that work on normal Combo and ListBoxes do not work on "ComboLBox" controls.

Related

ControlClick, ControlDisable, ControlEnable, ControlFocus, ControlGetPos, ControlGetText, ControlHide, ControlMove, ControlSetText, ControlShow, StatusbarGetText, WinActivate, WinMenuSelectItem, WinGetClassList, ControlGetFocus, ControlListView, ControlSend, ControlTreeView

Example

Run("notepad.exe")
ControlCommand("[CLASS:Notepad]", "", "Edit1", "GetLineCount", "")


Function ControlDisable

Function Reference

ControlDisable

Disables or "grays-out" a control.

ControlDisable ( "title", "text", controlID)

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

ControlEnable, ControlHide, ControlCommand

Example

ControlDisable("[CLASS:Notepad]", "", "MDIClient1")


Function ControlEnable

Function Reference

ControlEnable

Enables a "grayed-out" control.

ControlEnable ( "title", "text", controlID )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

ControlDisable, ControlShow, ControlCommand

Example

ControlEnable("[CLASS:Notepad]", "", "MDIClient1")


Function ControlFocus

Function Reference

ControlFocus

Sets input focus to a given control on a window.

ControlFocus ( "title", "text", controlID )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.

Return Value

Success: | Returns 1.
Failure: | Returns 0.

Remarks

None.

Related

ControlGetFocus, ControlCommand, ControlSend

Example

Run("notepad.exe")
ControlFocus("[CLASS:Notepad]", "", "Edit1")


Function ControlGetFocus

Function Reference

ControlGetFocus

Returns the ControlRef# of the control that has keyboard focus within a specified window.

ControlGetFocus ( "title" [, "text"] )

Parameters

title | Title of window to check.
text | [optional] Text from window to check.

Return Value

Success: | Returns the ClassNameNN of the control that has keyboard focus within a specified window.
Failure: | Returns "" (blank string) and sets @error to 1 if window is not found.

Remarks

None.

Related

ControlFocus, ControlCommand

Example

Run("notepad.exe")
$a = ControlGetFocus("[CLASS:Notepad]")


Function ControlGetHandle

Function Reference

ControlGetHandle

Retrieves the internal handle of a control.

ControlGetHandle ( "title", "text", controlID )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.

Return Value

Success: | Returns the handle (HWND) value.
Failure: | Returns "" (blank string) and sets @error to 1 if no window matches the criteria.

Remarks

This function returns a HWND/Handle value.

Related

None.

Example

Run("notepad.exe")
$handle = ControlGetHandle("[CLASS:Notepad]", "", "Edit1")


Function ControlGetPos

Function Reference

ControlGetPos

Retrieves the position and size of a control relative to it's window.

ControlGetPos ( "title", "text", controlID )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.

Return Value

Success: | Returns an array containing the size and the control's position relative to it's client window:
 | $array[0] = X position
 | $array[1] = Y position
 | $array[2] = Width
 | $array[3] = Height
Failure: | Sets @error to 1.

Remarks

The title/text is referencing the parent window, so be careful with "","" which references the active window which may not be the one containing the controlID control.

Related

ControlCommand, ControlMove

Example

Run("notepad.exe")
$pos = ControlGetPos("[CLASS:Notepad]", "", "Edit1")
MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] )


Function ControlGetText

Function Reference

ControlGetText

Retrieves text from a control.

ControlGetText ( "title", "text", controlID )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.

Return Value

Success: | Returns text from a control.
Failure: | Sets @error to 1 and returns a blank string of "".

Remarks

None.

Related

WinGetText, StatusbarGetText, ControlSetText, ControlCommand

Example

Run("notepad.exe")
$var = ControlGetText("[CLASS:Notepad]", "", "Edit1")


Function ControlHide

Function Reference

ControlHide

Hides a control.

ControlHide ( "title", "text", controlID )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window/control is not found.

Remarks

None.

Related

ControlShow, ControlCommand, ControlDisable, WinSetState

Example

ControlHide("[CLASS:Notepad]", "", "MDIClient1")


Function ControlListView

Function Reference

ControlListView

Sends a command to a ListView32 control.

ControlListView ( "title", "text", controlID, "command" [, option1 [, option2]] )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.
command | The command to send to the control (see below).
option1 | [optional] Additional parameter required by some commands.
option2 | [optional] Additional parameter required by some commands.

Return Value

Depends on command as table below shows. In case of an error (such as an invalid command or window/control could not be found) then @error is set to 1.

Command, Option1, Option2 | Operation
"DeSelect", From [, To] | Deselects one or more items.
"FindItem", "string to find" [, SubItem] | Returns the item index of the string. Returns -1 if the string is not found.
"GetItemCount" | Returns the number of list items.
"GetSelected" [, option] | Returns a string containing the item index of selected items. If option=0 (default) only the first selected item is returned. If option=1 then all the selected items are returned delimited by |, e.g: "0|3|4|10". If no items are selected a blank "" string is returned.
"GetSelectedCount" | Returns the number of items that are selected.
"GetSubItemCount" | Returns the number of subitems.
"GetText", Item, SubItem | Returns the text of a given item/subitem.
"IsSelected", Item | Returns 1 if the item is selected, otherwise returns 0.
"Select", From [, To] | Selects one or more items.
"SelectAll" | Selects all items.
"SelectClear" | Clears the selection of all items.
"SelectInvert" | Inverts the current selection.
"ViewChange", "view" | Changes the current view. Valid views are "list", "details", "smallicons", "largeicons".

All items/subitems are 0 based. This means that the first item/subitem in a list is 0, the second is 1, and so on.
In a "Details" view of a ListView32 control, the "item" can be thought of as the "row" and the "subitem" as the "column".

Remarks

Some commands may fail when using a 32-bit AutoIt process to read from a 64-bit process. Likewise commands may fail when using a 64-bit AutoIt process to read from a 32-bit process.

Related

ControlCommand

Example

ControlListView(@ProgramFilesDir & "\AutoIt3", "", "SysListView321", "SelectAll")
ControlListView(@ProgramFilesDir & "\AutoIt3", "", "SysListView321", "Deselect", 2, 5)
MsgBox(0, "", ControlListView(@ProgramFilesDir & "\AutoIt3", "", "SysListView321", "GetText", 9, 0) )
MsgBox(0, "", ControlListView(@ProgramFilesDir & "\AutoIt3", "", "SysListView321", "FindItem", "14 KB", 1) )
MsgBox(0, "", ControlListView(@ProgramFilesDir & "\AutoIt3", "", "SysListView321", "GetSelected", 1) )


Function ControlMove

Function Reference

ControlMove

Moves a control within a window.

ControlMove ( "title", "text", controlID, x, y [, width [, height]] )

Parameters

title | The title of the window to move.
text | The text of the window to move.
controlID | The control to interact with. See Controls.
x | X coordinate to move to relative to the window client area.
y | Y coordinate to move to relative to the window client area.
width | [optional] New width of the window.
height | [optional] New height of the window.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window/control is not found.

Remarks

If x and y equal to the Default keyword no move occurs, just resizing.

Related

ControlCommand, ControlGetPos

Example

ControlMove("[CLASS:Notepad]", "", "MDIClient1", 0, 0, 200, 200)


Function ControlSend

Function Reference

ControlSend

Sends a string of characters to a control.

ControlSend ( "title", "text", controlID, "string" [, flag] )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.
string | String of characters to send to the control.
flag | [optional] Changes how "keys" is processed: flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow. flag = 1, keys are sent raw.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window/control is not found.

Remarks

ControlSend works in a similar way to Send but it can send key strokes directly to a window/control, rather than just to the active window.

ControlSend is only unreliable for command prompts as that works differently to normal windows (seems to check physical states rather than accepting the keystroke messages). For normal windows ControlSend should be way more reliable than a normal Send - and yes it does send shift, ctrl, alt etc.

As mention in the Send help the keyboard that send different chars when in CAPS LOCK and using the Shift Key cannot be simulated. An example is the Czech Keyboard. A good workaround is to use the ControlSetText.

The control might first need to be given focus with the ControlFocus command, specially when referencing an controlID created by the script itself.

Opt("SendKeyDelay",...) alters the the length of the brief pause in between sent keystrokes.
Opt("SendKeyDownDelay",...) alters the length of time a key is held down before being released during a keystroke.

Related

ControlCommand, Send, ControlSetText, ControlFocus, SendKeyDelay (Option), SendKeyDownDelay (Option)

Example

ControlSend("[CLASS:Notepad]", "", "Edit1", "This is a line of text in the notepad window")


Function ControlSetText

Function Reference

ControlSetText

Sets text of a control.

ControlSetText ( "title", "text", controlID, "new text" [, flag] )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.
new text | The new text to be set into the control.
flag | [optional] when different from 0 (default) will force the target window to be redrawn.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window/control is not found.

Remarks

None.

Related

ControlGetText, ControlCommand, ControlSend, SplashTextOn

Example

Run("notepad.exe")
WinWait("[CLASS:Notepad]")
ControlSetText("[CLASS:Notepad]", "", "Edit1", "New Text Here" )


Function ControlShow

Function Reference

ControlShow

Shows a control that was hidden.

ControlShow ( "title", "text", controlID )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window/control is not found.

Remarks

None.

Related

ControlHide, ControlEnable, ControlCommand

Example

ControlShow("[CLASS:Notepad]", "", "MDIClient1")


Function ControlTreeView

Function Reference

ControlTreeView

Sends a command to a TreeView32 control.

ControlTreeView ( "title", "text", controlID, "command" [, option1 [, option2]] )

Parameters

title | The title of the window to access.
text | The text of the window to access.
controlID | The control to interact with. See Controls.
command | The command to send to the control (see below).
option1 | [optional] Additional parameter required by some commands.
option2 | [optional] Additional parameter required by some commands.

Return Value

Depends on command as table below shows. In case of an error (such as an invalid command or window/control could not be found) then @error is set to 1.

Command, Option1, Option2 | Operation
"Check", "item" | Checks an item (if the item supports it).
"Collapse", "item" | Collapses an item to hide its children.
"Exists", "item" | Returns 1 if an item exists, otherwise 0.
"Expand", "item" | Expands an item to show its children.
"GetItemCount", "item" | Returns the number of children for a selected item.
"GetSelected" [, UseIndex] | Returns the item reference of the current selection using the text reference of the item (or index reference if UseIndex is set to 1).
"GetText", "item" | Returns the text of an item.
"IsChecked" | Returns the state of an item. 1:checked, 0:unchecked, -1:not a checkbox.
"Select", "item" | Selects an item.
"Uncheck", "item" | Unchecks an item (if the item supports it).

The "item" parameter is a string-based parameter that is used to reference a particular treeview item using a combination of text and indices. Indices are 0-based. For example:

Heading1
----> H1SubItem1
----> H1SubItem2
----> H1SubItem3
----> ----> H1S1SubItem1
Heading2
Heading3

Each "level" is separated by |. An index is preceded with #. Examples:

Item | Item Reference
Heading2 | "Heading2" or "#1"
H1SubItem2 | "Heading1|H1SubItem2" or "#0|#1"
H1S1SubItem1 | "Heading1|H1SubItem3|H1S1SubItem1" or "#0|#2|#0"

References can also be mixed like "Heading1|#1".

Remarks

As AutoIt is a 32-bit application some commands are not available when referencing a 64-bit application as Explorer when running on 64-bit Windows.

Related

ControlCommand

Example

; Author: Zedna

#include <GUIConstantsEx.au3>
#include <TreeviewConstants.au3>
#include <WindowsConstants.au3>

$gui = GUICreate("ControlTreeview test", 212, 212)
$treeview = GUICtrlCreateTreeView(6, 6, 200, 160, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_CHECKBOXES), $WS_EX_CLIENTEDGE)
$h_tree = ControlGetHandle($gui, "", $treeview)

$root = GUICtrlCreateTreeViewItem("Root", $treeview)
$item1 = GUICtrlCreateTreeViewItem("Item 1", $root)
$item2 = GUICtrlCreateTreeViewItem("Item 2", $root)
$item3 = GUICtrlCreateTreeViewItem("Item 3", $root)
$item4 = GUICtrlCreateTreeViewItem("Item 4", $root)
$item41 = GUICtrlCreateTreeViewItem("Item 41", $item4)
$item42 = GUICtrlCreateTreeViewItem("Item 42", $item4)
$item5 = GUICtrlCreateTreeViewItem("Item 5", $root)

GUISetState(@SW_SHOW)

; some examples
ControlTreeView ($gui, "", $h_tree, "Expand", "Root")

ControlTreeView ($gui, "", $h_tree, "Exists", "Root|Item 4")
ControlTreeView ($gui, "", $h_tree, "Check", "Root|Item 4")
ControlTreeView ($gui, "", $h_tree, "Select", "Root|Item 4")
ControlTreeView ($gui, "", $h_tree, "Expand", "Root|Item 4")

While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd


Function StatusbarGetText

Function Reference

StatusbarGetText

Retrieves the text from a standard status bar control.

StatusbarGetText ( "title" [, "text" [, part]] )

Parameters

title | The title of the window to check.
text | [optional] The text of the window to check.
part | [optional] The "part" number of the status bar to read - the default is 1. 1 is the first possible part and usually the one that contains the useful messages like "Ready" "Loading...", etc.

Return Value

Success: | Returns the text read.
Failure: | Returns "" (blank string) and sets @error to 1 if no text could be read.

Remarks

This functions attempts to read the first standard status bar on a window (Microsoft common control: msctls_statusbar32). Some programs use their own status bars or special versions of the MS common control which StatusbarGetText cannot read. For example, StatusbarText does not work on the program TextPad; however, the first region of TextPad's status bar can be read using ControlGetText("TextPad", "", "HSStatusBar1")
StatusbarGetText can work on windows that are minimized or even hidden.

Related

ControlGetText, ControlCommand

Example

AutoItSetOption("WinTitleMatchMode", 2)
$x = StatusbarGetText("Internet Explorer")
MsgBox(0, "Internet Explorer's status bar says:", $x)


Function WinActivate

Function Reference

WinActivate

Activates (gives focus to) a window.

WinActivate ( "title" [, "text"] )

Parameters

title | The title of the window to activate. See Title special definition.
text | [optional] The text of the window to activate.

Return Value

Success: | Returns the handle of the window.
Failure: | Returns 0 if window is not found or cannot be activated.

Remarks

You can use the WinActive function to check if WinActivate succeeded. If multiple windows match the criteria, the window that was most recently active is the one activated. WinActivate works on minimized windows. However, a window that is "Always On Top" could still cover up a window you Activated.

@extended contains additional info about how the activated process was done.

Related

WinClose, WinSetState, WinTitleMatchMode (Option), WinKill, WinMove

Example

WinActivate("[CLASS:Notepad]", "")


Function WinActive

Function Reference

WinActive

Checks to see if a specified window exists and is currently active.

WinActive ( "title" [, "text"] )

Parameters

title | The title of the window to check. See Title special definition.
text | [optional] The text of the window to check.

Return Value

Success: | Returns the handle to the window if it is active.
Failure: | Returns 0 otherwise.

Remarks

None.

Related

WinExists, WinWait, WinWaitActive, WinWaitClose, WinWaitNotActive, WinTitleMatchMode (Option)

Example

If WinActive("[CLASS:Notepad]") Then
MsgBox(0, "", "Window was active")
EndIf


Function WinClose

Function Reference

WinClose

Closes a window.

WinClose ( "title" [, "text"] )

Parameters

title | The title of the window to close. See Title special definition.
text | [optional] The text of the window to close.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window is not found.

Remarks

This function sends a close message to a window, the result depends on the window (it may ask to save data, etc.). To force a window to close, use the WinKill function. If multiple windows match the criteria, the window that was most recently active is closed.

Related

WinActivate, WinExists, WinKill, WinSetState, WinTitleMatchMode (Option), ProcessClose, WinMove

Example

WinClose("[CLASS:Notepad]", "")


Function WinExists

Function Reference

WinExists

Checks to see if a specified window exists.

WinExists ( "title" [, "text"] )

Parameters

title | The title of the window to check. See Title special definition.
text | [optional] The text of the window to check.

Return Value

Success: | Returns 1 if the window exists.
Failure: | Returns 0 otherwise.

Remarks

WinExists will return 1 even if the window is hidden.

Related

WinActive, WinWait, WinWaitActive, WinWaitClose, WinWaitNotActive, WinTitleMatchMode (Option), ProcessExists, WinClose

Example

If WinExists("[CLASS:Notepad]") Then
MsgBox(0, "", "Window exists")
EndIf


Function WinFlash

Function Reference

WinFlash

Flashes a window in the taskbar.

WinFlash ( "title" [,"text" [,flashes [,delay ]]])

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.
flashes | [optional] The amount of times to flash the window. Default 4.
delay | [optional] The time in milliseconds to sleep between each flash. Default 500 ms.

Return Value

None.

Remarks

This function is very useful for catching the user's eye!

Related

WinSetState

Example

; flashes the window 4 times with a break in between each one of 1/2 second
WinFlash("[CLASS:Notepad]","", 4, 500)


Function WinGetCaretPos

Function Reference

WinGetCaretPos

Returns the coordinates of the caret in the foreground window

WinGetCaretPos ( )

Parameters

None.

Return Value

Success: | Returns a 2-element array containing the following information:
 | $array[0] = X coordinate
 | $array[1] = Y coordinate
Failure: | Sets @error to 1.

Remarks

WinGetCaretPos might not return accurate values for Multiple Document Interface (MDI) applications if absolute CaretCoordMode is used. See example for a workaround. Note: Some applications report static coordinates regardless of caret position!

Related

CaretCoordMode (Option)

Example

$a = WinGetCaretPos()
If Not @error Then ToolTip("First Method Pos", $a[0], $a[1])
sleep(2000)

$b = _CaretPos()
If Not @error Then ToolTip("Second Method Pos", $b[0], $b[1])
sleep(2000)

; More reliable method to get caret coords in MDI text editors.
Func _CaretPos()
Local $x_adjust = 5
Local $y_adjust = 40

Opt("CaretCoordMode", 0) ;relative mode
Local $c = WinGetCaretPos() ;relative caret coords
Local $w = WinGetPos("") ;window's coords
Local $f = ControlGetFocus("","") ;text region "handle"
Local $e = ControlGetPos("", "", $f) ;text region coords

Local $t[2]
If IsArray($c) and IsArray($w) and IsArray($e) Then
$t[0] = $c[0] + $w[0] + $e[0] + $x_adjust
$t[1] = $c[1] + $w[1] + $e[1] + $y_adjust
Return $t ;absolute screen coords of caret cursor
Else
SetError(1)
EndIf
EndFunc


Function WinGetClassList

Function Reference

WinGetClassList

Retrieves the classes from a window.

WinGetClassList ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns a string containing the window classes read.
Failure: | Returns "" and sets @error to 1 if no window matches the criteria.

Remarks

Class names are linefeed (@LF) separated. WinGetClassList works on both minimized and hidden windows. Up to 64KB of text can be retrieved. If multiple windows match the criteria, the classes are read from the most recently active window.

Related

WinGetText, ControlCommand

Example

$text = WinGetClassList("[CLASS:Notepad]", "")
MsgBox(0, "Text read was:", $text)


Function WinGetClientSize

Function Reference

WinGetClientSize

Retrieves the size of a given window's client area.

WinGetClientSize ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns a 2-element array containing the following information:
 | $array[0] = Width of window's client area
 | $array[1] = Height of window's client area
Failure: | Returns 0 and sets @error to 1 if windows is not found.

Remarks

If the window is minimized, the returned width and height values are both zero. However, WinGetClientSize works correctly on (non-minimized) hidden windows. If the window title "Program Manager" is used, the function will return the size of the desktop. If multiple windows match the criteria, the most recently active window is used.

Related

WinGetPos, WinMove

Example

$size = WinGetClientSize("[active]")
MsgBox(0, "Active window's client size is (width,height):", $size[0] & " " & $size[1])


Function WinGetHandle

Function Reference

WinGetHandle

Retrieves the internal handle of a window.

WinGetHandle ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns handle to the window.
Failure: | Returns "" (blank string) and sets @error to 1 if no window matches the criteria.

Remarks

This function allows you to use handles to specify windows rather than "title" and "text".
Once you have obtained the handle you can access the required window even if its title changes.

Related

WinSetTitle, GUICreate, WinList

Example

; Identify the Notepad window that contains the text "this one" and get a handle to it

; Change into the WinTitleMatchMode that supports classnames and handles
AutoItSetOption("WinTitleMatchMode", 4)

; Get the handle of a notepad window that contains "this one"
$handle = WinGetHandle("classname=Notepad", "this one")
If @error Then
MsgBox(4096, "Error", "Could not find the correct window")
Else
; Send some text directly to this window's edit control
ControlSend($handle, "", "Edit1", "AbCdE")
EndIf


Function WinGetPos

Function Reference

WinGetPos

Retrieves the position and size of a given window.

WinGetPos ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns a 4-element array containing the following information:
 | $array[0] = X position
 | $array[1] = Y position
 | $array[2] = Width
 | $array[3] = Height
Failure: | Returns 0 and sets @error to 1 if windows is not found.

Remarks

WinGetPos returns negative numbers such as -32000 for minimized windows, but works fine with (non-minimized) hidden windows.
If the window title "Program Manager" is used, the function will return the size of the desktop. If multiple windows match the criteria, the most recently active window is used.

Related

WinGetClientSize, WinMove, WinGetState

Example

$size = WinGetPos("[active]")
MsgBox(0, "Active window stats (x,y,width,height):", $size[0] & " " & $size[1] & " " & $size[2] & " " & $size[3])


Function WinGetProcess

Function Reference

WinGetProcess

Retrieves the Process ID (PID) associated with a window.

WinGetProcess ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns a numeric Process ID (PID).
Failure: | Returns -1.

Remarks

None.

Related

ProcessWait, ProcessWaitClose, ProcessList

Example

Run("notepad.exe")
$pid = WinGetProcess("[CLASS:Notepad]")
MsgBox(4096, "PID is", $pid)


Function WinGetState

Function Reference

WinGetState

Retrieves the state of a given window.

WinGetState ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns a value indicating the state of the window. Multiple values are added together so use BitAND() to examine the part you are interested in:
 | 1 = Window exists
 | 2 = Window is visible
 | 4 = Window is enabled
 | 8 = Window is active
 | 16 = Window is minimized
 | 32 = Window is maximized
Failure: | Returns 0 and sets @error to 1 if the window is not found.

Remarks

None.

Related

BitAND, WinGetPos

Example

; Check if a new notepad window is minimized
$state = WinGetState("[CLASS:Notepad]", "")

; Is the "minimized" value set?
If BitAnd($state, 16) Then
MsgBox(0, "Example", "Window is minimized")
EndIf


Function WinGetText

Function Reference

WinGetText

Retrieves the text from a window.

WinGetText ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns a string containing the window text read.
Failure: | Returns numeric 0 if no title match.

Remarks

Up to 64KB of window text can be retrieved. WinGetText works on minimized windows, but only works on hidden windows if you've set AutoItSetOption("WinDetectHiddenText", 1)
If multiple windows match the criteria for WinGetText, the information for the most recently active match is returned.
Use WinGetText("[active]") to get the active window's text.

Related

WinGetTitle, ControlGetText, WinGetClassList

Example

$text = WinGetText("[CLASS:Notepad]", "")
MsgBox(0, "Text read was:", $text)


Function WinGetTitle

Function Reference

WinGetTitle

Retrieves the full title from a window.

WinGetTitle ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns a string containing the complete window title.
Failure: | Returns numeric 0 if no title match.

Remarks

WinGetTitle("[active]") returns the active window's title. WinGetTitle works on both minimized and hidden windows. If multiple windows match the criteria, the most recently active window is used.

Related

AutoItWinGetTitle, WinGetText, WinSetTitle, WinTitleMatchMode (Option)

Example

$title = WinGetTitle("[CLASS:Notepad]", "")
MsgBox(0, "Full title read was:", $title)


Function WinKill

Function Reference

WinKill

Forces a window to close.

WinKill ( "title" [, "text"] )

Parameters

title | The title of the window to close. See Title special definition.
text | [optional] The text of the window to close.

Return Value

None. (Always returns 1 regardless of success.)

Remarks

The difference between this function and WinClose is that WinKill will forcibly terminate the window if it doesn't close quickly enough. Consequently, a user might not have time to respond to dialogs prompting the user to save data. Although WinKill can work on both minimized and hidden windows, some windows (notably explorer windows) can only be terminated using WinClose.

Related

WinActivate, WinClose, WinSetState, ProcessClose

Example

WinKill("[CLASS:Notepad] ", "")


Function WinList

Function Reference

WinList

Retrieves a list of windows.

WinList ( ["title" [, "text"]] )

Parameters

title | [optional] The title of the window to read.
text | [optional] The text of the window to read.

Return Value

Returns an array of matching window titles and handles.

Remarks

If no title and text is given then all top-level windows are returned.

The array returned is two-dimensional and is made up as follows:
$array[0][0] = Number of windows returned
$array[1][0] = 1st window title
$array[1][1] = 1st window handle (HWND)
$array[2][0] = 2nd window title
$array[2][1] = 2nd window handle (HWND)
...
$array[n][0] = nth window title
$array[n][1] = nth window handle (HWND)

Related

WinGetHandle

Example

$var = WinList()

For $i = 1 to $var[0][0]
; Only display visble windows that have a title
If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
EndIf
Next

Func IsVisible($handle)
If BitAnd( WinGetState($handle), 2 ) Then
Return 1
Else
Return 0
EndIf

EndFunc


Function WinMenuSelectItem

Function Reference

WinMenuSelectItem

Invokes a menu item of a window.

WinMenuSelectItem ( "title", "text", "item" [, "item" [, "item" [, "item" [, "item" [, "item" [, "item"]]]]]] )

Parameters

title | The title of the window to read. See Title special definition.
text | The text of the window to read.
item | Text of Menu Item
item | [optional] Text of SubMenu item
item | [optional] Text of SubMenu item
item | [optional] Text of SubMenu item
item | [optional] Text of SubMenu item
item | [optional] Text of SubMenu item
item | [optional] Text of SubMenu item

Return Value

Success: | Returns 1.
Failure: | Returns 0 if the menu could not be found.

Remarks

You should note that underlined menu items actually contain a & character to indicate the underlining. Thus, the menu item File would actually require the text "&File", and Convert would require "Con&vert" You can access menu items up to six levels deep; and the window can be inactive, minimized, and/or even hidden.

WinMenuSelectItem will only work on standard menus. Unfortunately, many menus in use today are actually custom written or toolbars "pretending" to be menus. This is true for most Microsoft applications.

Related

ControlCommand, Send

Example

; This will select File, Page Setup in notepad
WinMenuSelectItem("[CLASS:Notepad] ", "", "&File", "Page Set&up..." )


Function WinMinimizeAll

Function Reference

WinMinimizeAll

Minimizes all windows.

WinMinimizeAll ( )

Parameters

None.

Return Value

None.

Remarks

Send("#m") is a possible alternative.

Related

WinMinimizeAllUndo, WinSetState

Example

WinMinimizeAll()


Function WinMinimizeAllUndo

Function Reference

WinMinimizeAllUndo

Undoes a previous WinMinimizeAll function.

WinMinimizeAllUndo ( )

Parameters

None.

Return Value

None.

Remarks

Send("#+m") is a possible alternative.

Related

WinMinimizeAll, WinSetState

Example

WinMinimizeAllUndo()


Function WinMove

Function Reference

WinMove

Moves and/or resizes a window.

WinMove ( "title", "text", x, y [, width [, height[, speed]]] )

Parameters

title | The title of the window to move/resize. See Title special definition.
text | The text of the window to move/resize.
x | X coordinate to move to.
y | Y coordinate to move to.
width | [optional] New width of the window.
height | [optional] New height of the window.
speed | [optional] the speed to move the windows in the range 1 (fastest) to 100 (slowest). If not defined the move is instantaneous.

Return Value

Success: | Returns handle to the window.
Failure: | Returns 0 if window is not found.

Remarks

WinMove has no effect on minimized windows, but WinMove works on hidden windows.
If the width and height are small (or negative), the window will go no smaller than 112 x 27 pixels. If width and height are large, the window will go no larger than approximately [12+@DesktopWidth] x [12+@DesktopHeight] pixels.
Negative values are allowed for the x and y coordinates. In fact, you can move a window off screen; and if the window's program is one that remembers its last window position, the window will appear in the corner (but fully on-screen) the next time you launch the program.
If multiple windows match the criteria, the most recently active window is used.

If x and y equal to the Default keyword no move occurs, just resizing.

When speed is used the move is done with the new size.

Related

WinActivate, WinClose, WinGetClientSize, WinGetPos, WinSetState

Example

WinMove("[CLASS:Notepad]", "", 0, 0, 200, 200)


Function WinSetOnTop

Function Reference

WinSetOnTop

Change a window's "Always On Top" attribute.

WinSetOnTop ( "title", "text", flag )

Parameters

title | The title of the window to affect. See Title special definition.
text | The text of the window to affect.
flag | Determines whether the window should have the "TOPMOST" flag set. 1=set on top flag, 0 = remove on top flag

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window is not found.

Remarks

Third-party programs which add an "Always On Top" context menu entry might not update their menu entry to reflect the AutoIt-induced change in TOPMOST status.

Related

WinSetState

Example

WinSetOnTop("[CLASS:Notepad]", "", 1)


Function WinSetState

Function Reference

WinSetState

Shows, hides, minimizes, maximizes, or restores a window.

WinSetState ( "title", "text", flag )

Parameters

title | The title of the window to show. See Title special definition.
text | The text of the window to show.
flag | The "show" flag of the executed program: @SW_HIDE = Hide window @SW_SHOW = Shows a previously hidden window @SW_MINIMIZE = Minimize window @SW_MAXIMIZE = Maximize window @SW_RESTORE = Undoes a window minimization or maximization @SW_DISABLE = Disables the window @SW_ENABLE = Enables the window

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window is not found.

Remarks

If multiple windows match the criteria, the most recently active window is used.
@SW_MINIMIZE and @SW_MAXIMIZE even work on modal dialog windows.

Related

WinActivate, WinClose, ControlHide, WinFlash, WinKill, WinMinimizeAll, WinMinimizeAllUndo, WinMove, WinSetOnTop

Example

WinSetState("[CLASS:Notepad]", "", @SW_HIDE)
Sleep(3000)
WinSetState("[CLASS:Notepad]", "", @SW_SHOW)


Function WinSetTitle

Function Reference

WinSetTitle

Changes the title of a window.

WinSetTitle ( "title", "text", "newtitle" )

Parameters

title | The title of the window to change. See Title special definition.
text | The text of the window to change.
newtitle | The new title to give to the window.

Return Value

Success: | Returns 1.
Failure: | Returns 0 if window is not found.

Remarks

If multiple windows match the criteria the title of most recently active window is changed.

Related

AutoItWinSetTitle, WinGetTitle, WinTitleMatchMode (Option), WinGetHandle

Example

WinSetTitle("[CLASS:Notepad] ", "", "My New Notepad")


Function WinSetTrans

Function Reference

WinSetTrans

Sets the transparency of a window. (Windows 2000/XP or later)

WinSetTrans ( "title", "text", transparency )

Parameters

title | The title of the window to change. See Title special definition.
text | The text of the window to change.
transparency | A number in the range 0 - 255. The lower the number, the more transparent the window will become. 255 = Solid, 0 = Invisible.

Return Value

Success: | Returns Non-zero.
Failure: | Returns 0, @error will be set to 1 if the function isn't supported on an OS.

Remarks

Requires Windows 2000/XP or later. Screen color must be greater or equal to 16-bit.

Related

None.

Example

Opt("WinTitleMatchMode", 2) ; Match substring
WinSetTrans("Notepad", "", 170) ; Make Notepad window semi-transparent.


Function WinWait

Function Reference

WinWait

Pauses execution of the script until the requested window exists.

WinWait ( "title" [, "text" [, timeout]] )

Parameters

title | The title of the window to check. See Title special definition.
text | [optional] The text of the window to check.
timeout | [optional] Timeout in seconds

Return Value

Success: | Returns handle to the requested window.
Failure: | Returns 0 if timeout occurred.

Remarks

None.

Related

WinActive, WinExists, WinWaitActive, WinWaitClose, WinWaitNotActive, WinWaitDelay (Option), ProcessWait

Example

;Wait for the window "[CLASS:Notepad]" to exist

Run("notepad")
WinWait("[CLASS:Notepad]")

;Wait a maximum of 5 seconds for "[CLASS:Notepad]" to exist
WinWait("[CLASS:Notepad]", "", 5)


Function WinWaitActive

Function Reference

WinWaitActive

Pauses execution of the script until the requested window is active.

WinWaitActive ( "title" [, "text" [, timeout]] )

Parameters

title | The title of the window to check. See Title special definition.
text | [optional] The text of the window to check.
timeout | [optional] Timeout in seconds

Return Value

Success: | Returns handle to the requested window.
Failure: | Returns 0 if timeout occurred.

Remarks

None.

Related

WinActive, WinExists, WinWait, WinWaitClose, WinWaitNotActive, WinWaitDelay (Option), ProcessWait

Example

;Wait for the window "[CLASS:Notepad]" to exist and be active
WinWaitActive("[CLASS:Notepad]")

;Wait a maximum of 5 seconds for "[CLASS:Notepad]" to exist and be active
WinWaitActive("[CLASS:Notepad]", "", 5)


Function WinWaitClose

Function Reference

WinWaitClose

Pauses execution of the script until the requested window does not exist.

WinWaitClose ( "title" [, "text" [, timeout]] )

Parameters

title | The title of the window to check. See Title special definition.
text | [optional] The text of the window to check.
timeout | [optional] Timeout in seconds

Return Value

Success: | Returns 1.
Failure: | Returns 0 if timeout occurred.

Remarks

If the window already doesn't exist when this function is called it will return 1 immediately. The window is polled every 250 milliseconds or so.

Related

WinActive, WinExists, WinWait, WinWaitActive, WinWaitNotActive, WinWaitDelay (Option), ProcessWaitClose

Example

;Wait for the window "[CLASS:Notepad]" to not exist
WinWaitClose("[CLASS:Notepad]")

;Wait a maximum of 5 seconds for "[CLASS:Notepad]" to not exist
WinWaitClose("[CLASS:Notepad]", "", 5)


Function WinWaitNotActive

Function Reference

WinWaitNotActive

Pauses execution of the script until the requested window is not active.

WinWaitNotActive ( "title" [, "text" [, timeout]] )

Parameters

title | The title of the window to check. See Title special definition.
text | [optional] The text of the window to check.
timeout | [optional] Timeout in seconds

Return Value

Success: | Returns 1.
Failure: | Returns 0 if timeout occurred.

Remarks

The script polls for a window match every 250 milliseconds or so.

Related

WinActive, WinExists, WinWait, WinWaitActive, WinWaitClose, WinWaitDelay (Option)

Example

;Wait for the window "[CLASS:Notepad]" to not be active
WinWaitNotActive("[CLASS:Notepad]")

;Wait a maximum of 5 seconds for "[CLASS:Notepad]" to not be active
WinWaitNotActive("[CLASS:Notepad]", "", 5)


Appendix Reference

  • AutoIt3 limits/defaults
  • Ascii Characters
  • CLSIDs of Special Folders
  • GUI Control Styles
  • OsLang Values
  • Send Key List
  • Standard Windows Fonts
  • Windows Message Codes


Limits Defaults

AutoIt3 Limits/defaults

AutoIt3 limits | Value | Description
MAX_LINESIZE | 4095 | Maximum size for a line of script.
MAX_ENVSIZE | 32767 | Maximum size for an ENV variable.
WINTEXTBUFFER | 32767 | GetWindowText fails under 95 if>65535, WM_GETTEXT randomly fails if > 32767.
MAXCALLRECURSE | 5100 | Maximum number of times the Call() function can recurse to itself.
MAXEXECUTERECURSE | 5100 | Maximum number of times the Execute() function can recurse to itself.
GUI_MAXCONTROLS | 65532 | Maximum number of controls in GUI box.
GUI_MAXPOINTS | 256 | Maximum number of points by graphic info page.
COM_MAXEVENT | 64 | Maximum number of COM events that can be buffered.
VAR_SUBSCRIPT_MAX | 64 | Maximum number of subscripts for an array.
MAIN_TIMER_DELAY | 750 ms | Tray icon hiding/flashing/drawing is checked every 750ms.
CMDLINEPARAM_MAXLEN | 4096 | Each parameter can be this many characters.
TRAY_MAXITEMS | 505 | Maximum number of items in the tray menu.
TRAY_MAXEVENT | 32 | Maximum number of events that can be buffered.
TRAY_TOOLTIPWIDTH | 64 | Maximum number of characters displayed in a tray tooltip.

Default | Value | Description
ADLIB delay | 250 ms | Default delay in ms between ADLIB triggers. Can be defined in AdlibRegister().
 |  | Following defaults can be changed with Opt()
MouseClickDelay | 10 ms | Time between mouse clicks.
MouseClickDownDelay | 10 ms | Time the click is held down.
MouseClickDragDelay | 250 ms | The delay at the start and end of a drag operation.
TCPTimeout | 100 ms | Time after a TCP function is aborted.


ASCII Characters

ASCII Character Codes

This list is helpful with the Asc and Chr functions. Taken from ASCII Character Set

Control Characters (mostly non-printing; most useful of these are highlighted in yellow.)

Char... | Dec | Hex | Oct | Description
NUL | 0 | 00 | 000 | Null character
SOH | 1 | 01 | 001 | Start of heading, = console interrupt
STX | 2 | 02 | 002 | Start of text, maintenance mode on HP console
ETX | 3 | 03 | 003 | End of text
EOT | 4 | 04 | 004 | End of transmission, not the same as ETB
ENQ | 5 | 05 | 005 | Enquiry, goes with ACK; old HP flow control
ACK | 6 | 06 | 006 | Acknowledge, clears ENQ logon hand
BEL | 7 | 07 | 007 | Bell, rings the bell... (Plays Windows' default beep)
BS | 8 | 08 | 010 | Backspace, works on HP terminals/computers
HT | 9 | 09 | 011 | Horizontal tab, move to next tab stop
LF | 10 | 0a | 012 | Line Feed
VT | 11 | 0b | 013 | Vertical tab
FF | 12 | 0c | 014 | Form Feed, page eject
CR | 13 | 0d | 015 | Carriage Return
SO | 14 | 0e | 016 | Shift Out, alternate character set
SI | 15 | 0f | 017 | Shift In, resume default character set
DLE | 16 | 10 | 020 | Data link escape
DC1 | 17 | 11 | 021 | XON, with XOFF to pause listings; ":okay to send".
DC2 | 18 | 12 | 022 | Device control 2, block-mode flow control
DC3 | 19 | 13 | 023 | XOFF, with XON is TERM=18 flow control
DC4 | 20 | 14 | 024 | Device control 4
NAK | 21 | 15 | 025 | Negative acknowledge
SYN | 22 | 16 | 026 | Synchronous idle
ETB | 23 | 17 | 027 | End transmission block, not the same as EOT
CAN | 24 | 18 | 030 | Cancel line, MPE echoes !!!
EM | 25 | 19 | 031 | End of medium, Control-Y interrupt
SUB | 26 | 1a | 032 | Substitute
ESC | 27 | 1b | 033 | Escape, next character is not echoed
FS | 28 | 1c | 034 | File separator
GS | 29 | 1d | 035 | Group separator
RS | 30 | 1e | 036 | Record separator, block-mode terminator
US | 31 | 1f | 037 | Unit separator

Printing Characters (standard characters)

Char | Dec | Hex | Oct | Description
 | 32 | 20 | 040 | Space
! | 33 | 21 | 041 | Exclamation mark
" | 34 | 22 | 042 | Quotation mark (&quot; in HTML)
# | 35 | 23 | 043 | Cross hatch (number sign)
$ | 36 | 24 | 044 | Dollar sign
% | 37 | 25 | 045 | Percent sign
& | 38 | 26 | 046 | Ampersand
` | 39 | 27 | 047 | Closing single quote (apostrophe)
( | 40 | 28 | 050 | Opening parentheses
) | 41 | 29 | 051 | Closing parentheses
* | 42 | 2a | 052 | Asterisk (star, multiply)
+ | 43 | 2b | 053 | Plus
, | 44 | 2c | 054 | Comma
- | 45 | 2d | 055 | Hyphen, dash, minus
. | 46 | 2e | 056 | Period
/ | 47 | 2f | 057 | Slant (forward slash, divide)
0 | 48 | 30 | 060 | Zero
1 | 49 | 31 | 061 | One
2 | 50 | 32 | 062 | Two
3 | 51 | 33 | 063 | Three
4 | 52 | 34 | 064 | Four
5 | 53 | 35 | 065 | Five
6 | 54 | 36 | 066 | Six
7 | 55 | 37 | 067 | Seven
8 | 56 | 38 | 070 | Eight
9 | 57 | 39 | 071 | Nine
: | 58 | 3a | 072 | Colon
; | 59 | 3b | 073 | Semicolon
< | 60 | 3c | 074 | Less than sign
= | 61 | 3d | 075 | Equals sign
> | 62 | 3e | 076 | Greater than sign
? | 63 | 3f | 077 | Question mark
@ | 64 | 40 | 100 | At-sign
A | 65 | 41 | 101 | Uppercase A
B | 66 | 42 | 102 | Uppercase B
C | 67 | 43 | 103 | Uppercase C
D | 68 | 44 | 104 | Uppercase D
E | 69 | 45 | 105 | Uppercase E
F | 70 | 46 | 106 | Uppercase F
G | 71 | 47 | 107 | Uppercase G
H | 72 | 48 | 110 | Uppercase H
I | 73 | 49 | 111 | Uppercase I
J | 74 | 4a | 112 | Uppercase J
K | 75 | 4b | 113 | Uppercase K
L | 76 | 4c | 114 | Uppercase L
M | 77 | 4d | 115 | Uppercase M
N | 78 | 4e | 116 | Uppercase N
O | 79 | 4f | 117 | Uppercase O
P | 80 | 50 | 120 | Uppercase P
Q | 81 | 51 | 121 | Uppercase Q
R | 82 | 52 | 122 | Uppercase R
S | 83 | 53 | 123 | Uppercase S
T | 84 | 54 | 124 | Uppercase T
U | 85 | 55 | 125 | Uppercase U
V | 86 | 56 | 126 | Uppercase V
W | 87 | 57 | 127 | Uppercase W
X | 88 | 58 | 130 | Uppercase X
Y | 89 | 59 | 131 | Uppercase Y
Z | 90 | 5a | 132 | Uppercase Z
[ | 91 | 5b | 133 | Opening square bracket
\ | 92 | 5c | 134 | Reverse slant (Backslash)
] | 93 | 5d | 135 | Closing square bracket
^ | 94 | 5e | 136 | Caret (Circumflex)
_ | 95 | 5f | 137 | Underscore
` | 96 | 60 | 140 | Opening single quote
a | 97 | 61 | 141 | Lowercase a
b | 98 | 62 | 142 | Lowercase b
c | 99 | 63 | 143 | Lowercase c
d | 100 | 64 | 144 | Lowercase d
e | 101 | 65 | 145 | Lowercase e
f | 102 | 66 | 146 | Lowercase f
g | 103 | 67 | 147 | Lowercase g
h | 104 | 68 | 150 | Lowercase h
i | 105 | 69 | 151 | Lowercase i
j | 106 | 6a | 152 | Lowercase j
k | 107 | 6b | 153 | Lowercase k
l | 108 | 6c | 154 | Lowercase l
m | 109 | 6d | 155 | Lowercase m
n | 110 | 6e | 156 | Lowercase n
o | 111 | 6f | 157 | Lowercase o
p | 112 | 70 | 160 | Lowercase p
q | 113 | 71 | 161 | Lowercase q
r | 114 | 72 | 162 | Lowercase r
s | 115 | 73 | 163 | Lowercase s
t | 116 | 74 | 164 | Lowercase t
u | 117 | 75 | 165 | Lowercase u
v | 118 | 76 | 166 | Lowercase v
w | 119 | 77 | 167 | Lowercase w
x | 120 | 78 | 170 | Lowercase x
y | 121 | 79 | 171 | Lowercase y
z | 122 | 7a | 172 | Lowercase z
{ | 123 | 7b | 173 | Opening curly brace
| | 124 | 7c | 174 | Vertical line
} | 125 | 7d | 175 | Closing curly brace
~ | 126 | 7e | 176 | Tilde (approximate)
 | 127 | 7f | 177 | Delete (rubout), cross-hatch box

Extended Character Set (ANSI)

Char | Dec | Hex | Oct | Description
€ | 128 | 80 | 200 |
 | 129 | 81 | 201 | Note: does not display in this compiled html help file
‚ | 130 | 82 | 202 |
ƒ | 131 | 83 | 203 |
„ | 132 | 84 | 204 |
… | 133 | 85 | 205 |
† | 134 | 86 | 206 |
‡ | 135 | 87 | 207 |
ˆ | 136 | 88 | 210 |
‰ | 137 | 89 | 211 |
Š | 138 | 8A | 212 |
‹ | 139 | 8B | 213 |
Œ | 140 | 8C | 214 |
 | 141 | 8D | 215 | Note: does not display in this compiled html help file
Ž | 142 | 8E | 216 |
 | 143 | 8F | 217 | Note: does not display in this compiled html help file
� | 144 | 90 | 220 | Note: does not display in this compiled html help file
‘ | 145 | 91 | 221 |
’ | 146 | 92 | 222 |
“ | 147 | 93 | 223 |
” | 148 | 94 | 224 |
• | 149 | 95 | 225 |
– | 150 | 96 | 226 |
— | 151 | 97 | 227 |
˜ | 152 | 98 | 230 |
™ | 153 | 99 | 231 |
š | 154 | 9A | 232 |
› | 155 | 9B | 233 |
œ | 156 | 9C | 234 |
 | 157 | 9D | 235 | Note: does not display in this compiled html help file
ž | 158 | 9E | 236 |
Ÿ | 159 | 9F | 237 |
 | 160 | A0 | 240 |
¡ | 161 | A1 | 241 |
¢ | 162 | A2 | 242 |
£ | 163 | A3 | 243 |
¤ | 164 | A4 | 244 |
¥ | 165 | A5 | 245 |
¦ | 166 | A6 | 246 |
§ | 167 | A7 | 247 |
¨ | 168 | A8 | 250 |
© | 169 | A9 | 251 |
ª | 170 | AA | 252 |
« | 171 | AB | 253 |
¬ | 172 | AC | 254 |
 | 173 | AD | 255 | Note: may not display in this compiled html help file
® | 174 | AE | 256 |
¯ | 175 | AF | 257 |
° | 176 | B0 | 260 |
± | 177 | B1 | 261 |
² | 178 | B2 | 262 |
³ | 179 | B3 | 263 |
´ | 180 | B4 | 264 |
µ | 181 | B5 | 265 |
¶ | 182 | B6 | 266 |
· | 183 | B7 | 267 |
¸ | 184 | B8 | 270 |
¹ | 185 | B9 | 271 |
º | 186 | BA | 272 |
» | 187 | BB | 273 |
¼ | 188 | BC | 274 |
½ | 189 | BD | 275 |
¾ | 190 | BE | 276 |
¿ | 191 | BF | 277 |
À | 192 | C0 | 300 |
Á | 193 | C1 | 301 |
Â | 194 | C2 | 302 |
Ã | 195 | C3 | 303 |
Ä | 196 | C4 | 304 |
Å | 197 | C5 | 305 |
Æ | 198 | C6 | 306 |
Ç | 199 | C7 | 307 |
È | 200 | C8 | 310 |
É | 201 | C9 | 311 |
Ê | 202 | CA | 312 |
Ë | 203 | CB | 313 |
Ì | 204 | CC | 314 |
Í | 205 | CD | 315 |
Î | 206 | CE | 316 |
Ï | 207 | CF | 317 |
Ð | 208 | D0 | 320 |
Ñ | 209 | D1 | 321 |
Ò | 210 | D2 | 322 |
Ó | 211 | D3 | 323 |
Ô | 212 | D4 | 324 |
Õ | 213 | D5 | 325 |
Ö | 214 | D6 | 326 |
× | 215 | D7 | 327 |
Ø | 216 | D8 | 330 |
Ù | 217 | D9 | 331 |
Ú | 218 | DA | 332 |
Û | 219 | DB | 333 |
Ü | 220 | DC | 334 |
Ý | 221 | DD | 335 |
Þ | 222 | DE | 336 |
ß | 223 | DF | 337 |
à | 224 | E0 | 340 |
á | 225 | E1 | 341 |
â | 226 | E2 | 342 |
ã | 227 | E3 | 343 |
ä | 228 | E4 | 344 |
å | 229 | E5 | 345 |
æ | 230 | E6 | 346 |
ç | 231 | E7 | 347 |
è | 232 | E8 | 350 |
é | 233 | E9 | 351 |
ê | 234 | EA | 352 |
ë | 235 | EB | 353 |
ì | 236 | EC | 354 |
í | 237 | ED | 355 |
î | 238 | EE | 356 |
ï | 239 | EF | 357 |
ð | 240 | F0 | 360 |
ñ | 241 | F1 | 361 |
ò | 242 | F2 | 362 |
ó | 243 | F3 | 363 |
ô | 244 | F4 | 364 |
õ | 245 | F5 | 365 |
ö | 246 | F6 | 366 |
÷ | 247 | F7 | 367 |
ø | 248 | F8 | 370 |
ù | 249 | F9 | 371 |
ú | 250 | FA | 372 |
û | 251 | FB | 373 |
ü | 252 | FC | 374 |
ý | 253 | FD | 375 |
þ | 254 | FE | 376 |
ÿ | 255 | FF | 377 |


CLSID List

For use with FileOpenDialog, FileSaveDialog, or FileSelectFolder

List taken from Registry Guide for Windows at WinGuides Network

Note: Not all values may work as parameters for the AutoIt functions listed above.

Example: FileSelectFolder ("Choose a folder.", "::{00000000-1080-F9E5-6311-4162E05A6BEE}", 1)

Folder | Value for the File___'s directory parameter
Administrative Tools | "::{D20EA4E1-3957-11d2-A40B-0C5020524153}"
Briefcase | "::{85BBD920-42A0-1069-A2E4-08002B30309D}"
Control Panel | "::{21EC2020-3AEA-1069-A2DD-08002b30309d}"
Fonts | "::{D20EA4E1-3957-11d2-A40B-0C5020524152}"
History | "::{FF393560-C2A7-11CF-BFF4-444553540000}"
Inbox | "::{00020D75-0000-0000-C000-000000000046}"
Microsoft Network | "::{00028B00-0000-0000-C000-000000000046}"
My Computer | "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
My Documents | "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"
My Network Places | "::{208D2C60-3AEA-1069-A2D7-08002B30309D}"
Network Computers | "::{1f4de370-d627-11d1-ba4f-00a0c91eedba}"
Network Connections | "::{7007ACC7-3202-11D1-AAD2-00805FC1270E}"
Printers and Faxes | "::{2227A280-3AEA-1069-A2DE-08002B30309D}"
Programs Folder | "::{7be9d83c-a729-4d97-b5a7-1b7313c39e0a}"
Recycle Bin | "::{645FF040-5081-101B-9F08-00AA002F954E}"
Scanners and Cameras | "::{E211B736-43FD-11D1-9EFB-0000F8757FCD}"
Scheduled Tasks | "::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}"
Start Menu Folder | "::{48e7caab-b918-4e58-a94d-505519c795dc}"
Temporary Internet Files | "::{7BD29E00-76C1-11CF-9DD0-00A0C9034933}"
Web Folders | "::{BDEADF00-C265-11d0-BCED-00A0C90AB50F}"


GUI Control Styles

This page contains a list of the common and extended styles that can be used with windows, and also specific styles that can be used with controls. These styles are used in the "style" and/or "exStyle" parameters of many of the GUI functions. To use these values you must #include the file specified at the top of each section.

Note: The "Value" is given just for reference, you should always use the "name" of the style in order to keep your scripts readable.

Common Styles | Value | Description
 |  | #include <WindowsConstants.au3>
Default/forced for GUI creation |  | $GUI_SS_DEFAULT_GUI see GUICreate function.
$WS_BORDER | 0x00800000 | Creates a window that has a thin-line border.
$WS_POPUP | 0x80000000 | Creates a pop-up window. This style cannot be used with the WS_CHILD style.
$WS_CAPTION | 0x00C00000 | Creates a window that has a title bar (includes the WS_BORDER style)
$WS_CLIPCHILDREN | 0x02000000 | Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.
$WS_CLIPSIBLINGS | 0x04000000 | Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.
$WS_DISABLED | 0x08000000 | Creates a window that is initially disabled.
$WS_DLGFRAME | 0x00400000 | Creates a window that has a border of a style typically used with dialog boxes.
$WS_HSCROLL | 0x00100000 | Creates a window that has a horizontal scroll bar.
$WS_MAXIMIZE | 0x01000000 | Creates a window that is initially maximized.
$WS_MAXIMIZEBOX | 0x00010000 | Creates a window that has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
$WS_MINIMIZE | 0x20000000 | Creates a window that is initially minimized.
$WS_MINIMIZEBOX | 0x00020000 | Creates a window that has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
$WS_OVERLAPPED | 0x00000000 | Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style
$WS_OVERLAPPEDWINDOW | 0x00CF0000 | Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style.
$WS_POPUPWINDOW | 0x80880000 | Creates a pop-up window with WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.
$WS_SIZEBOX | 0x00040000 | Creates a window that has a sizing border. Same as the WS_THICKFRAME style.
$WS_SYSMENU | 0x00080000 | Creates a window that has a window menu on its title bar. The WS_CAPTION style must also be specified.
$WS_THICKFRAME | 0x00040000 | Creates a window that has a sizing border. Same as the WS_SIZEBOX style
$WS_VSCROLL | 0x00200000 | Creates a window that has a vertical scroll bar.
$WS_VISIBLE | 0x10000000 | Creates a window that is initially visible.
$WS_CHILD | 0x40000000 | Creates a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.
$WS_GROUP | 0x00020000 | Specifies the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style.
$WS_TABSTOP | 0x00010000 | Turns the control into a tab stop, which enables the user to select the control by tabbing through the controls in a dialog box.
$DS_MODALFRAME | 0x00000080 | Creates a dialog box with a modal dialog-box frame that can be combined with a title bar and window menu by specifying the WS_CAPTION and WS_SYSMENU styles.
$DS_SETFOREGROUND | 0x00000200 | This style is useful for modal dialog boxes that require immediate attention from the user regardless of whether the owner window is the foreground window.
$DS_CONTEXTHELP | 0x00002000 | Includes a question mark in the title bar of the dialog box. Cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles. Same as WS_EX_CONTEXTHELP extended style.

Common Extended Styles | Value | Description
 |  | #include <WindowsConstants.au3>
$WS_EX_ACCEPTFILES | 0x00000010 | Allow an edit or input control within the created GUI window to receive filenames via drag and drop. The control must have also the $GUI_DROPACCEPTED state set by GUICtrlSetState.
$WS_EX_APPWINDOW | 0x00040000 | Forces a top-level window onto the taskbar when the window is visible.
$WS_EX_COMPOSITED | 0x02000000 | Windows XP or above: Paints all descendants of a window in bottom-to-top painting order using double-buffering.
$WS_EX_CLIENTEDGE | 0x00000200 | Specifies that a window has a border with a sunken edge.
$WS_EX_CONTEXTHELP | 0x00000400 | Includes a question mark in the title bar of the window. Cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX
$WS_EX_DLGMODALFRAME | 0x00000001 | Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter.
$WS_EX_MDICHILD | 0x00000040 | Create a child window that will be moved with its parent.(simulation of a MDI window maximize/minimize are not simulated).
$WS_EX_OVERLAPPEDWINDOW | 0x00000300 | Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.
$WS_EX_STATICEDGE | 0x00020000 | Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.
$WS_EX_TOPMOST | 0x00000008 | Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated.
$WS_EX_TRANSPARENT | 0x00000020 | The window appears transparent because the bits of underlying sibling windows have already been painted.
$WS_EX_TOOLWINDOW | 0x00000080 | Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog box that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by typing ALT+SPACE.
$WS_EX_WINDOWEDGE | 0x00000100 | Specifies that a window has a border with a raised edge.
$WS_EX_LAYERED | 0x00080000 | Creates a layered window. Note that this cannot be used for child windows.
$GUI_WS_EX_PARENTDRAG | 0x00100000 | Allow the label or pic control to be used as the title bar to drag the whole the parent window.

Checkbox Styles | Value | Description
 |  | #include <ButtonConstants.au3>
Default/forced |  | see GUICtrlCreateCheckbox function.
$BS_3STATE | 0x0005 | Creates a check box in which the box can be unavailable as well as selected or cleared. Use the unavailable state to show that the state of the check box is not determined.
$BS_AUTO3STATE | 0x0006 | Creates a three-state check box in which the state cycles through selected, unavailable, and cleared each time the user selects the check box.
$BS_AUTOCHECKBOX | 0x0003 | Creates a check box in which the check state switches between selected and cleared each time the user selects the check box.
$BS_CHECKBOX | 0x0002 | Creates a small, empty check box with a label displayed to the right of it. To display the text to the left of the check box, combine this flag with the BS_RIGHTBUTTON style.
$BS_LEFT | 0x0100 | Left-aligns the text in the button rectangle on the right side of the check box.
$BS_PUSHLIKE | 0x1000 | Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.
$BS_RIGHT | 0x0200 | Right-aligns text in the button rectangle on the right side of the check box.
$BS_RIGHTBUTTON | 0x0020 | Positions a check box square on the right side of the button rectangle.
$BS_GROUPBOX | 0x0007 | Creates a rectangle in which other buttons can be grouped. Any text associated with this style is displayed in the rectangle’s upper-left corner.
$BS_AUTORADIOBUTTON | 0x0009 | Same as a radio button, except that when the user selects it, the button automatically highlights itself and removes the selection from any other radio buttons with the same style in the same group.

Push Button Styles | Value | Description
 |  | #include <ButtonConstants.au3>
Default/forced |  | see GUICtrlCreateButton, GUICtrlCreateCheckbox, GUICtrlCreateRadio functions.
$BS_BOTTOM | 0x0800 | Places the text at the bottom of the button rectangle.
$BS_CENTER | 0x0300 | Centers the text horizontally in the button rectangle.
$BS_DEFPUSHBUTTON | 0x0001 | Creates a push button with a heavy black border. If the button is in a dialog box, the user can select the button by pressing the ENTER key, even when the button does not have the input focus. This style is useful for enabling the user to quickly select the most likely option, or default.
$BS_MULTILINE | 0x2000 | Wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle.
$BS_TOP | 0x0400 | Places text at the top of the button rectangle.
$BS_VCENTER | 0x0C00 | Vertically centers text in the button rectangle.
$BS_ICON | 0x0040 | Specifies that the button displays an icon.
$BS_BITMAP | 0x0080 | Specifies that the button displays a bitmap.
$BS_FLAT | 0x8000 | Specifies that the button is two-dimensional; it does not use the default shading to create a 3-D image.
$BS_NOTIFY | 0x4000 | Enables a button to send BN_KILLFOCUS and BN_SETFOCUS notification messages to its parent window. Note that buttons send the BN_CLICKED notification message regardless of whether it has this style. To get BN_DBLCLK notification messages, the button must have the BS_RADIOBUTTON or BS_OWNERDRAW style.

Combo Styles | Value | Description
 |  | #include <ComboConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_COMBO see GUICtrlCreateCombo function.
$CBS_AUTOHSCROLL | 0x0040 | Automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is enabled.
$CBS_DISABLENOSCROLL | 0x0800 | Shows a disabled vertical scroll bar in the list box when the box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items.
$CBS_DROPDOWN | 0x0002 | Displays only the edit control by default. The user can display the list box by selecting an icon next to the edit control.
$CBS_DROPDOWNLIST | 0x0003 | Displays a static text field that displays the current selection in the list box.
$CBS_LOWERCASE | 0x4000 | Converts to lowercase any uppercase characters that are typed into the edit control of a combo box.
$CBS_NOINTEGRALHEIGHT | 0x0400 | Specifies that the combo box will be exactly the size specified by the application when it created the combo box. Usually, Windows CE sizes a combo box so that it does not display partial items.
$CBS_OEMCONVERT | 0x0080 | Converts text typed in the combo box edit control from the Windows CE character set to the OEM character set and then back to the Windows CE set. This style is most useful for combo boxes that contain file names. It applies only to combo boxes created with the CBS_DROPDOWN style.
$CBS_SIMPLE | 0x0001 | Displays the list box at all times. The current selection in the list box is displayed in the edit control.
$CBS_SORT | 0x0100 | Sorts strings that are typed into the list box.
$CBS_UPPERCASE | 0x2000 | Converts to uppercase any lowercase characters that are typed into the edit control of a combo box.

List Styles | Value | Description
 |  | #include <ListboxConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_LIST see GUICtrlCreateList function.
$LBS_DISABLENOSCROLL | 0x1000 | Shows a disabled vertical scroll bar for the list box when the box does not contain enough items to scroll. If you do not specify this style, the scroll bar is hidden when the list box does not contain enough items.
$LBS_NOINTEGRALHEIGHT | 0x0100 | Specifies that the list box will be exactly the size specified by the application when it created the list box.
$LBS_NOSEL | 0x4000 | Specifies that the user can view list box strings but cannot select them.
$LBS_NOTIFY | 0x0001 | Notifies the parent window when the user taps or double-taps a string in the list box.
$LBS_SORT | 0x0002 | Sorts strings in the list box alphabetically.
$LBS_STANDARD | 0xA00003 | Sorts strings in the list box alphabetically. The parent window receives an input message when the user taps or double-taps a string. The list box has borders on all sides. (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
$LBS_USETABSTOPS | 0x0080 | Enables a list box to recognize and expand tab characters when drawing its strings. The default tab positions are 32 dialog box units. A dialog box unit is equal to one-fourth of the current dialog box base-width unit.

Edit/Input Styles | Value | Description
 |  | #include <EditConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_EDIT, $GUI_SS_DEFAULT_INPUT see GUICtrlCreateEdit or GUICtrlCreateInput function.
$ES_AUTOHSCROLL | 0x0080 | Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to the zero position.
$ES_AUTOVSCROLL | 0x0040 | Scrolls text up one page when the user presses the ENTER key on the last line.
$ES_CENTER | 0x0001 | Centers text in a multiline edit control.
$ES_LOWERCASE | 0x0010 | Converts all characters to lowercase as they are typed into the edit control.
$ES_NOHIDESEL | 0x0100 | Negates the default behavior for an edit control. The default behavior hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. If you specify ES_NOHIDESEL, the selected text is inverted, even if the control does not have the focus.
$ES_NUMBER | 0x2000 | Accepts into the edit control only digits to be typed.
$ES_OEMCONVERT | 0x0400 | This style is most useful for edit controls that contain file names.
$ES_MULTILINE | 0x0004 | Designates a multiline edit control. The default is a single-line edit control.
$ES_PASSWORD | 0x0020 | Displays an asterisk (*) for each character that is typed into the edit control.
$ES_READONLY | 0x0800 | Prevents the user from typing or editing text in the edit control.
$ES_RIGHT | 0x0002 | Right-aligns text in a multiline edit control.
$ES_UPPERCASE | 0x0008 | Converts all characters to uppercase as they are typed into the edit control.
$ES_WANTRETURN | 0x1000 | Specifies that a carriage return be inserted when the user presses the ENTER key while typing text into a multiline edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box’s default push button. This style has no effect on a single-line edit control.

Progress Bar Styles | Value | Description
 |  | #include <ProgressConstants.au3>
$PBS_SMOOTH | 0x01 | Displays progress status in a smooth scrolling bar instead of the default segmented bar.
$PBS_VERTICAL | 0x04 | Displays progress status vertically, from bottom to top.

Up-down Styles | Value | Description
 |  | #include <UpdownConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_UPDOWN see GUICtrlCreateUpdown function.
$UDS_ALIGNLEFT | 0x08 | Positions the up-down control next to the left edge of the buddy window. The buddy window is moved to the right and its width is decreased to accommodate the width of the up-down control.
$UDS_ALIGNRIGHT | 0x04 | Positions the up-down control next to the right edge of the buddy window. The width of the buddy window is decreased to accommodate the width of the up-down control.
$UDS_ARROWKEYS | 0x20 | Causes the up-down control to process the UP ARROW and DOWN ARROW keys on the keyboard.
$UDS_HORZ | 0x40 | Causes the up-down control’s arrows to point left and right instead of up and down.
$UDS_NOTHOUSANDS | 0x80 | Prevents insertion of a thousands separator between every three decimal positions.
$UDS_WRAP | 0x01 | Causes the position to wrap if it is incremented or decremented beyond the end or beginning of the range.

Label/Static Styles | Value | Description
 |  | #include <StaticConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_LABEL, $GUI_SS_DEFAULT_ICON, $GUI_SS_DEFAULT_PIC see GUICtrlCreateLabel, GUICtrlCreateIcon, GUICtrlCreatePic functions.
$SS_BLACKFRAME | 0x07 | Specifies a box with a frame drawn in the same color as the window frames. This color is black in the default color scheme.
$SS_BLACKRECT | 0x04 | Specifies a rectangle filled with the current window frame color. This color is black in the default color scheme.
$SS_CENTER | 0x01 | Specifies a simple rectangle and centers the error value text in the rectangle. The control automatically wraps words that extend past the end of a line to the beginning of the next centered line.
$SS_CENTERIMAGE | 0x0200 | Specifies that the midpoint of a static control with the SS_BITMAP style will remain fixed when you resize the control. The four sides are adjusted to accommodate a new bitmap. If the bitmap is smaller than the control’s client area, the rest of the client area is filled with the color of the pixel in the upper-left corner of the bitmap. It can be used with static control having only one line of text. Microsoft Windows XP: This style bit no longer results in unused portions of the control being filled with the color of the top left pixel of the bitmap or icon. Unused portions of the control will remain the background color.
$SS_ETCHEDFRAME | 0x12 | Draws the frame of the static control using the EDGE_ETCHED edge style.
$SS_ETCHEDHORZ | 0x10 | Draws the top and bottom edges of the static control using the EDGE_ETCHED edge style.
$SS_ETCHEDVERT | 0x11 | Draws the left and right edges of the static control using the EDGE_ETCHED edge style.
$SS_GRAYFRAME | 0x08 | Specifies a box with a frame drawn with the same color as the screen background (desktop). This color is gray in the default color scheme
$SS_GRAYRECT | 0x05 | Specifies a rectangle filled with the current screen background color. This color is gray in the default color scheme.
$SS_LEFT | 0x0000 | Specifies a simple rectangle and left-aligns the text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next left-aligned line. Words that are longer than the width of the control are truncated.
$SS_LEFTNOWORDWRAP | 0x0C | Specifies a rectangle and left-aligns the text in the rectangle. Tabs are expanded, but words are not wrapped. Text that extends past the end of a line is clipped.
$SS_NOPREFIX | 0x80 | Prevents interpretation of any ampersand (&) characters in the control’s text as accelerator prefix characters. An application can combine SS_NOPREFIX with other styles by using the bitwise OR (|) operator. This can be useful when file names or other strings that might contain an ampersand (&) must be displayed within a static control in a dialog box.
$SS_NOTIFY | 0x0100 | Sends the parent window the STN_CLICKED notification when the user clicks the control.
$SS_RIGHT | 0x0002 | Specifies a rectangle and right-aligns the specified text in the rectangle.
$SS_RIGHTJUST | 0x0400 | Specifies that the lower right corner of a static control with the SS_BITMAP or SS_ICON style is to remain fixed when the control is resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon.
$SS_SIMPLE | 0x0B | Specifies a simple rectangle and displays a single line of left-aligned text in the rectangle. The text line cannot be shortened or altered in any way. Also, if the control is disabled, the control does not gray its text.
$SS_SUNKEN | 0x1000 | Draws a half-sunken border around a static control.
$SS_WHITEFRAME | 0x09 | Specifies a box with a frame drawn with the same color as the window background. This color is white in the default color scheme.
$SS_WHITERECT | 0x06 | Specifies a rectangle filled with the current window background color. This color is white in the default color scheme.

Tab Styles | Value | Description
 |  | #include <TabConstants.au3>
Default/forced |  | see GUICtrlCreateTab function.
$TCS_SCROLLOPPOSITE | 0x0001 | Unneeded tabs scroll to the opposite side of the control when a tab is selected.
$TCS_BOTTOM | 0x0002 | Tabs appear at the bottom of the control. This value equals TCS_RIGHT. This style is not supported if you use ComCtl32.dll version 6.
$TCS_RIGHT | 0x0002 | Tabs appear vertically on the right side of controls that use the TCS_VERTICAL style. This value equals TCS_BOTTOM. This style is not supported if you use visual styles.
$TCS_MULTISELECT | 0x0004 | Multiple tabs can be selected by holding down CTRL when clicking. This style must be used with the TCS_BUTTONS style.
$TCS_FLATBUTTONS | 0x0008 | Selected tabs appear as being indented into the background while other tabs appear as being on the same plane as the background. This style only affects tab controls with the TCS_BUTTONS style.
$TCS_FORCEICONLEFT | 0x0010 | Icons are aligned with the left edge of each fixed-width tab. This style can only be used with the TCS_FIXEDWIDTH style.
$TCS_FORCELABELLEFT | 0x0020 | Labels are aligned with the left edge of each fixed-width tab; that is, the label is displayed immediately to the right of the icon instead of being centered. This style can only be used with the TCS_FIXEDWIDTH style, and it implies the TCS_FORCEICONLEFT style.
$TCS_HOTTRACK | 0x0040 | Items under the pointer are automatically highlighted
$TCS_VERTICAL | 0x0080 | Tabs appear at the left side of the control, with tab text displayed vertically. This style is valid only when used with the TCS_MULTILINE style. To make tabs appear on the right side of the control, also use the TCS_RIGHT style. This style is not supported if you use ComCtl32.dll version 6.
$TCS_TABS | 0x0000 | Tabs appear as tabs, and a border is drawn around the display area. This style is the default.
$TCS_BUTTONS | 0x0100 | Tabs appear as buttons, and no border is drawn around the display area.
$TCS_SINGLELINE | 0x0000 | Only one row of tabs is displayed. The user can scroll to see more tabs, if necessary. This style is the default.
$TCS_MULTILINE | 0x0200 | Multiple rows of tabs are displayed, if necessary, so all tabs are visible at once.
$TCS_RIGHTJUSTIFY | 0x0000 | The width of each tab is increased, if necessary, so that each row of tabs fills the entire width of the tab control. This window style is ignored unless the TCS_MULTILINE style is also specified.
$TCS_FIXEDWIDTH | 0x0400 | All tabs are the same width. This style cannot be combined with the TCS_RIGHTJUSTIFY style.
$TCS_RAGGEDRIGHT | 0x0800 | Rows of tabs will not be stretched to fill the entire width of the control. This style is the default.
$TCS_FOCUSONBUTTONDOWN | 0x1000 | The tab control receives the input focus when clicked.
$TCS_OWNERDRAWFIXED | 0x2000 | The parent window is responsible for drawing tabs.
$TCS_TOOLTIPS | 0x4000 | The tab control has a tooltip control associated with it.
$TCS_FOCUSNEVER | 0x8000 | The tab control does not receive the input focus when clicked.

Avi Clip Styles | Value | Description
 |  | #include <AVIConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_AVI see GUICtrlCreateAvi function.
$ACS_AUTOPLAY | 0x04 | Starts playing the animation as soon as the AVI clip is opened.
$ACS_CENTER | 0x01 | Centers the animation in the animation control's window.
$ACS_TRANSPARENT | 0x02 | Allows you to match an animation's background color to that of the underlying window, creating a "transparent" background. (Default value)
$ACS_NONTRANSPARENT | 0x10 | To override default ACS_TRANSPARENT

Date Styles | Value | Description
 |  | #include <DateTimeConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_DATE see GUICtrlCreateDate function.
$DTS_UPDOWN | 0x01 | Places an up-down control to the right of a DTP control to modify time values. This style can be used instead of the drop-down month calendar, which is the default style.
$DTS_SHOWNONE | 0x02 | Enables the control to accept “no date” as a valid selection state.
$DTS_LONGDATEFORMAT | 0x04 | Displays the date in long format. The default format string for this style is defined by LOCALE_SLONGDATEFORMAT, which produces output like “Friday, April 19, 1998.”
$DTS_TIMEFORMAT | 0x09 | Displays the time. The default format string for this style is defined by LOCALE_STIMEFORMAT, which produces output like “5:31:42 PM.”
$DTS_RIGHTALIGN | 0x20 | The drop-down month calendar will be right-aligned with the control instead of left-aligned, which is the default.
$DTS_SHORTDATEFORMAT | 0x00 | Displays the date in short format. The default format string for this style is defined by LOCALE_SSHORTDATE, which produces output like "4/19/96".

MonthCal Styles | Value | Description
 |  | #include <DateTimeConstants.au3>
Default/forced |  | see GUICtrlCreateMonthCal function.
$MCS_NOTODAY | 0x10 | The month calendar control will not display the "today" date at the bottom of the control.
$MCS_NOTODAYCIRCLE | 0x08 | The month calendar control will not circle the "today" date.
$MCS_WEEKNUMBERS | 0x04 | The month calendar control will display week numbers (1-52) to the left of each row of days. Week 1 is defined as the first week that contains at least four days.

TreeView Styles | Value | Description
 |  | #include <TreeviewConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_TREEVIEW see GUICtrlCreateTreeView function.
$TVS_HASBUTTONS | 0x0001 | Displays plus (+) and minus (-) buttons next to parent items. The user clicks the buttons to expand or collapse a parent item's list of child items. To include buttons with items at the root of the tree view, TVS_LINESATROOT must also be specified.
$TVS_HASLINES | 0x0002 | Uses lines to show the hierarchy of items.
$TVS_LINESATROOT | 0x0004 | Uses lines to link items at the root of the tree view control. This value is ignored if TVS_HASLINES is not also specified.
$TVS_DISABLEDRAGDROP | 0x0010 | Prevents the tree view control from sending TVN_BEGINDRAG notification messages.
$TVS_SHOWSELALWAYS | 0x0020 | Causes a selected item to remain selected when the tree view control loses focus.
$TVS_RTLREADING | 0x0040 | Normal windows display text left-to-right (LTR). Windows can be mirrored to display languages such as Hebrew or Arabic that read right-to-left (RTL). Normally, tree view text will be displayed in same direction as the the text in its parent window. If TVS_RTLREADING is set, tree view text will read in the opposite direction from the text in the parent window.
$TVS_NOTOOLTIPS | 0x0080 | The tree view control does not support tooltips.
$TVS_CHECKBOXES | 0x0100 | Enables check boxes for items in a tree-view control. Once a tree-view control is created with this style, the style cannot be removed. Instead, you must destroy the control and create a new one in its place.
$TVS_TRACKSELECT | 0x0200 | Enables hot tracking in a tree view control.
$TVS_SINGLEEXPAND | 0x0400 | When this style is enabled, changing the selection in the tree view will automatically cause the item being selected to expand and the item being unselected to collapse. If the mouse is used to single-click the selected item and that item is closed, it will be expanded. If the user holds the CTRL key down while selecting an item, the item being unselected will not be collapsed.
$TVS_FULLROWSELECT | 0x1000 | Enables full-row selection in the tree view. The entire row of the selected item is highlighted, and clicking anywhere on an item's row will cause it to be selected. This style cannot be used in conjunction with the TVS_HASLINES style.
$TVS_NOSCROLL | 0x2000 | Disables horizontal scrolling in the control. The control will not display any horizontal scroll bars.
$TVS_NONEVENHEIGHT | 0x4000 | The height of the items can be set to an odd height with the TVM_SETITEMHEIGHT message. By default, the height of items must be an even value.

Slider Styles | Value | Description
 |  | #include <SliderConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_SLIDER see GUICtrlCreateSlider function.
$TBS_AUTOTICKS | 0x0001 | Adds tick marks when you set the range on the trackbar by using the TBM_SETRANGE message.
$TBS_BOTH | 0x0008 | Places ticks on both sides of the trackbar.
$TBS_BOTTOM | 0x0000 | Places ticks on the bottom of a horizontal trackbar.
$TBS_HORZ | 0x0000 | Specifies a horizontal trackbar. This is the default.
$TBS_VERT | 0x0002 | Places ticks on the left side of a vertical trackbar.
$TBS_NOTHUMB | 0x0080 | Specifies that the trackbar has no slider.
$TBS_NOTICKS | 0x0010 | Specifies that no ticks are placed on the trackbar.
$TBS_LEFT | 0x0004 | Places ticks on the left side of a vertical trackbar.
$TBS_RIGHT | 0x0000 | Places ticks on the right side of a vertical trackbar.
$TBS_TOP | 0x0004 | Places ticks on the top of a horizontal trackbar.

ListView Styles | Value | Description
 |  | #include <ListviewConstants.au3>
Default/forced |  | $GUI_SS_DEFAULT_LISTVIEW see GUICtrlCreateListView function.
$LVS_ICON | 0x0000 | This style specifies icon view.
$LVS_REPORT | 0x0001 | This style specifies report view.
$LVS_SMALLICON | 0x0002 | This style specifies small icon view.
$LVS_LIST | 0x0003 | This style specifies list view.
$LVS_EDITLABELS | 0x0200 | Item text can be edited in place.
$LVS_NOCOLUMNHEADER | 0x4000 | Column headers are not displayed in report view. By default, columns have headers in report view.
$LVS_NOSORTHEADER | 0x8000 | Column headers do not work like buttons. This style can be used if clicking a column header in report view does not carry out an action, such as sorting.
$LVS_SINGLESEL | 0x0004 | Only one item at a time can be selected.
$LVS_SHOWSELALWAYS | 0x0008 | The selection, if any, is always shown, even if the control does not have the focus.
$LVS_SORTASCENDING | 0x0010 | Item indices are sorted based on item text in ascending order.
$LVS_SORTDESCENDING | 0x0020 | Item indices are sorted based on item text in descending order.
$LVS_NOLABELWRAP | 0x0080 | Item text is displayed on a single line in icon view. By default, item text may wrap in icon view.

ListView Extended Styles | Value | Description
 |  | #include <ListviewConstants.au3>
$LVS_EX_FULLROWSELECT | 0x00000020 | When an item is selected, the item and all its subitems are highlighted.
$LVS_EX_GRIDLINES | 0x00000001 | Displays gridlines around items and subitems.
$LVS_EX_HEADERDRAGDROP | 0x00000010 | Enables drag-and-drop reordering of columns in a list view control.
$LVS_EX_TRACKSELECT | 0x00000008 | Enables hot-track selection in a list view control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time
$LVS_EX_CHECKBOXES | 0x00000004 | Enables check boxes for items in a list view control.
$LVS_EX_BORDERSELECT | 0x00008000 | If this style is set, when an item is selected the border color of the item changes rather than the item being highlighted.
$LVS_EX_DOUBLEBUFFER | 0x00010000 |
$LVS_EX_FLATSB | 0x00000100 | Enables flat scroll bars in the list view.
$LVS_EX_MULTIWORKAREAS | 0x00002000 |
$LVS_EX_SNAPTOGRID | 0x00080000 |
$LVS_EX_SUBITEMIMAGES | 0x00000002 | Allows images to be displayed for subitems.


Language Codes

@OSLang codes

Possible return values (strings) of @OSLang

List was generated from Windows 2000 - List of Locale IDs and Language Groups

Note: Codes that contain letters could possible have the letters in uppercase.

Code | Meaning
0436 | Afrikaans
041c | Albanian
0401 | Arabic_Saudi_Arabia
0801 | Arabic_Iraq
0c01 | Arabic_Egypt
1001 | Arabic_Libya
1401 | Arabic_Algeria
1801 | Arabic_Morocco
1c01 | Arabic_Tunisia
2001 | Arabic_Oman
2401 | Arabic_Yemen
2801 | Arabic_Syria
2c01 | Arabic_Jordan
3001 | Arabic_Lebanon
3401 | Arabic_Kuwait
3801 | Arabic_UAE
3c01 | Arabic_Bahrain
4001 | Arabic_Qatar
042b | Armenian
042c | Azeri_Latin
082c | Azeri_Cyrillic
042d | Basque
0423 | Belarusian
0402 | Bulgarian
0403 | Catalan
0404 | Chinese_Taiwan
0804 | Chinese_PRC
0c04 | Chinese_Hong_Kong
1004 | Chinese_Singapore
1404 | Chinese_Macau
041a | Croatian
0405 | Czech
0406 | Danish
0413 | Dutch_Standard
0813 | Dutch_Belgian
0409 | English_United_States
0809 | English_United_Kingdom
0c09 | English_Australian
1009 | English_Canadian
1409 | English_New_Zealand
1809 | English_Irish
1c09 | English_South_Africa
2009 | English_Jamaica
2409 | English_Caribbean
2809 | English_Belize
2c09 | English_Trinidad
3009 | English_Zimbabwe
3409 | English_Philippines
0425 | Estonian
0438 | Faeroese
0429 | Farsi
040b | Finnish
040c | French_Standard
080c | French_Belgian
0c0c | French_Canadian
100c | French_Swiss
140c | French_Luxembourg
180c | French_Monaco
0437 | Georgian
0407 | German_Standard
0807 | German_Swiss
0c07 | German_Austrian
1007 | German_Luxembourg
1407 | German_Liechtenstei
408 | Greek
040d | Hebrew
0439 | Hindi
040e | Hungarian
040f | Icelandic
0421 | Indonesian
0410 | Italian_Standard
0810 | Italian_Swiss
0411 | Japanese
043f | Kazakh
0457 | Konkani
0412 | Korean
0426 | Latvian
0427 | Lithuanian
042f | Macedonian
043e | Malay_Malaysia
083e | Malay_Brunei_Darussalam
044e | Marathi
0414 | Norwegian_Bokmal
0814 | Norwegian_Nynorsk
0415 | Polish
0416 | Portuguese_Brazilian
0816 | Portuguese_Standard
0418 | Romanian
0419 | Russian
044f | Sanskrit
081a | Serbian_Latin
0c1a | Serbian_Cyrillic
041b | Slovak
0424 | Slovenian
040a | Spanish_Traditional_Sort
080a | Spanish_Mexican
0c0a | Spanish_Modern_Sort
100a | Spanish_Guatemala
140a | Spanish_Costa_Rica
180a | Spanish_Panama
1c0a | Spanish_Dominican_Republic
200a | Spanish_Venezuela
240a | Spanish_Colombia
280a | Spanish_Peru
2c0a | Spanish_Argentina
300a | Spanish_Ecuador
340a | Spanish_Chile
380a | Spanish_Uruguay
3c0a | Spanish_Paraguay
400a | Spanish_Bolivia
440a | Spanish_El_Salvador
480a | Spanish_Honduras
4c0a | Spanish_Nicaragua
500a | Spanish_Puerto_Rico
0441 | Swahili
041d | Swedish
081d | Swedish_Finland
0449 | Tamil
0444 | Tatar
041e | Thai
041f | Turkish
0422 | Ukrainian
0420 | Urdu
0443 | Uzbek_Latin
0843 | Uzbek_Cyrillic
042a | Vietnamese

Example

MsgBox(0, "Your OS Language:", _Language())

Func _Language()
Select
Case StringInStr("0413 0813", @OSLang)
Return "Dutch"

Case StringInStr("0409 0809 0c09 1009 1409 1809 1c09 2009 2409 2809 2c09 3009 3409", @OSLang)
Return "English"

Case StringInStr("040c 080c 0c0c 100c 140c 180c", @OSLang)
Return "French"

Case StringInStr("0407 0807 0c07 1007 1407", @OSLang)
Return "German"

Case StringInStr("0410 0810", @OSLang)
Return "Italian"

Case StringInStr("0414 0814", @OSLang)
Return "Norwegian"

Case StringInStr("0415", @OSLang)
Return "Polish"

Case StringInStr("0416 0816", @OSLang)
Return "Portuguese"

Case StringInStr("040a 080a 0c0a 100a 140a 180a 1c0a 200a 240a 280a 2c0a 300a 340a 380a 3c0a 400a 440a 480a 4c0a 500a", @OSLang)
Return "Spanish"

Case StringInStr("041d 081d", @OSLang)
Return "Swedish"

Case Else
Return "Other (can't determine with @OSLang directly)"

EndSelect
EndFunc


Send Key list

Quick reference for the Send( "keys" [, flag] ) Command. ^ Ctrl ! Alt + Shift # Win

AutoIt can send all ASCII and Extended ASCII characters (0-255), to send UNICODE characters you must use the "ASC" option and the code of the character you wish to Send(see {ASC} below).

To send the ASCII value A (same as pressing ALT+065 on the numeric keypad)

Send("{ASC 065}")

(When using 2 digit ASCII codes you must use a leading 0, otherwise an obsolete 437 code page is used).

To send UNICODE characters enter the character code, for example this sends a Chinese character

Send("{ASC 2709}")

Single keys can also be repeated, e.g.

Send("{DEL 4}") ;Presses the DEL key 4 times
Send("{S 30}") ;Sends 30 'S' characters
Send("+{TAB 4}") ;Presses SHIFT+TAB 4 times

To hold a key down (generally only useful for games)

Send("{a down}") ;Holds the A key down
Send("{a up}") ;Releases the A key

If you with to use a variable for the count, try

$n = 4
Send("+{TAB " & $n & "}")

If you wish to send the ASCII value A four times, then try

$x = Chr(65)
Send("{" & $x & " 4}")

Most laptop computer keyboards have a special Fn key. This key cannot be simulated.

Note, by setting the flag parameter to 1 the "keys" parameter is sent RAW. This is useful when you want to send some text copied from a variable and you want the text sent exactly as written.

Send is quite useful because windows can be navigated without needing a mouse.

For example, open Folder Options (in the control panel) and try the following:

Send("{TAB}") | Navigate to next control (button, checkbox, etc)
Send("+{TAB}") | Navigate to previous control.
Send("^{TAB}") | Navigate to next WindowTab (on a Tabbed dialog window)
Send("^+{TAB}") | Navigate to previous WindowTab.
Send("{SPACE}") | Can be used to toggle a checkbox or click a button.
Send("{+}") | Usually checks a checkbox (if it's a "real" checkbox.)
Send("{-}") | Usually unchecks a checkbox.
Send("{NumPadMult}") | Recursively expands folders in a SysTreeView32.

Use Alt-key combos to access menu items. Also, open Notepad and try the following:

Send("!f") | Send Alt+f, the access key for Notepad's file menu. Try other letters!
Send("{DOWN}") | Move down a menu.
Send("{UP}") | Move up a menu.
Send("{LEFT}") | Move leftward to new menu or expand a submenu.
Send("{RIGHT}") | Move rightward to new menu or collapse a submenu.

See Windows' Help--press Win+F1--for a complete list of keyboard shortcuts if you don't know the importance of Alt+F4, PrintScreen, Ctrl+C, and so on.

Send Command (if zero flag) | Resulting Keypress
{!} | !
{#} | #
{+} | +
{^} | ^
{{} | {
{}} | }
{SPACE} | SPACE
{ENTER} | ENTER key on the main keyboard
{ALT} | ALT
{BACKSPACE} or {BS} | BACKSPACE
{DELETE} or {DEL} | DELETE
{UP} | Up arrow
{DOWN} | Down arrow
{LEFT} | Left arrow
{RIGHT} | Right arrow
{HOME} | HOME
{END} | END
{ESCAPE} or {ESC} | ESCAPE
{INSERT} or {INS} | INS
{PGUP} | PGUP
{PGDN} | PGDN
{F1} - {F12} | Function keys
{TAB} | TAB
{PRINTSCREEN} | PRINTSCR
{LWIN} | Left Windows key
{RWIN} | Right Windows key
{NUMLOCK} | NUMLOCK
{BREAK} | for Ctrl+Break processing
{PAUSE} | PAUSE
{CAPSLOCK} | CAPSLOCK
{NUMPAD0} - {NUMPAD9} | Numpad digits
{NUMPADMULT} | Numpad Multiply
{NUMPADADD} | Numpad Add
{NUMPADSUB} | Numpad Subtract
{NUMPADDIV} | Numpad Divide
{NUMPADDOT} | Numpad period
{NUMPADENTER} | Enter key on the numpad
{APPSKEY} | Windows App key
{LALT} | Left ALT key
{RALT} | Right ALT key
{LCTRL} | Left CTRL key
{RCTRL} | Right CTRL key
{LSHIFT} | Left Shift key
{RSHIFT} | Right Shift key
{SLEEP} | Computer SLEEP key
{ALTDOWN} | Holds the ALT key down until {ALTUP} is sent
{SHIFTDOWN} | Holds the SHIFT key down until {SHIFTUP} is sent
{CTRLDOWN} | Holds the CTRL key down until {CTRLUP} is sent
{LWINDOWN} | Holds the left Windows key down until {LWINUP} is sent
{RWINDOWN} | Holds the right Windows key down until {RWINUP} is sent
{ASC nnnn} | Send the ALT+nnnn key combination
{BROWSER_BACK} | 2000/XP Only: Select the browser "back" button
{BROWSER_FORWARD} | 2000/XP Only: Select the browser "forward" button
{BROWSER_REFRESH} | 2000/XP Only: Select the browser "refresh" button
{BROWSER_STOP} | 2000/XP Only: Select the browser "stop" button
{BROWSER_SEARCH} | 2000/XP Only: Select the browser "search" button
{BROWSER_FAVORITES} | 2000/XP Only: Select the browser "favorites" button
{BROWSER_HOME} | 2000/XP Only: Launch the browser and go to the home page
{VOLUME_MUTE} | 2000/XP Only: Mute the volume
{VOLUME_DOWN} | 2000/XP Only: Reduce the volume
{VOLUME_UP} | 2000/XP Only: Increase the volume
{MEDIA_NEXT} | 2000/XP Only: Select next track in media player
{MEDIA_PREV} | 2000/XP Only: Select previous track in media player
{MEDIA_STOP} | 2000/XP Only: Stop media player
{MEDIA_PLAY_PAUSE} | 2000/XP Only: Play/pause media player
{LAUNCH_MAIL} | 2000/XP Only: Launch the email application
{LAUNCH_MEDIA} | 2000/XP Only: Launch media player
{LAUNCH_APP1} | 2000/XP Only: Launch user app1
{LAUNCH_APP2} | 2000/XP Only: Launch user app2


Standard Windows Fonts

Click on the column headers to see a list of standard fonts that are installed with that version of Windows.

Recommend Fonts are highlighted in yellow.

FONT NAME | Win2000 | WinXP | Vista | Win7
Arial | x | x | x | x
Arial Black | x | x | x | x
Book Antiqua |  | x | x |
Calibri |  |  | x | x
Cambria |  |  | x | x
Candara |  |  | x | x
Comic Sans MS | x | x | x | x
Consolas |  |  | x | x
Constantia |  |  | x | x
Corbel |  |  | x | x
Courier | x | x | x | x
Courier New | x | x | x | x
Estrangelo Edessa |  | x | x | x
Franklin Gothic Medium |  | x | x | x
Gautami |  | x | x | x
Gabriola |  |  |  | x
Georgia | x | x | x |
Georgia Italic Impact |  | x |  |
Impact | x | x | x | x
Latha |  | x | x | x
Lucida Console | x | x | x | x
Lucida Sans Console |  | x | x | x
Lucida Sans Unicode | x | x | x | x
Marlett | x | x | x | x
Modern | x | x | x | x
Modern MS Sans Serif |  | x |  |
MS Sans Serif | x | x | x | x
MS Serif | x | x | x | x
MV Boli |  | x | x | x
Nyala |  |  | x | x
Palatino Linotype | x | x | x | x
Roman | x | x | x | x
Script | x | x | x | x
Sego Print |  |  | x | x
Sego Script |  |  | x | x
Sego UI |  |  | x | x
Small Fonts | x | x | x |
Symbol | x | x | x | x
Tahoma | x | x | x | x
Tempus Sans ITC | x |  |  |
Times New Roman | x | x | x | x
Trebuchet | x | x | x | x
Tunga |  | x | x | x
Verdana | x | x | x | x
Webdings | x | x | x | x
Westminster |  | x |  |
Wingdings | x | x | x | x
WST_Czech |  | x |  |
WST_Engl |  | x |  |
WST_Fren |  | x |  |
WST_Germ |  | x |  |
WST_Ital |  | x |  |
WST_Span |  | x |  |
WST_Swed |  | x |  |


Windows Message Codes

Sorted by Name Sorted by Code
Message | Code | Code | Message
WM_ACTIVATE | 0x0006 | 0x0000 | WM_NULL
WM_ACTIVATEAPP | 0x001C | 0x0001 | WM_CREATE
WM_AFXFIRST | 0x0360 | 0x0002 | WM_DESTROY
WM_AFXLAST | 0x037F | 0x0003 | WM_MOVE
WM_APP | 0x8000 | 0x0005 | WM_SIZE
WM_APPCOMMAND | 0x0319 | 0x0006 | WM_ACTIVATE
WM_ASKCBFORMATNAME | 0x030C | 0x0007 | WM_SETFOCUS
WM_CANCELJOURNAL | 0x004B | 0x0008 | WM_KILLFOCUS
WM_CANCELMODE | 0x001F | 0x000A | WM_ENABLE
WM_CAPTURECHANGED | 0x0215 | 0x000B | WM_SETREDRAW
WM_CHANGECBCHAIN | 0x030D | 0x000C | WM_SETTEXT
WM_CHANGEUISTATE | 0x0127 | 0x000D | WM_GETTEXT
WM_CHAR | 0x0102 | 0x000E | WM_GETTEXTLENGTH
WM_CHARTOITEM | 0x002F | 0x000F | WM_PAINT
WM_CHILDACTIVATE | 0x0022 | 0x0010 | WM_CLOSE
WM_CLEAR | 0x0303 | 0x0011 | WM_QUERYENDSESSION
WM_CLOSE | 0x0010 | 0x0013 | WM_QUERYOPEN
WM_COMMAND | 0x0111 | 0x0016 | WM_ENDSESSION
WM_COMMNOTIFY | 0x0044 | 0x0012 | WM_QUIT
WM_COMPACTING | 0x0041 | 0x0014 | WM_ERASEBKGND
WM_COMPAREITEM | 0x0039 | 0x0015 | WM_SYSCOLORCHANGE
WM_CONTEXTMENU | 0x007B | 0x0018 | WM_SHOWWINDOW
WM_COPY | 0x0301 | 0x001A | WM_WININICHANGE
WM_COPYDATA | 0x004A | 0x001A | WM_SETTINGCHANGE
WM_CREATE | 0x0001 | 0x001B | WM_DEVMODECHANGE
WM_CTLCOLORBTN | 0x0135 | 0x001C | WM_ACTIVATEAPP
WM_CTLCOLORDLG | 0x0136 | 0x001D | WM_FONTCHANGE
WM_CTLCOLOREDIT | 0x0133 | 0x001E | WM_TIMECHANGE
WM_CTLCOLORLISTBOX | 0x0134 | 0x001F | WM_CANCELMODE
WM_CTLCOLORMSGBOX | 0x0132 | 0x0020 | WM_SETCURSOR
WM_CTLCOLORSCROLLBAR | 0x0137 | 0x0021 | WM_MOUSEACTIVATE
WM_CTLCOLORSTATIC | 0x0138 | 0x0022 | WM_CHILDACTIVATE
WM_CUT | 0x0300 | 0x0023 | WM_QUEUESYNC
WM_DEADCHAR | 0x0103 | 0x0024 | WM_GETMINMAXINFO
WM_DELETEITEM | 0x002D | 0x0026 | WM_PAINTICON
WM_DESTROY | 0x0002 | 0x0027 | WM_ICONERASEBKGND
WM_DESTROYCLIPBOARD | 0x0307 | 0x0028 | WM_NEXTDLGCTL
WM_DEVICECHANGE | 0x0219 | 0x002A | WM_SPOOLERSTATUS
WM_DEVMODECHANGE | 0x001B | 0x002B | WM_DRAWITEM
WM_DISPLAYCHANGE | 0x007E | 0x002C | WM_MEASUREITEM
WM_DRAWCLIPBOARD | 0x0308 | 0x002D | WM_DELETEITEM
WM_DRAWITEM | 0x002B | 0x002E | WM_VKEYTOITEM
WM_DROPFILES | 0x0233 | 0x002F | WM_CHARTOITEM
WM_ENABLE | 0x000A | 0x0030 | WM_SETFONT
WM_ENDSESSION | 0x0016 | 0x0031 | WM_GETFONT
WM_ENTERIDLE | 0x0121 | 0x0032 | WM_SETHOTKEY
WM_ENTERMENULOOP | 0x0211 | 0x0033 | WM_GETHOTKEY
WM_ENTERSIZEMOVE | 0x0231 | 0x0037 | WM_QUERYDRAGICON
WM_ERASEBKGND | 0x0014 | 0x0039 | WM_COMPAREITEM
WM_EXITMENULOOP | 0x0212 | 0x003D | WM_GETOBJECT
WM_EXITSIZEMOVE | 0x0232 | 0x0041 | WM_COMPACTING
WM_FONTCHANGE | 0x001D | 0x0044 | WM_COMMNOTIFY
WM_GETDLGCODE | 0x0087 | 0x0046 | WM_WINDOWPOSCHANGING
WM_GETFONT | 0x0031 | 0x0047 | WM_WINDOWPOSCHANGED
WM_GETHOTKEY | 0x0033 | 0x0048 | WM_POWER
WM_GETICON | 0x007F | 0x004A | WM_COPYDATA
WM_GETMINMAXINFO | 0x0024 | 0x004B | WM_CANCELJOURNAL
WM_GETOBJECT | 0x003D | 0x004E | WM_NOTIFY
WM_GETTEXT | 0x000D | 0x0050 | WM_INPUTLANGCHANGEREQUEST
WM_GETTEXTLENGTH | 0x000E | 0x0051 | WM_INPUTLANGCHANGE
WM_HANDHELDFIRST | 0x0358 | 0x0052 | WM_TCARD
WM_HANDHELDLAST | 0x035F | 0x0053 | WM_HELP
WM_HELP | 0x0053 | 0x0054 | WM_USERCHANGED
WM_HOTKEY | 0x0312 | 0x0055 | WM_NOTIFYFORMAT
WM_HSCROLL | 0x0114 | 0x007B | WM_CONTEXTMENU
WM_HSCROLLCLIPBOARD | 0x030E | 0x007C | WM_STYLECHANGING
WM_ICONERASEBKGND | 0x0027 | 0x007D | WM_STYLECHANGED
WM_IME_CHAR | 0x0286 | 0x007E | WM_DISPLAYCHANGE
WM_IME_COMPOSITION | 0x010F | 0x007F | WM_GETICON
WM_IME_COMPOSITIONFULL | 0x0284 | 0x0080 | WM_SETICON
WM_IME_CONTROL | 0x0283 | 0x0081 | WM_NCCREATE
WM_IME_ENDCOMPOSITION | 0x010E | 0x0082 | WM_NCDESTROY
WM_IME_KEYDOWN | 0x0290 | 0x0083 | WM_NCCALCSIZE
WM_IME_KEYLAST | 0x010F | 0x0084 | WM_NCHITTEST
WM_IME_KEYUP | 0x0291 | 0x0085 | WM_NCPAINT
WM_IME_NOTIFY | 0x0282 | 0x0086 | WM_NCACTIVATE
WM_IME_REQUEST | 0x0288 | 0x0087 | WM_GETDLGCODE
WM_IME_SELECT | 0x0285 | 0x0088 | WM_SYNCPAINT
WM_IME_SETCONTEXT | 0x0281 | 0x00A0 | WM_NCMOUSEMOVE
WM_IME_STARTCOMPOSITION | 0x010D | 0x00A1 | WM_NCLBUTTONDOWN
WM_INITDIALOG | 0x0110 | 0x00A2 | WM_NCLBUTTONUP
WM_INITMENU | 0x0116 | 0x00A3 | WM_NCLBUTTONDBLCLK
WM_INITMENUPOPUP | 0x0117 | 0x00A4 | WM_NCRBUTTONDOWN
WM_INPUT | 0x00FF | 0x00A5 | WM_NCRBUTTONUP
WM_INPUTLANGCHANGE | 0x0051 | 0x00A6 | WM_NCRBUTTONDBLCLK
WM_INPUTLANGCHANGEREQUEST | 0x0050 | 0x00A7 | WM_NCMBUTTONDOWN
WM_KEYDOWN | 0x0100 | 0x00A8 | WM_NCMBUTTONUP
WM_KEYFIRST | 0x0100 | 0x00A9 | WM_NCMBUTTONDBLCLK
WM_KEYLAST | 0x0108 | 0x00AB | WM_NCXBUTTONDOWN
WM_KEYLAST | 0x0109 | 0x00AC | WM_NCXBUTTONUP
WM_KEYUP | 0x0101 | 0x00AD | WM_NCXBUTTONDBLCLK
WM_KILLFOCUS | 0x0008 | 0x00FF | WM_INPUT
WM_LBUTTONDBLCLK | 0x0203 | 0x0100 | WM_KEYFIRST
WM_LBUTTONDOWN | 0x0201 | 0x0100 | WM_KEYDOWN
WM_LBUTTONUP | 0x0202 | 0x0101 | WM_KEYUP
WM_MBUTTONDBLCLK | 0x0209 | 0x0102 | WM_CHAR
WM_MBUTTONDOWN | 0x0207 | 0x0103 | WM_DEADCHAR
WM_MBUTTONUP | 0x0208 | 0x0104 | WM_SYSKEYDOWN
WM_MDIACTIVATE | 0x0222 | 0x0105 | WM_SYSKEYUP
WM_MDICASCADE | 0x0227 | 0x0106 | WM_SYSCHAR
WM_MDICREATE | 0x0220 | 0x0107 | WM_SYSDEADCHAR
WM_MDIDESTROY | 0x0221 | 0x0109 | WM_UNICHAR
WM_MDIGETACTIVE | 0x0229 | 0x0109 | WM_KEYLAST
WM_MDIICONARRANGE | 0x0228 | 0x0108 | WM_KEYLAST
WM_MDIMAXIMIZE | 0x0225 | 0x010D | WM_IME_STARTCOMPOSITION
WM_MDINEXT | 0x0224 | 0x010E | WM_IME_ENDCOMPOSITION
WM_MDIREFRESHMENU | 0x0234 | 0x010F | WM_IME_COMPOSITION
WM_MDIRESTORE | 0x0223 | 0x010F | WM_IME_KEYLAST
WM_MDISETMENU | 0x0230 | 0x0110 | WM_INITDIALOG
WM_MDITILE | 0x0226 | 0x0111 | WM_COMMAND
WM_MEASUREITEM | 0x002C | 0x0112 | WM_SYSCOMMAND
WM_MENUCHAR | 0x0120 | 0x0113 | WM_TIMER
WM_MENUCOMMAND | 0x0126 | 0x0114 | WM_HSCROLL
WM_MENUDRAG | 0x0123 | 0x0115 | WM_VSCROLL
WM_MENUGETOBJECT | 0x0124 | 0x0116 | WM_INITMENU
WM_MENURBUTTONUP | 0x0122 | 0x0117 | WM_INITMENUPOPUP
WM_MENUSELECT | 0x011F | 0x011F | WM_MENUSELECT
WM_MOUSEACTIVATE | 0x0021 | 0x0120 | WM_MENUCHAR
WM_MOUSEFIRST | 0x0200 | 0x0121 | WM_ENTERIDLE
WM_MOUSEHOVER | 0x02A1 | 0x0122 | WM_MENURBUTTONUP
WM_MOUSELAST(2K,XP,2k3) | 0x020D | 0x0123 | WM_MENUDRAG
WM_MOUSELAST(95) | 0x0209 | 0x0124 | WM_MENUGETOBJECT
WM_MOUSELAST(NT4,98) | 0x020A | 0x0125 | WM_UNINITMENUPOPUP
WM_MOUSELEAVE | 0x02A3 | 0x0126 | WM_MENUCOMMAND
WM_MOUSEMOVE | 0x0200 | 0x0127 | WM_CHANGEUISTATE
WM_MOUSEWHEEL | 0x020A | 0x0128 | WM_UPDATEUISTATE
WM_MOVE | 0x0003 | 0x0129 | WM_QUERYUISTATE
WM_MOVING | 0x0216 | 0x0132 | WM_CTLCOLORMSGBOX
WM_NCACTIVATE | 0x0086 | 0x0133 | WM_CTLCOLOREDIT
WM_NCCALCSIZE | 0x0083 | 0x0134 | WM_CTLCOLORLISTBOX
WM_NCCREATE | 0x0081 | 0x0135 | WM_CTLCOLORBTN
WM_NCDESTROY | 0x0082 | 0x0136 | WM_CTLCOLORDLG
WM_NCHITTEST | 0x0084 | 0x0137 | WM_CTLCOLORSCROLLBAR
WM_NCLBUTTONDBLCLK | 0x00A3 | 0x0138 | WM_CTLCOLORSTATIC
WM_NCLBUTTONDOWN | 0x00A1 | 0x0200 | WM_MOUSEFIRST
WM_NCLBUTTONUP | 0x00A2 | 0x0200 | WM_MOUSEMOVE
WM_NCMBUTTONDBLCLK | 0x00A9 | 0x0201 | WM_LBUTTONDOWN
WM_NCMBUTTONDOWN | 0x00A7 | 0x0202 | WM_LBUTTONUP
WM_NCMBUTTONUP | 0x00A8 | 0x0203 | WM_LBUTTONDBLCLK
WM_NCMOUSEHOVER | 0x02A0 | 0x0204 | WM_RBUTTONDOWN
WM_NCMOUSELEAVE | 0x02A2 | 0x0205 | WM_RBUTTONUP
WM_NCMOUSEMOVE | 0x00A0 | 0x0206 | WM_RBUTTONDBLCLK
WM_NCPAINT | 0x0085 | 0x0207 | WM_MBUTTONDOWN
WM_NCRBUTTONDBLCLK | 0x00A6 | 0x0208 | WM_MBUTTONUP
WM_NCRBUTTONDOWN | 0x00A4 | 0x0209 | WM_MBUTTONDBLCLK
WM_NCRBUTTONUP | 0x00A5 | 0x0209 | WM_MOUSELAST(95)
WM_NCXBUTTONDBLCLK | 0x00AD | 0x020A | WM_MOUSEWHEEL
WM_NCXBUTTONDOWN | 0x00AB | 0x020A | WM_MOUSELAST(NT4,98)
WM_NCXBUTTONUP | 0x00AC | 0x020B | WM_XBUTTONDOWN
WM_NEXTDLGCTL | 0x0028 | 0x020C | WM_XBUTTONUP
WM_NEXTMENU | 0x0213 | 0x020D | WM_XBUTTONDBLCLK
WM_NOTIFY | 0x004E | 0x020D | WM_MOUSELAST(2K,XP,2k3)
WM_NOTIFYFORMAT | 0x0055 | 0x0210 | WM_PARENTNOTIFY
WM_NULL | 0x0000 | 0x0211 | WM_ENTERMENULOOP
WM_PAINT | 0x000F | 0x0212 | WM_EXITMENULOOP
WM_PAINTCLIPBOARD | 0x0309 | 0x0213 | WM_NEXTMENU
WM_PAINTICON | 0x0026 | 0x0214 | WM_SIZING
WM_PALETTECHANGED | 0x0311 | 0x0215 | WM_CAPTURECHANGED
WM_PALETTEISCHANGING | 0x0310 | 0x0216 | WM_MOVING
WM_PARENTNOTIFY | 0x0210 | 0x0218 | WM_POWERBROADCAST
WM_PASTE | 0x0302 | 0x0219 | WM_DEVICECHANGE
WM_PENWINFIRST | 0x0380 | 0x0220 | WM_MDICREATE
WM_PENWINLAST | 0x038F | 0x0221 | WM_MDIDESTROY
WM_POWER | 0x0048 | 0x0222 | WM_MDIACTIVATE
WM_POWERBROADCAST | 0x0218 | 0x0223 | WM_MDIRESTORE
WM_PRINT | 0x0317 | 0x0224 | WM_MDINEXT
WM_PRINTCLIENT | 0x0318 | 0x0225 | WM_MDIMAXIMIZE
WM_QUERYDRAGICON | 0x0037 | 0x0226 | WM_MDITILE
WM_QUERYENDSESSION | 0x0011 | 0x0227 | WM_MDICASCADE
WM_QUERYNEWPALETTE | 0x030F | 0x0228 | WM_MDIICONARRANGE
WM_QUERYOPEN | 0x0013 | 0x0229 | WM_MDIGETACTIVE
WM_QUERYUISTATE | 0x0129 | 0x0230 | WM_MDISETMENU
WM_QUEUESYNC | 0x0023 | 0x0231 | WM_ENTERSIZEMOVE
WM_QUIT | 0x0012 | 0x0232 | WM_EXITSIZEMOVE
WM_RBUTTONDBLCLK | 0x0206 | 0x0233 | WM_DROPFILES
WM_RBUTTONDOWN | 0x0204 | 0x0234 | WM_MDIREFRESHMENU
WM_RBUTTONUP | 0x0205 | 0x0281 | WM_IME_SETCONTEXT
WM_RENDERALLFORMATS | 0x0306 | 0x0282 | WM_IME_NOTIFY
WM_RENDERFORMAT | 0x0305 | 0x0283 | WM_IME_CONTROL
WM_SETCURSOR | 0x0020 | 0x0284 | WM_IME_COMPOSITIONFULL
WM_SETFOCUS | 0x0007 | 0x0285 | WM_IME_SELECT
WM_SETFONT | 0x0030 | 0x0286 | WM_IME_CHAR
WM_SETHOTKEY | 0x0032 | 0x0288 | WM_IME_REQUEST
WM_SETICON | 0x0080 | 0x0290 | WM_IME_KEYDOWN
WM_SETREDRAW | 0x000B | 0x0291 | WM_IME_KEYUP
WM_SETTEXT | 0x000C | 0x02A1 | WM_MOUSEHOVER
WM_SETTINGCHANGE | 0x001A | 0x02A3 | WM_MOUSELEAVE
WM_SHOWWINDOW | 0x0018 | 0x02A0 | WM_NCMOUSEHOVER
WM_SIZE | 0x0005 | 0x02A2 | WM_NCMOUSELEAVE
WM_SIZECLIPBOARD | 0x030B | 0x02B1 | WM_WTSSESSION_CHANGE
WM_SIZING | 0x0214 | 0x02C0 | WM_TABLET_FIRST
WM_SPOOLERSTATUS | 0x002A | 0x02DF | WM_TABLET_LAST
WM_STYLECHANGED | 0x007D | 0x0300 | WM_CUT
WM_STYLECHANGING | 0x007C | 0x0301 | WM_COPY
WM_SYNCPAINT | 0x0088 | 0x0302 | WM_PASTE
WM_SYSCHAR | 0x0106 | 0x0303 | WM_CLEAR
WM_SYSCOLORCHANGE | 0x0015 | 0x0304 | WM_UNDO
WM_SYSCOMMAND | 0x0112 | 0x0305 | WM_RENDERFORMAT
WM_SYSDEADCHAR | 0x0107 | 0x0306 | WM_RENDERALLFORMATS
WM_SYSKEYDOWN | 0x0104 | 0x0307 | WM_DESTROYCLIPBOARD
WM_SYSKEYUP | 0x0105 | 0x0308 | WM_DRAWCLIPBOARD
WM_TABLET_FIRST | 0x02C0 | 0x0309 | WM_PAINTCLIPBOARD
WM_TABLET_LAST | 0x02DF | 0x030A | WM_VSCROLLCLIPBOARD
WM_TCARD | 0x0052 | 0x030B | WM_SIZECLIPBOARD
WM_THEMECHANGED | 0x031A | 0x030C | WM_ASKCBFORMATNAME
WM_TIMECHANGE | 0x001E | 0x030D | WM_CHANGECBCHAIN
WM_TIMER | 0x0113 | 0x030E | WM_HSCROLLCLIPBOARD
WM_UNDO | 0x0304 | 0x030F | WM_QUERYNEWPALETTE
WM_UNICHAR | 0x0109 | 0x0310 | WM_PALETTEISCHANGING
WM_UNINITMENUPOPUP | 0x0125 | 0x0311 | WM_PALETTECHANGED
WM_UPDATEUISTATE | 0x0128 | 0x0312 | WM_HOTKEY
WM_USER | 0x0400 | 0x0317 | WM_PRINT
WM_USERCHANGED | 0x0054 | 0x0318 | WM_PRINTCLIENT
WM_VKEYTOITEM | 0x002E | 0x0319 | WM_APPCOMMAND
WM_VSCROLL | 0x0115 | 0x031A | WM_THEMECHANGED
WM_VSCROLLCLIPBOARD | 0x030A | 0x0358 | WM_HANDHELDFIRST
WM_WINDOWPOSCHANGED | 0x0047 | 0x035F | WM_HANDHELDLAST
WM_WINDOWPOSCHANGING | 0x0046 | 0x0360 | WM_AFXFIRST
WM_WININICHANGE | 0x001A | 0x037F | WM_AFXLAST
WM_WTSSESSION_CHANGE | 0x02B1 | 0x0380 | WM_PENWINFIRST
WM_XBUTTONDBLCLK | 0x020D | 0x038F | WM_PENWINLAST
WM_XBUTTONDOWN | 0x020B | 0x0400 | WM_USER
WM_XBUTTONUP | 0x020C | 0x8000 | WM_APP


AutoIt

Credits

Forum names are used where available, names listed alphabetically.

AutoIt v3 Coding

Active Authors

  • Jonathan Bennett <Jon>
  • Jason Boggs <Valik>
  • Jean-Paul Mesnage <jpm>
  • David Nuttall <Nutster>

Lapsed Authors

  • Dave Fulgham <DaveF>
  • Larry Keys <LarryDalooza>
  • Holger Kotsch <Holger>
  • Sven P <SvenP>
  • Tylo <Tylo>

Additional Contributions

Contributions that were either a few lines, or code submitted via the forum or by email.

  • /dev/null
  • Ejoc
  • Jeremy Landes <jlandes>
  • layer
  • Garrett "The HardlyDeservesCreditFor20LinesOfCode" R. Mueller

External Contributions

  • Amir Szekely

    Thanks to Amir who coded the resource functions for the NSIS Installer and helped me
    get the code working with AutoIt. Check out the NSIS installer at:
    http://nsis.sourceforge.net/site/index.php
    -
  • Gabriele Scibilia <http://www.geocities.com/gabriele_scibilia/>

    qmath.h - used with permission.

AutoIt v3 Help Files

  • Many of the above ;p
  • Philip Gump <CyberSlug>
  • J-Paul Mesnage <jpm>
  • ScriptKitty
  • Jos van der Zande <Jos>

Scite4AutoIt

  • Jos van der Zande <Jos>

Au3Check

Created by Tylo.

  • Tylo
  • Jos van der Zande <Jos>

AutoIt v3 Standard Includes

  • The authors as documented in the include files themselves.
  • Gary Frost <GaryFrost>
  • Brian Keene
  • Jeremy Landes <jlandes>
  • Jos van der Zande <Jos>

Special Thanks

  • Everyone who continues to use and support AutoIt
  • The authors of UPX which is used for creating compressed executables produced by AutoIt.


History

IMPORTANT: See here for recent script-breaking changes.

Here is the summarised history of the changes to AutoIt v3.

(For the complete technical history click here. For the complete history including all changes between beta versions click here.)

16th April, 2010 - v3.3.6.1

AutoIt:

  • Fixed #1515: FileOpen() still opening in exclusive mode in some situations.

7th March, 2010 - v3.3.6.0

AutoIt:

  • Added #1376: FileOpen() mode parameter is now optional. Default mode is read.
  • Added #1054: Added FileGetEncoding().
  • Added: ControlCommand() "SendCommandID" - used to send WM_COMMAND Control ID messages. Allows the automation of ToolBarWindow32 controls (amongst others). For example, the "Back" button of Internet Explorer. Use Au3Info to get the Command ID from the ToolBar tab.
  • Fixed #1428: AdlibRegister/Unregister() were incorrectly using case-sensitive function names.
  • Fixed #1448: #OnAutoItStartRegister did not work in compiled scripts.
  • Fixed #961: RegDelete() was not working properly on 64bit keys when using the 32bit version of AutoIt and HKLM64.
  • Fixed: Regression in FileOpen() where it wasn't allowed to open files in read mode if they were already open in write mode.
  • Fixed #1449: GUICtrlDelete() not working for GUICtrlCreateDummy() types.
  • Fixed #1458: Inet sizes were capped to 32-bits.
  • Fixed #1459: Hard crash when too much recursion is used.
  • Fixed #1464: Regular expressions with a single character * pattern were stopping after the first null match.
  • Fixed #1463: StringToASCIIArray() working incorrectly with UTF8 characters.
  • Fixed #1475: TrayItemSetState($Value, $Tray_Checked) incorrectly enables a disabled TrayItem.
  • Changed: Send() and ControlSend() code reworked to allow for more Unicode characters to be used.
  • Changed: FileWriteLine() performance improved.

Aut2Exe

  • Fixed #1409: Ctrl+C is no longer the shortcut for Convert. It is now Ctrl+G (Go) to avoid clashing with a Ctrl+C copy operation..

Au3Info

  • Fixed #1444: Controls in applications like RegEdit were left highlighted.
  • Fixed #1391: ToolbarWindow32 info only showing the first toolbar.

AutoIt3Help

  • Fixed #1423: "Open Script" button stopped working.

AutoItX

  • Fixed: Missing .lib files readded.

UDFs:

  • Fixed #1438: AutoIt error when using _ArrayCombinations().
  • Fixed #1454: StringBetween() not working correctly.
  • Fixed #1441: _GUICtrlRichEdit_GetText() using wrong buffer length.
  • Fixed #1446: _ScreenCapture_Capture() was using height/width of 1 pixel less.
  • Fixed #1445: Documentation updated for _MemGlobalFree().
  • Fixed #1469: _GDIPlus_BitmapCloneArea() documentation updated.
  • Fixed #1466: _GUICtrlEdit_GetLine() returns an unexpected character.
  • Fixed #1487: _DateToDayOfWeekIso returned 0-6 but should be 1-7 where Monday = 1

15th January, 2010 - v3.3.4.0

AutoIt:

  • Added: Ability to read and write UTF-8 files with no BOM including automatic detection during reading.
  • Added #682: Removed the 64KB limitation for FileReadLine()
  • Added: AutoIt scripts using the line continuation character "_" are no longer limited to a combined line length of 4095 characters.
  • Added: FileRead() returns the number of characters/bytes read in @extended.
  • Added #1311: MouseGetCursor() returns hand cursor.
  • Fixed #384: Under certain circumstances the network credentials flag would prevent the process from starting when launched with RunAs() or RunAsWait().
  • Fixed #1370: StringInStr() would crash with a negative occurrence and start position greater than the string length.
  • Fixed #1367: Calling GUIDelete() from a GUIRegisterMsg() callback that returns $GUI_RUNDEFMSG would crash AutoIt.
  • Fixed #1363: FileSetPos() did not work when the origin was the current position.
  • Fixed #1355: Regression in how unsigned numbers are displayed when returned from DllCall().
  • Fixed #1396: Crash in DllCallbackGetPtr() with invalid handle.
  • Fixed #1352: StringSplit() hard crash with binary data.
  • Fixed #1398: Fixed declaration of $tagPARAFORMAT2 from GuiRichEdit.au3
  • Removed: The "RAW" reading mode from FileOpen() has been removed.
  • Removed: InetGet("abort"), @InetGetActive and @InetGetBytesRead have been removed.
  • Removed: AdlibEnable() and AdlibDisable() have been removed.
  • Removed: OnAutoItStart and OnAutoItExit have been removed.

AutoIt3Help

  • Fixed #1327: Some keywords would fail to open correctly in rare cases.

UDFs:

  • Changed: _SQLite 3.6.19 -> 3.6.22
  • Fixed #1338: bad _ArrayDisplay() GUI position error.
  • Fixed #1362: _WinAPI_WindowFromPoint() did not work with 64-bit AutoIt.
  • Fixed #1389: _IEAttach() could fail if called multiple times.
  • Fixed #1353: _FileWriteToLine() excessively strict on input text type.
  • Fixed: SQLite.au3 various errors in _SQLite_FetchData, $iCharSize, _SQLite_QuerySingleRow, _SQLite_GetTable2d, _SQLite_Display2DResult by jchd.

18th December, 2009 - v3.3.2.0

AutoIt:

  • Added #529: Added the "NAME" property to allow direct search for .NET WinForm control names.
  • Added #757: Set defaults for MouseClick()'s x/y parameters.
  • Added #764: Return Pid on ProcessWait() and handle on WinWait(), WinWaitActive, WinActivate(), WinActive(), WinMove() when successful.
  • Added #414: better handling of OnAutoItStart/OnAutoItExit, now #OnAutoItStartRegister, OnAutoItExitRegister() and OnAutoItExitUnRegister().
  • Added: Better handling of AdlibEnable/AdlibDisable, now AdlibRegister(), AdlibUnRegister() and AdlibDisable().
  • Added #351: Reverse PixelSearch().
  • Added #769: FileFlush() function.
  • Added #333: #NoAutoIt3Execute Directive for disabling /AutoIt3ExecuteScript or /AutoIt3ExecuteLine.
  • Added #604: $GUI_BKCOLOR_TRANSPARENT can be used with label, group, radio, checkbox controls.
  • Added #135: FileSetPos(), FileGetPos() functions for moving the file pointer around.
  • Added #582: GUICtrlSetTip() can be used on TabItem controls.
  • Added #699: Shutdown() now return @error=GetLastError() when failing.
  • Added #461: StringReplace() from right to left if occurrence <0 as for StringInStr().
  • Added: GUICtrlSetColor() and GUICtrlSetBkColor() for Combo Controls.
  • Added: GUI without title bar (no $WS_CAPTION) can be moved with the mouse.
  • Added #815: Temporary variables can be passed ByRef.
  • Added #837: FileFindNextFile() set @extended if a directory is returned.
  • Added #839: Shutdown() rewritten and now works properly when run as a non-interactive user.
  • Added: Shutdown() now takes an optional reason code.
  • Added #846: _PathFull() now supports strange but valid syntax where drives do not have a trailing slash.
  • Added #869: @MUILang macro to help MUI environment scripts.
  • Added #918: Added Quality parameter to GUICtrlSetFont() and GUISetFont().
  • Added: ProcessClose() return info on error.
  • Added: PixelChecksum() extra parameter to select CRC32 instead of ADLER.
  • Added #984: @OSVersion now returns "WIN_XPe" for Windows XP Embedded.
  • Added #938: UDPOpen() flag to allow broadcasting with 255.255.255.255.
  • Added: new types to DllCall and DllStruct to avoid confusion with MSDN description. That avoid specially X64 errors.
  • Added #351: PixelSearch() now supports both right-to-left and bottom-to-top searches.
  • Added #508: Static keyword.
  • Added #1056: New Inet option to by-pass forcing the connection online.
  • Added: DllStructSetData() and DllStructGetData() index parameter now supports the Default keyword.
  • Added #1270: GuiSetIcon() now finds suitable large and small icons.
  • Added: HttpSetUserAgent(), InetClose(), InetGetInfo() and InetRead() functions.
  • Added: Multiple background downloads are now supported with InetGet().
  • Added #408: New flag for ignoring SSL errors for HTTPS connections.
  • Added #884: Better proxy support with mode 0.
  • Added #949: The user-agent can be changed.
  • Fixed: CtrlSetStyle listview on non selected tab.
  • Fixed #763: GUICtrlCreateIcon() create an empty icon on error.
  • Fixed: no mouse move when invalid button used in MouseClick() or MouseClickDrag().
  • Fixed #779: infinite loop on Exit due to GUICreate() child badly created.
  • Fixed #774: GuiCtrlSetBkColor() bad label display.
  • Fixed #790: Windows region constant $ERROR rename in $ERRORREGION.
  • Fixed: StringInStr("aaa", "aa", 2) does not return 0.
  • Fixed #802: Searching for controls by Height property.
  • Fixed: Checkbox or radio painting on tab.
  • Fixed #816: data for GUI date control doc clarification.
  • Fixed #819: Crash with EventLog functions.
  • Fixed #814: InetGet() through a proxy requiring authentication did not work.
  • Fixed #813: bad handling of Windows advanced matching for [HANDLE:...] in X64 version.
  • Fixed #863: DirMove() extra dot.
  • Fixed #867: UDPRecv() can return from IP/Port.
  • Fixed #886: More explicit documentation that operator == is a forced string comparison.
  • Fixed #885: Default compared to False returned True instead of False.
  • Fixed #888: Send("{}}") Extra null char.
  • Fixed: DllCall() returning 64-bit int.
  • Fixed: GuiCtrlSetImage() after GUI resized.
  • Fixed: DirMove() return code wrong under XP.
  • Fixed #931: bad GUICtrlSetResizing() for graphic control.
  • Fixed #934: MouseGetCursor() hogging mouse double click.
  • Fixed #615: License updated to be less restrictive.
  • Fixed #919: Remarks added to ConsoleWrite(), ConsoleWriteError() and StdinWrite() regarding how those functions handle binary data and non-ANSI characters.
  • Fixed #897: Documented that StringToASCIIArray() does not accept binary input (convert to a string first).
  • Fixed #937: Bad event handling of Opt("TrayMenuMode",1)
  • Fixed #969: FileFindNextFile() does not set @extended if first found is a dir.
  • Fixed #1006: @MSEC returned wrong value for values < 100.
  • Fixed #1010: FileRead() UTF8 with BOM files return too many chars.
  • Fixed #1013: MDI childs doesn't adjust to parent windows client area.
  • Fixed #1005: TraySetClick(64) = hovering.
  • Fixed: ClipPut("") not emptying.
  • Fixed #1068: Binary to Int.
  • Fixed: Bad painting on double GUICtrlSetPos() for label.
  • Fixed #1094: Send("{LSHIFT UP}") stay down.
  • Fixed #1074: Inputbox() positionning on multi monitor.
  • Fixed #1105: disable colored Multiline button not properly displayed.
  • Fixed #1077: GUICtrlSetBkColor() bad recoloring.
  • Fixed #1116: GUICtrlCreateGraphic don't follow ResizeMode.
  • Fixed #1102: Better documentation of the StringInStr() count parameter.
  • Fixed #1161: Removed all documentation references to ColorMode.
  • Fixed #1156: AutoItSetOption()/Opt() now set @error instead of generating a fatal error with invalid input.
  • Fixed: Comparing pointers now works correctly.
  • Fixed #906: ActiveX controls were not told what their initial size was.
  • Fixed: Boolean tests on binary strings now behaves properly.
  • Fixed #1234: COM methods that modified boolean arguments could change them to ints.
  • Fixed #1258: System menu could display when trying to dismiss a control menu.
  • Fixed #1288: Documented how DllStructSetData() and DllStructGetData() work with arrays when omitting the index parameter.
  • Fixed #1300: DLLs could unload when calling DllCall() with an invalid function.
  • Fixed #1295: Unicode to ANSI conversion was crashing in certain situations.
  • Fixed #1304: _GDIPlus_BitmapLockBits() now correctly takes a Width and Height parameter instead of a Right and Bottom.
  • Fixed #1294: Fixed AutoIt deadlock when using the following functions with hanged windows: WinGetTitle, WinSetTitle, WinGetText, WinFlash, WinSetOnTop
  • Fixed #1332: Mod() forced a conversion to floating point numbers when it didn't need to which can cause unexpected output.
  • Fixed #1321: DllStructCreate() did not support _ in data names. Documented valid characters for data name.
  • Fixed #1322: Crash when using ControlCommand("GetSelected") on non-Edit controls.
  • Fixed #1325: Some date functions could attempt to access an invalid array.
  • Fixed #1345: Number() failed to handle numbers with a trailing decimal point.
  • Changed: It is now possible to read from files opened for writing.
  • Changed: PCRE regular expression engine updated to 8.00.
  • Changed #899: ShellExecute[Wait]() no longer uses "open" as the default verb. See remarks section for those functions for more information.
  • Changed: Inet functions rewritten with the following additions and changes:
  • Removed: Long deprecate URLDownloadToFile() alias for InetGet().
  • Changed: InetGet() returns a handle which must be closed.
  • Changed: @InetGetBytes, @InetGetActive and InetGet("abort") are deprecated and will be removed in the future.
  • Changed #968: AutoUpdateIt updated by ProgAndy to use new Inet features.
  • Changed: @YDAY now returns values in the range 001 - 366 instead of 1 - 366. This makes the macro more consistent with other languages (like C/C++) and more consistent with all other date related macros which return strings with leading 0s to pad the length. THIS IS A SCRIPT BREAKING CHANGE.
  • Changed #1080: InetGet background downloads now return immediately instead of connecting to the remote host first.
  • Changed #1137: RegEnumKey() and RegEnumVal() now correctly return an empty string on failure instead of an error message string.
  • Changed: PixelChecksum() can calculate checksums from right-to-left and bottom-to-top.
  • Changed: InputBox() no longer requires passing both x and y or w and h.
  • Changed #1056: Added new Inet option to by-pass forcing the connection online.

AutoItX:

  • Removed: ColorMode option removed from AutoItSetOption()

Au3info:

  • Removed: ColorMode BGR option removed since AutoIt no longer supports the option to use BGR mode.
  • Added: Control information now includes the .NET WinForm if available.
  • Added #140: ToolsBar button info.

Aut2Exe:

  • Fixed #1283: Added new option /x86 to force a 32-bit build and re-added /unicode which also forces a 32-bit build.

Au3check

  • Fixed #1239: Incorrect library search order.

Others

  • Added #1050: TextPad v5 syntax files installation.

UDFs:

  • Added: _GDIPlus_BrushGetSolidColor, _GDIPlus_BrushSetSolidColor
  • Added: $tagWIN32_FIND_DATA and corresponding attribute constants.
  • Added #868: _WinAPI_GetLayeredWindowAttributes(), _WinAPI_SetLayeredWindowAttributes().
  • Added: _Date_Time_ ... Str() can return date as yyyy/mm/dd.
  • Added #271: FTPEx.au3 for _FTP_...().
  • Added #932: mouse event constants in WinDowsConstants.au3.
  • Added #952: _ArrayDisplay() extra parameter for column header text.
  • Added #957: _Assert() in Debug.au3.
  • Added: _WinAPI_GetGuiResources()
  • Added #981: _WinAPI_WideCharToMultiByte(), _WinAPI_MultiByteToWideChar() support IN/OUT as "strings"
  • Added #1157: Encryption functions in Crypt.au3.
  • Added #1128: _WinAPI_PathFindOnPath() in WinAPI.au3.
  • Added #1228: _FTP_SetStatusCallback(), _FTP_DecodeInternetStatus() in FTPEx.au3.
  • Fixed #755: _FileReadToArray() removing empty end lines.
  • Fixed #773: Doc for _GUICtrlStatusBar_SetParts.
  • Fixed #786: _SQLite_Exec() does not return @error.
  • Fixed #809: _Soundxxx() with first parameter as filename.
  • Fixed #887: Related section based on Tweaky work.
  • Fixed #951: _ArrayDisplay() speed improvement for nb entries >4000.
  • Fixed: _SoundOpen() set @error on MCI Error.
  • Fixed #1015: _SQLite_SaveMode() renamed as _SQLite_SafeMode().
  • Fixed #1016: _WordDocSaveAs() Doc for error handling.
  • Fixed: Sound positioning in case of VBR Format Sound.
  • Fixed #1028: _Clipboard_GetData() fix.
  • Fixed #1031: _Clipboard_SetData() fix.
  • Fixed #1040: _ScreenCapture_Capture() leak memory.
  • Fixed #1026: _Gdiplus_BitmapCreate*() doc examples.
  • Fixed #1092: _Timer_...() datatype for X64.
  • Fixed #1059: Incorrect error handling in _FileListToArray().
  • Fixed #1101: _NowTime(), _NowDate() Doc.
  • Fixed: _WinAPI_GetWindowLong(), _WinAPI_SetWindowLong support X64.
  • Fixed #1111: Bad grammar in comments for _DateAdd().
  • Fixed: UDF library now uses #include "" instead of #include <>.
  • Fixed #1033: UDF library now has better and more consistent error handling when DllCall() is used.
  • Fixed #1215: _ArraySearch() not searching on 2D array.
  • Fixed #1168: _ExcelBookOpen() now selects the first visible worksheet to prevent a COM error.
  • Fixed #1247: Documented that some _GUICtrlComboBoxEx_* functions don't work with certain ComboBox styles.
  • Fixed #1260: Potential buffer overflow in _WinAPI_GetLastErrorMessage().
  • Fixed #1276: _TicksToTime() incorrectly rounded seconds up.
  • Fixed #1277: Resource clean-up in example script for _GDIPlus_ImageGetGraphicsContext.
  • Fixed #1290: Invalid Left coordinate when using _GUICtrlTreeView_DisplayRectEx().
  • Fixed #1296: _GUICtrlTreeView_ClickItem() could click outside the control's parent window.
  • Fixed #1312: Errors with _GUIImageList_BeginDrag() example.
  • Fixed #1320: _GUIImageList_DragMove() documentation contained a parameter that doesn't exist.
  • Changed: _StringBetween removed last optional param (not needed after change)(SmOke_N)
  • Changed: _StringToHex(), _HexToString() and _StringReverse() have been rewritten and are faster.
  • Changed: _SQLite 3.6.7 -> 3.6.19 (SQL statement support UNICODE characters)
  • Changed: _InetGetSource() now uses InetRead().
  • Removed: _StringAddThousandsSep() has been removed. Too many opinions on how the function should work means nobody is happy with it.
  • Removed #1112: __WinAPI_Check() has been removed as have all calls to it.

24th December, 2008 - v3.3.0.0

AutoIt:

  • Windows 9x and Windows NT 4.0 Operating System support has been removed.
  • Added: New flag for StringSplit() to not return the count in element 0.
  • Added #328: StringToASCIIArray(), StringFromASCIIArray() functions.
  • Added: New flag to Run()/RunAs() to fix issue #415 (Adds new Constants.au3 constant: $STDIO_INHERIT_PARENT).
  • Added: New flag to all Run functions for better CUI compatibility (Adds new Constants.au3 constant: $RUN_CREATE_NEW_CONSOLE).
  • Added #481: 11 pixel margin around the text in SplashTextOn() (Meets Vista UI guidelines).
  • Added #468: Added @MSec macro for obtaining the current milliseconds for the current second.
  • Added #277: @CPUArch macro to return the capability of the processor.
  • Added #454: $FO_UTF8 allowing FileOpen() in Read mode for reading UTF8 files without BOM.
  • Added: $FO_UTF16_LE, $FO_UTF16_BE allowing FileOpen() in Read mode for reading UTF16 files without BOM.
  • Added #407: Documented that For...In loops are read-only.
  • Added #645: IniDelete() now supports the Default keyword for the 3rd parameter.
  • Fixed: Send() was incorrectly inserting a leading zero when using the {ASC 0xNNNN} format.
  • Fixed #305: GUICtrlSetFont() for Combo causing highlight.
  • Fixed #318: GUICtrlSetTip() on TreeViewItem must return 0.
  • Fixed #339: GUICtrlDelete() crashes.
  • Fixed #345: @OSVersion for Windows 2008.
  • Fixed #366: AutoIt crash on bad syntax.
  • Fixed #380: @OSVersion for Windows XP 64-bit Edition.
  • Fixed #346: FileOpenDialog()/FileSaveDialog() filter length limit.
  • Fixed #387: DllClose() and DllCallbackFree() crashing when an invalid handle used.
  • Fixed #449: @SystemDir does not return SysWOW64 under X64 in 32-bit mode.
  • Fixed #440: Fatal error when script ends with EOF (0x1A).
  • Fixed #464: Example script for GUICtrlCreateAvi() did not work on Vista.
  • Fixed #484: ObjGet() would crash when invalid files were specified.
  • Fixed #501: ProcessGetStats() failed for processes running as other users (including SYSTEM).
  • Fixed #92: DllStruct data truncated with char[]/wchar[].
  • Fixed: GuiCtrlSetState($graphic, $GUI_HIDE) does not hide.
  • Fixed: GuiCtrlSetResizing($graphic, ) not moving.
  • Fixed: GuiCreate(...,Style without caption) does not resize properly.
  • Fixed: GuiSetStyle(caption change) does not resize properly.
  • Fixed: GuiCtrlSetState($listviewitem) does not return error.
  • Fixed #562: Specifying the TITLE property caused all other properties to be lost (Window title matching).
  • Fixed #569 TCPRecv() doc example.
  • Fixed #589: Some comparison operators did not return a boolean value.
  • Fixed #583: Bad formatting of @MSEC in documentation.
  • Fixed #574: Using 0 for the SendKeyDelay or SendKeyDownDelay removes the respective delay when using Send().
  • Fixed #542: Crash with regular expressions.
  • Fixed #531: Clarification of some of the remarks for GUICtrlSetGraphic().
  • Fixed #539: StringSplit() with flag 2 and no matching delimiters wasn't returning the full string.
  • Fixed #601: Tooltip return 0 when title length >99.
  • Fixed #608: listView GUICtrlSetBkColor() not redrawn.
  • Fixed #628: GuiCtrlRead($ctxmenu, $adv) bad return.
  • Fixed #640: PCRE does not support \L, \l, \N, \U, or \u : doc updated
  • Fixed #642: Installer now correctly opens the merged helpfile to the history page instead of the AutoIt-only helpfile.
  • Fixed #646: Call() now sets specific @error and @extended values when it fails to find a function.
  • Fixed #669: Typo in Dec() example.
  • Fixed #659: Documented that UNC paths are not supported when using FileSelectFolder().
  • Fixed #671: Crash when using $WS_EX_MDICHILD without specifying a valid parent.
  • Fixed: Crash when using BinaryToString() with invalid UTF16 input string. BinaryToString() now has new @error codes to support diagnosing invalid input.
  • Fixed #743: AutoIt Crash when Tray functions are use with invalid ID.
  • Fixed #748: AutoIt Crash with DllCall(0,...).
  • Changed #393: Documented that SoundSetWaveVolume() works differently in Windows Vista.
  • Changed: PCRE regular expression engine updated to 7.8.
  • Changed: @ProcessorArch changed to @OSArch as it was misleading.
  • Changed: Size limits removed from RegRead() and RegWrite() (previously 64KB for some registry types).
  • Changed: RegRead() and RegWrite() no longer use hex strings for REG_BINARY types - native binary datatypes are enforced.

AutoItX:

  • Changed: Native DLL: All string methods in the native API are now Unicode. The majority of functions no longer have ANSI versions.
  • Added: COM: WinList method.
  • Fixed: Native DLL: Return strings were sometimes incorrectly terminated.
  • Fixed: PixelChecksum() not returning correct values.

Aut2Exe:

  • Fixed #436: Compression level was ignored when performing compilation from the GUI.
  • Added #460: More verbose UPX errors.

UDFs:

  • Added: _GDIPlus_StringFormatSetAlign
  • Added: _StringExplode()
  • Added: _GDIPlus_ImageGetFlags, _GDIPlus_ImageGetHorizontalResolution, _GDIPlus_ImageGetPixelFormat, _GDIPlus_ImageGetRawFormat
    _GDIPlus_ImageGetType, _GDIPlus_ImageGetVerticalResolution
  • Added: _PathGetRelative
  • Added: _ArrayCombinations, _ArrayPermute, _ArrayUnique
  • Added: _WinAPI_CreatePen, _WinAPI_DrawLine, _WinAPI_LineTo, _WinAPI_MoveTo, _WinAPI_GetBkMode, _WinAPI_SetBkMode
  • Added: _WinAPI_CombineRgn, _WinAPI_CreateRectRgn, _WinAPI_CreateRoundRectRgn, _WinAPI_SetWindowRgn
  • Added: _ExcelHorizontalAlignSet, _ExcelFontSetProperties, _ExcelBookAttach
  • Added: _WinAPI_SetEndOfFile, _WinAPI_SetFilePointer
  • Added: Missing FrameConstants.au3
  • Added: Excel UDFs
  • Added: _Timer_GetIdleTime, _WinAPI_GetWindowPlacement, _WinAPI_SetWindowPlacement
  • Added #332: Remarks to _GUICtrlStatusBar_Create
  • Added #275: _GDIPlus_GraphicsFillPolygon
  • Added: _GUICtrlTab_ClickTab
  • Added: _GUICtrlComboBoxEx_GetUnicode, _GUICtrlComboBoxEx_SetUnicode
  • Removed: _StringSplit, no longer needed
  • Fixed #693: _DateTimeFormat() time format
  • Fixed #701: _GUICtrlListView_ClickItem() Clicks in the wrong place when $fMove = True
  • Fixed #700: _GUICtrlTreeView_ClickItem() Clicks in the wrong place when $fMove = True
  • Fixed #703: _GUICtrlListBox_ClickItem() Clicks in the wrong place when $fMove = True
  • Fixed #705: _GUICtrlToolbar_ClickButton() Clicks in the wrong place when $fMove = True
  • Fixed #707: _GUICtrlMonthCal_Create() width and height
  • Fixed #674: _GUICtrlTab_ClickTab() Clicks in the wrong place when $fMove = True
  • Fixed #610: _WinAPI_CreateFile() wrong return value upon failure
  • Fixed #619: _GUICtrlListView_SetItemSelected memory allocation
  • Fixed #617: corrections to six GDI+ ImageGet help file examples
  • Fixed #621: _StringAddThousandsSep don't work with negative number
  • Fixed #635: _GuiCtrlTab_ClickTab() docs list unused $fPopupScan parameter
  • Fixed #650: Missing BorderConstants.au3
  • Fixed #656: _FileCountLines returns 0 if file only contains 1 line
  • Fixed #600: _ArraySearch fails with 2D array.
  • Fixed #603: _FileReadToArray() does not return an array if the file contains only a single line of text.
  • Fixed #495: _GUICtrlTreeView_GetTree returns only 1 parent
  • Fixed #503: _Date_Time_FileTimeToLocalFileTime example
  • Fixed #510: _GUICtrlListView_ClickItem: If columns inside listview exceed visible area, clicks outside of the control
  • Fixed #500: _ChooseColor run on 64bit
  • Fixed #517: WinAPI UDF - bad error checking after DllCall()
  • Fixed #533: Array functions dimension check
  • Fixed: various Timer Functions
  • Fixed #506: _FileCountLines deal with all common line-end-chars
  • Fixed #485: WinAPI missing related links in helpfile
  • Fixed #571: return value doc for _GUICtrlListBox_FindString, _GUICtrlListBox_GetAnchorIndex and _GUICtrlListBox_GetText
  • Fixed #586: _GuiCtrlListView_SetGroupInfo() destroyed group ID's.
  • Fixed #516: _ChooseFont run on 64bit
  • Fixed #595: _WinAPI_SetWindowsHookEx help file description of $WH_KEYBOARD_LL
  • Fixed #465: _DateTimeSplit if seconds omitted defaulted to -1, now defaults to 0
  • Fixed: Excel Examples
  • Fixed #422: _GDIPlus_GraphicsSetSmoothingMode $iSmooth accepts only 0 - 4, doc updated
  • Fixed #388: _GUICtrlToolbar_SetButtonSize Example
  • Fixed #400: SQLite.dll.au3 @ProcessorArch replaced with @OSArch
  • Fixed #390: _viPrintf replaced return type
  • Fixed #371: _GDIPlus_Startup return value
  • Fixed #368: _ArrayToClip return value
  • Fixed #361, #362: _GUICtrlListView_InsertItem doc
  • Fixed #285: _ChooseColor Example
  • Fixed #299: _GUICtrlTab_SetItemText buffer length for Unicode
  • Fixed #292: _EventLog__Clear not clearing log when backup parameter is empty
  • Fixed #258: _ClipBoard_GetData
  • Fixed #294: _FileReadToArray where the file contains no @LF
  • Fixed #303: Clock.au3 in Examples\GUI\Advanced
  • Fixed: _GUICtrlListView_SetItemEx text buffer
  • Fixed #320: _WinNet_EnumResource struct pointers
  • Fixed #321: _GUICtrlStatusBar_GetText buffer length for Unicode
  • Changed: StringAddThousandsSep params in regards to #442
  • Changed #733: Doc for _GUICtrlButton_SetImageList
  • Changed: _SQLite -> 3.6.7
  • Changed #442: _StringAddThousandsSep() allows for regional settings
  • Changed #290: _GDIPlus_DrawImagePoints
  • Changed: _Soundxxxx functions
  • Changed #599: _FileListToArray speed optimization

12th June, 2008 - v3.2.12.1

AutoIt:

  • Fixed: RunAs() and RunAsWait() now use @SystemDir as the working directory instead of @WorkingDir when a user-supplied working directory is not specified.
  • Fixed: Contextmenuitem not firing events.
  • Fixed: Icon transparency refresh when on tab regression.
  • Fixed: RunAs() under Windows 2000.

16th May, 2008 - v3.2.12.0

AutoIt:

  • Removed: Unnecessary optional parameter from ProcessClose().
  • Removed: RunAsSet(). (Replaced with RunAs() and RunAsWait())
  • Removed: RunErrorsFatal option ( Opt() ).
  • Removed: ColorMode option ( Opt() ).
  • Changed: @Unicode renamed to @AutoItUnicode. @Unicode is an alias for now. It will be removed > 3.2.14.0
  • Changed: The behavior of StdoutRead(),
    StderrRead(),
    StdinWrite() and
    ConsoleRead() has been changed.
  • Changed: PCRE regular expression engine updated to 7.6.
  • Changed: AutoIt internet functions (e.g. InetGet()) now use "AutoIt" as a user-agent. Previously using blank
    which was blocked by many websites.
  • Changed: ControlClick() now accepts the same mouse buttons as MouseClick() - left/right/middle/primary/secondary/main/menu.
  • Changed: Maximum controls in a GUI window 4093 -> 65532.
  • Changed: @OSVersion can now return "WIN_2008" for Windows Server 2008.
  • Added: RunAs(), RunAsWait().
  • Added: GUISetAccelerators().
  • Added: REGEXPCLASS in Advanced Window and control definitions.
  • Added: X, Y, W, H in advanced window/control definitions.
  • Added: DllCall() new types int_ptr, uint_ptr, long_ptr, ulong_ptr. Special types that change size on x86/x64.
  • Added: "REG_QWORD" type for RegWrite().
  • Added: HotKeySet() modified to work with the {} notation.
  • Added: FileReadLine( ,-1) read last line.
  • Added: Std I/O redirection works with RunAs...().
  • Added: Std I/O merged flag for using the same stream for stdout/stderr.
  • Added: Std I/O supports binary data.
  • Added: ConsoleWrite()/ConsoleWriteError() now return the amount of data written.
  • Added: Remarks in Run() about how to close streams/release resources associated with STDIO.
  • Added: StdioClose() function to force STDIO data closed for a process.
  • Added: ProcessClose() now closes processes started by other users.
  • Added: ProcessWaitClose() returns exitcode in @extended.
  • Added: Pixel...() can specify a window handle as last parameter.
  • Added: "start" and "count" parameters added to StringInStr().
  • Added: GUICtrlSetDefColor(), GUICtrlSetDefBkColor().
  • Added: Added parent window parameter to MsgBox(),
    FileSelectFolder(),
    FileOpenDialog(),
    FileSaveDialog().
  • Fixed: DllCall() setting wrong @error values.
  • Fixed: BlockInput() returns errors.
  • Fixed: WinWaitActive() not matching (more frequent with Windows Vista).
  • Fixed: GUICtrlSetState($GUI_SHOW) on hidden radio on an active tab.
  • Fixed: SciTe Lite not installed in the AutoIt chosen release directory.
  • Fixed: WinMove() with Speed = 0 crash the script.
  • Fixed: Mysterious UDF return value of 1 when no explicit value was set.
  • Fixed: ControlCommand(), "GetLineCount".
  • Fixed: TraySetState(4) flashing tray icon for Windows Vista.
  • Fixed: ProcessExists() wrong return.
  • Fixed: StringRegExp() crashing under Win95.
  • Fixed: Handle leak when using Run() with I/O redirection.
  • Fixed: Disabled input control background on tab control.
  • Fixed: GUICtrlDelete() of a tab if two GUI windows are used.
  • Fixed: AutoIt crash in Random() when range exceeds 2^31.
  • Fixed: #include parsing error detection.
  • Fixed: Array entry passed Byref to a UDF.
  • Fixed: FileSetTime() erroneously rounds UP on non NTFS partition.
  • Fixed: STDIO redirection sometimes failed on Windows 9x.
  • Fixed: IniReadSectionNames() returning incorrect number of sections under Win9x.
  • Fixed: AutoIt tray icon removal on script exiting.
  • Fixed: AutoIt crash when removing ObjEvent() object.
  • Fixed: ObjEvent() handler can destroy return of AutoIt Function : as winwait("title") can return 0.
  • Fixed: DirMove() on different volume.
  • Fixed: Crash with RegRead() and REG_MULTI_SZ on x64.
  • Fixed: Various Edit control focus and DefPushButton issues.
  • Fixed: ControlTreeview() returning @error=1 on success.
  • Fixed: COM objects could lose numeric precision.
  • Fixed: StringReplace() with start float number.
  • Fixed: ControlCommand() "SelectString" wrong selection.
  • Fixed: StringSplit() flag=1 delimiters not case sensitive.
  • Fixed: In advanced Window descriptions only semi-colon must be escaped.
  • Fixed: ObjGet() memory leak.
  • Fixed: Modified AutoUpdateIt.au3 to work under x64.
  • Fixed: Resizing GUI before GUISetState().
  • Fixed: Radio events fired when GUI reactivated.
  • Fixed: GUICtrlDelete() on contextMenuItem.
  • Fixed: An attempt to FileDelete() a file that was just executed with RunWait() would sometimes fail.
  • Fixed: GUI performance problem when creating a large number of windows.
  • Fixed: GuiGetCursorInfo() with swapped mouse buttons.

AutoItX:

  • Added: ControlTreeView().
  • Fixed: ControlListView() for native DLL version.

Aut2Exe:

  • Added: Option to compile scripts as console applications.

AU3Info:

  • Changed: Controls are always highlighted when using the finder tool.
  • Changed: Controls are not highlighted by default.
  • Changed: Control description gives the advanced version of class and instance.

SciTe "lite":

  • Updated the source to version 1.75
  • Added Save Dialog extension.

UDFs:

  • See the script breaking changes page.

25th November, 2007 - v3.2.10.0

  • Changed: DllCall() new method of passing types by reference using *.
  • Changed: DllCall(): short_ptr, long_ptr, int_ptr types deprecated. Use short*, long* and int* respectively.
  • Changed: Limits on Execute() removed.
  • Changed: PCRE regular expression engine updated to 7.4.
  • Added: 64bit (x64) versions of AutoIt, Aut2Exe, Au3Info and AutoItX (see here).
  • Added: DllCallbackRegister(),
    DllCallbackGetPtr() and
    DllCallbackFree()
  • Added: DllCall() now accept doubles, int64, uint64, wparam and lparam types.
  • Added: SendKeepActive().
  • Added: ControlTreeView().
  • Added: ProcessGetStats().
  • Added: VarGetType().
  • Added: @AutoItX64 macro.
  • Added: Au3Info: Handle info for windows and controls.
  • Added: DllStructCreate() added "align" keyword to set structure alignment.
  • Fixed: Control...() functions using CLASS and TEXT together sometimes incorrect.
  • Fixed: Control...() functions using CLASSNN sometimes incorrect.
  • Fixed: Windows Vista taskbar previews causing problems with windows matching.
  • Fixed: $var = $var was not giving an error when $var didn't already exist.
  • Fixed: GUICtrlSetImage() sizing regression from 3.2.4.9.
  • Fixed: GUICtrlCreateListView() with no column.
  • Fixed: Extra notification on colored button.
  • Fixed: IniReadSectionNames() for [] sections.
  • Fixed: Opt("WinTitleMatchMode", Default) fatal error.
  • Fixed: GUICtrlSetStyle() with $ES_READONLY bad $WS_TABSTOP.
  • Fixed: AutoIt crash on exit if Win...() used with a Title being a COM object.
  • Fixed: ProcessExists() on service process under Win2K.
  • Fixed: DefPushButton behavior.
  • Fixed: ControlCommand(SelectString) order selection.
  • Fixed: Array cannot have 2^24 entries.
  • Fixed: GuiCreateMenu() on a windows without title and without client area.
  • Fixed: WinWaitActive() sometimes failing after a WinActivate().
  • Fixed: Looping GUIRegisterMsg() doesn't unregister.
  • Fixed: Focus on ES_READONLY edit control.
  • Fixed: Numerous UDF fixes.

10th September, 2007 - v3.2.8.1

  • Fixed: Possible crash with StringRegExp().

8th September, 2007 - v3.2.8.0

  • Changed: General speed improvements (currently up to 24% in some cases compared to 3.2.6.0).
  • Changed: PCRE regular expression engine updated to 7.3.
  • Changed: Recursion-based code limits relaxed.
  • Added: wchar type added to DllStructCreate().
  • Added: WinMove() speed parameter.
  • Fixed: Crash on AutoIt exit if TrayCreateItem() is not deleted.
  • Fixed: AutoIt crash on bad parameter when calling TrayCreateMenu()
  • Fixed: Character positions used in StringRegExp() not correct for characters > 127 (accents, non-Western)
  • Fixed: ProcessExist() under Windows 9x.
  • Fixed: GUISetState(@SW_DISABLE) not disabling keyboard input.
  • Fixed: Sometimes AutoIt crashes on DllStructGetData() with char[] types.
  • Fixed: Au3Info restoring last settings at startup.
  • Fixed: Better handling of notifications when using colored buttons.
  • Fixed: ControlGetText() crash on Scite windows.
  • Fixed: $LVSCW_AUTOSIZE column truncates display string.
  • Fixed: Incorrect listview creation with GUICtrlCreateListView().
  • Fixed: Memory leak when AutoIt needed to get long file name.
  • Fixed: ListviewItem not created after other child Window creation/deletion.
  • Fixed: ControlGetFocus() returning bad ClassNN values.
  • Fixed: Detection of invalid CONTINUELOOP statement.

24th August, 2007 - v3.2.6.0

  • Changed: IconId in all GUI functions is now the same as GUICtrlSetImage().

    WARNING: Previous scripts using GUICtrlSetImage(), GUISetIcon(), TraySetIcon() and TraySetPauseIcon()
    may display a wrong Icon. To get the same icon "if nId > 0 Then newId = - nId - 1".
  • Changed: AutoIt .a3x and compiled script format. Exe2Aut will only decompile 3.2.5.1
    and earlier files. No ExeAut utility is supplied for ongoing versions.
  • Changed: General performance improvements (currently around 30-40% over 3.2.4.9)
  • Changed: Limited Unicode support added in regular expressions.
  • Changed: ControlMove() just resizing as WinMove() if X=Y=Default.
  • Changed: PCRE engine updated from 7.0 to 7.1
  • Changed: Suppress delay when speed=0 in MouseMove().
  • Added: GUIGetStyle().
  • Added: byte and ubyte type to DllCall().
  • Added: ClassnameNN in control and summary info in Au3Info.
  • Added: Float type to dllCall. (Thanks PaulIA)
  • Added: AU3Check v1.54.8 support for both "#AutoIt3Wrapper_plugin_funcs" and "#Compiler_plugin_funcs".
  • Added: Extra parameter in ProcessClose() to close Stream handles.
  • Fixed: AutoIt crash on WinWait("","text") when a Scite is open.
  • Fixed: Some crashes on Chinese systems during Unicode/ANSI conversions.
  • Fixed: Aut2Exe crashing on Chinese systems when running in ANSI.
  • Fixed: Wrong Notification on {ENTER} after clicking on a listviewItem.
  • Fixed: Wrong resetting of image on listviewitems if image set on the listview.
  • Fixed: Resizing of listview control.
  • Fixed: @error not set on bad WinGetPos() return.
  • Fixed: LVM_EDITLABEL hogging cpu.
  • Fixed: AutoIt (non UNICODE version) crash with some COM objects.
  • Fixed: GUISetState() on GUI with W=0 or H=0.
  • Fixed: GUI control Tip not reappearing after a click or timeout.
  • Fixed: GUI controls not at the right position if a Control menu is in use.
  • Fixed: EnvUpdate() in UNICODE AutoIt version not working since 3.2.3.3.
  • Fixed: FileRead(..., count) returning count-1 chars.
  • Fixed: Unicode filenames in FileInstall().
  • Fixed: LVS_EX_HEADERDRAGDROP extendedstyle.
  • Fixed: UpDown control shows through tabbed pages.
  • Fixed: GUICtrlSetState on UPDOWN control without changing the state.
  • Fixed: FileInstall() in compiled scripts causing GUI problems.
  • Fixed: ControlGetFocus() on control not created with AutoIt GUI.
  • Fixed: @AutoItPID and processlist coherency under Win9x.
  • Fixed: GUICtrlSetResizing not returning error on non resizable control.
  • Fixed: Regression for ControlSend SHIFTDOWN/UP since 3.2.3.13.
  • Fixed: Drag and drop on a listview control after clicking on its header.
  • Fixed: Support "resource only" dlls for GUISetImage().
  • Fixed: Default minimum for GUICtrlSetLimit() set to 0.
  • Fixed: Z order after GUICtrlSetStyle() on edit or input control.
  • Fixed: FileReadLine() getting bad cached data when reading specific line numbers with file handles.
  • Fixed: Slight lag in GUIGetMsg() under certain circumstances.
  • Fixed: StringReplace() and occurances parameter.
  • Fixed: GuiCtrlSetFont() on Tab control.
  • Fixed: Leading blanks before #include cannot be compiled.
  • Fixed: Notification on ENTER on Colored button.
  • Fixed: RegWrite() setting bad registry entry in certain circumstances.
  • Fixed: AutoIt hogging CPU when text msgbox too big.
  • Fixed: ControlSend() sometime to wrong control when using empty controlid.
  • Fixed: ProcessExists() under Win2K with processname >15 chars.
  • Fixed: Int() with string comparison wrong match.
  • Fixed: InetGetSize() in unicode version returns 0.
  • Fixed: GUICtrlCreateListview() with more than 254 columns.
  • Fixed: AutoIt Crash on recursive RegExp.
  • Fixed: BitRotate() with left bit set.
  • Fixed: Filemove() returning 1 without any move.
  • Fixed: FileRead() returning chr(0) in ANSI mode.
  • Fixed: Au3Info control coords relative to client.
  • Fixed: StringInStr() not returning 0 when searching backward and search length greater than string.

25th May, 2007 - v3.2.4.9

  • Added: StringCompare()
  • Fixed: Basic string comparisons were not working with locale as in previous versions.

23rd May, 2007 - v3.2.4.8

  • Fixed: Errors with non-western codepages and ANSI format scripts.

22nd May, 2007 - v3.2.4.7

  • Added: Aut2Exe options for forcing ANSI mode compilation (/ansi and /unicode)
  • Added: StringToBinary()
  • Added: Additional unicode related options for BinaryToString()

20th May, 2007 - v3.2.4.6

  • Fixed: StringReplace() and occurances parameter.

20th May, 2007 - v3.2.4.5

  • Added: BinaryToString() for binary buffer to ANSI string quick conversions.
  • Added: @Unicode macro to show if AutoIt is being run in Unicode or ANSI mode.
  • Changed: StringReplace() speeded up - a lot.
  • Changed: Au3Info is now resizable.
  • Fixed: Chr(0) now properly works with Binary()

17th May, 2007 - v3.2.4.4

  • Fixed: Chr(0) now acting more sensible (now acts in a similar way to VBScript).

17th May, 2007 - v3.2.4.3

  • Fixed: FileRead() not working properly with unicode files.

15th May, 2007 - v3.2.4.2

  • Changed: Au3Info graphical tweaks and Summary tab.
  • Fixed: FileReadLine() getting bad cached data when reading specific line numbers with file handles.
  • Fixed: Slight lag in GUIGetMsg() under certain circumstances.

13th May, 2007 - v3.2.4.1

  • Added: ChrW() and AscW() for unicode operations.
  • Fixed: Chr() and Asc() for character codes 128-255 in unicode mode.
  • Fixed: Unicode BOM was not being written in file append modes if the file was empty.
  • Fixed: Error in Include\GuiCombo.au3 and Include\IE.au3.

10th May, 2007 - v3.2.4.0

Big changes:

  • AutoIt is now compiled for Unicode! AutoIt3.exe is Unicode - AutoIt3A.exe is ANSI. For more details see this page.
  • Au3Info tool rewritten.
  • Binary data functions completely rewritten - scripts using these functions will need to be changed.

Other changes:

  • Added: New modes for FileOpen() to force Unicode and binary operations.
  • Added: BinaryLen(), BinaryMid()
  • Added: Colored GUI buttons.
  • Added: DllStruct...() can reference elements by name rather than index.
  • Changed: Removed restrictions on the maximum number of #include directives.
  • Changed: Removed restrictions on the maximum number of DllOpen() handles.
  • Changed: Removed restrictions on the maximum number of open files.
  • Changed: Removed restrictions on the maximum number of hotkeys.
  • Changed: Performance improvements in StringStripWS().
  • Changed: Binary data in variants are now treated as a special type, separate from normal strings.
  • Changed: BinaryString() renamed to Binary()
  • Changed: IsBinaryString() renamed to IsBinary()
  • Changed: ControlClick() can now click a control at a certain position.
  • Changed: ControlClick() can now properly simulate double-clicks.
  • Changed: ControlClick() no longer forces the activation of the parent window (up to the user now).
  • Changed: ControlClick() related coordinates added to Au3Info.
  • Changed: Improved the searches that can be done for windows/controls/instances.
  • Changed: From DEFAULT_QUALITY to PROOF_QUALITY for Change/Set Font functions.
  • Changed: x^y compatible with C99 standard.
  • Fixed: Possible crash when using StringStripWS(), flag 4 and empty strings.
  • Fixed: GUICtrlSetLimit() for UpDown controls wher min = max.
  • Fixed: GuiCtrlSetTip() not always working correctly.
  • Fixed: Slow GUI tab redrawing under Windows Vista fixed.
  • Fixed: HotKeySet bad notification.
  • Fixed: FileGetAttrib() on pagefile.sys.
  • Fixed: Invalid default parameter in GUICtrlSetData() not detected.
  • Fixed: Assign does return error on array element.
  • Fixed: FileOpen("test.txt", 2+8) returning error.
  • Fixed: Error detection in Enum statement.
  • Fixed: Opt("WinTitleMatchMode").
  • Fixed: Stack corruption resulting from improper use of DllCall() now gracefully aborts the script instead of hard crashing.
  • Fixed: Crash when reading empty REG_MULTI_SZ.
  • Fixed: Round() not returning an integer.
  • Fixed: ControlSend() to empty "" ctrl fixed for inactive window. Also shift state behavior.
  • Fixed : O^(-1).
  • Fixed: Non detection of illegal statement.
  • Fixed: HotKeySet("^{PAUSE]",... notification.
  • Fixed: {CTRLBREAK} ->{BREAK} as ctrl is user responsability.
  • Fixed: $var = Default passed as parameter to Com object.
  • Fixed: Edit control would always have focus the first time the GUI was displayed even if it shouldn't. This behavior also ignored $GUI_FOCUS.
  • Fixed: range value for seed Number in SRandom().
  • Fixed: Fileread crash if no count in raw mode.
  • Fixed: Opt("WinTitleMatchMode", <0) really matching case insensitive.
  • Fixed: FileSetAttrib/FileSetTime wrong setting.
  • Fixed: Execute/Call recursive overflow display error message.
  • Fixed: Aut2exe warning message if icon not found.
  • Fixed: WinGetTitle() returns 1 on error.
  • Fixed: Memory leak on keyword variable deallocation.

19th December, 2006 - v3.2.2.0

  • Added: StringRegExp() and StringRegExpReplace() regular expression support (Perl compatible)
  • Added: Regular expression support for Window title matching.
  • Added: ShellExecute() and ShellExecuteWait() functions.
  • Added: #RequireAdmin for UAC/Windows Vista
  • Added: Windows vista help file entry.
  • Added: GuiCtrlSetState() $GUI_DROPNOTACCEPTED.
  • Added: $GUI_FOCUS, $GUINOFOCUS for listviewitem control.
  • Added: IsDllStruct()
  • Added: SRandom() to set seed for random number generation.
  • Added: WinTitleMatchMode for case insensitive matching.
  • Added: Listview Alternate coloring with $GUI_BKCOLOR_LV_ALTERNATE.
  • Added: IconId can be referenced by ordinal value if negative 1-based index is used.
  • Added: CompiledScript string file info for compiled script.
  • Added: Support >32x32 icon from .exe/.dll in GUICtrlCreateIcon or GUICtrlSetImage.
  • Added: Expanded GUICtrlSetTip() to allow creation of tooltips with titles, icons and using the balloon tip style.
  • Added: Tooltip supports Default keyword.
  • Added: Remark added to _PathSplit() mentioning that it does not accept command line strings, only paths.
  • Added: 2 UDF's to GUIStatusBar.au3.
  • Added: GUICtrlCreateIcon and GUICtrlSetImage can select in multiple icon file by name.
  • Added: @KBLayout to retrieve the current keyboard configuration.
  • Added: ToolTip() option to ensure the tooltip is always displaying on a monitor.
  • Added: IniWriteSection() function.
  • Added: @extended error code on DriveMapAdd error.
  • Added: Listview Alternate coloring with $GUI_BKCOLOR_LV_ALTERNATE.
  • Changed: Performance improvements (up to 100% on some scripts!).
  • Changed: @error set to WinAPI GetLastError() for Run().
  • Changed: Small tweak to Floor() to ensure it is not as susceptible to floating point precision errors.
  • Changed: Small tweak to Ceiling() to ensure it is not as susceptible to floating point precision errors.
  • Changed: PixelChecksum() is now over 30x faster.
  • Changed: FileGetVersion() extra parameter to retrieve string file info.
  • Fixed: MsgBox() timeout on Windows Vista.
  • Fixed: GuiCtrlRead on listview control when sorted.
  • Fixed: @OSVERSION on Windows 9x.
  • Fixed: GuiGetCursorInfo() with Handle not retrieving mouse click info.
  • Fixed: DllCall() crashes when using uint, ushort.
  • Fixed: List control height when font size changes.
  • Fixed: GUICtrlSetImage() not testing icon on error.
  • Fixed: @ScriptDir equal @WorkingDir for rootdir (x:\).
  • Fixed: GUIGetCursorInfo() (winhandle) when child not active.
  • Fixed: _StringAddComma().
  • Fixed: drag & drop $GUI_EVENT_DROPPED notififation on edit control.
  • Fixed: Coherency of type parameter for DLLCall() and DLLSructCreate()
  • Fixed: Default keyword didn't always work correctly with COM objects.
  • Fixed: COM property write fails when using arguments.
  • Fixed: Send/ControlSend for US international keyboard.
  • Fixed: Send/ControlSend char>=chr(128) for english keyboards.
  • Fixed: COM property write fails when using arguments.
  • Fixed: MsgBox() with task modal flag left GUI's disabled on timeout.
  • Fixed: Error reporting by messagebox even with /ErrorStdOut.
  • Fixed: GUICtrlSetImage default icon value for Icon Ctrl.
  • Fixed: GUIRegisterMSG() destroyed @error.
  • Fixed: $LVS_SORTASCENDING with GUICtrlSetImage icon gave bad display.
  • Fixed: Some Object Collections could not be parsed in one AutoIt statement.
  • Fixed: Bad screen updating of already unchecked radiobuttons.
  • Fixed: Tray icon tooltip not displaying the scriptname when compiled.
  • Fixed: UDP... return code on error.
  • Fixed: UDPRecv() crashed on bad parameter.
  • Fixed: COM was corrupting floating point values.
  • Fixed: GUICtrlSetState doc remarks about menu control.
  • Fixed: Refresh after a GUICtrlSetBkColor().
  • Fixed: Crash on line begining with ~ : "Unable to parse line".
  • Fixed: IniReadSectionNames() returned bogus data in Windows 98 when the INI file was empty or did not exist.
  • Fixed: @compiled when the script is compiled.
  • Fixed: Send() to italian keyboard.
  • Fixed: MouseMove() in secondary screen.
  • Fixed: StringInStr() not converting to string search parameter.
  • Fixed: Int() of a binarystring.
  • Fixed: ControlSend sending() special characters.
  • Fixed: Crash in Au3exe with badly formed input file in FileInstall().
  • Fixed: Wrong execution of a compiled script containing FileInstall() inside #CS-#CE.
  • Fixed: FileInstall() referencing a file without any path will reference it from the ScriptDir to be coherent with the compiled script.
  • Fixed: Aut2exe crashed using cmdline with shortnames.
  • Fixed: Tooltip state (such as icon or title) was showing up on subsequent tooltips that didn't want those items. This affected both ToolTip() and GUICtrlSetTip().)
  • Fixed: GUIRegisterMSG() destroy @error.
  • Fixed: $LVS_SORTASCENDING with GUICtrlSetImage() icon bad display.
  • Fixed: Wrong default arguments for _ArrayToString().
  • Fixed: Bad "#" instruction inhibit whole script.

13th August, 2006 - v3.2.0.1

  • Fixed: (AU3INFO) Buffer overrun in control code.
  • Fixed: Exe2Aut.exe was missing its digital signature.

12th August, 2006 - v3.2.0

  • Added: COM object support.
  • Added: "Lite" version of the SciTE editor added into the AutoIt installation.
  • Added: Aut2Exe can now create .a3x encoded files (similar to .zip for .au3).
  • Added: Support for custom tray icons.
  • Added: "default" keyword.
  • Added: IsKeyword() so "default" keyword can be used as parameter in a user function call.
  • Added: Boolean support and keywords of 'false' and 'true'.
  • Added: IsBool()
  • Added: +=, -=, *=, /= operators.
  • Added: DLLCall() cdecl and stdcall support.
  • Added: DLLStruct... functions.
  • Added: Limited TCP and UDP functions.
  • Added: Added support for reading and writing stdio.
  • Added: ConsoleRead(), ConsoleWriteError().
  • Added: Ability to initialize arrays in DIM and CONST keywords.
  • Added: Switch, EndSwitch structure.
  • Added: HWnd() and IsHWnd() functions.
  • Added: BinaryString(), IsBinaryString() functions.
  • Added: FileCreateNTFSLink().
  • Added: /AutoIt3ExecuteScript command line option.
  • Added: Call() now supports parameters.
  • Added: Execute()
  • Added: @HotKeyPressed macro.
  • Added: Unary NOT operations on strings are now allowed. A NOT operation on a non-empty string will result in FALSE.
  • Added: Beep() and WinFlash() functions.
  • Added: Floor() and Ceiling() functions.
  • Added: SetError can optionally set @extended.
  • Added: RegRead, RegEnumVal return the type of the value in @extended.
  • Added: FileSaveDialog(), FileOpenDialog() supports multiple filter groups.
  • Added: @ScriptLineNumber, @ProcessorArch, @AutoItPID.
  • Added: BitRotate().
  • Added: Fileopen(), FileCopy(), FileMove() additional flags to create non existent subfolders.
  • Added: FileRead(), FileWrite() work with binary files.
  • Added: (GUI) GUICtrlSetData text for treeview.
  • Added: (GUI) $WS_EX_MDICHILD support for GUICreate().
  • Added: (GUI) GUICtrlCreateGraphic(), GUICtrlSetGraphic().
  • Added: (GUI) Opt('GUIEventOptions',1) to suppress window action when clicking on Minimize,restore or Maximize buttons.
  • Added: (GUI) Right-click support for List/Treeview GUI control.
  • Added: (GUI) GuiCtrlRead return ControlID if Opt("GUIEventCompatibilityMode',2).
  • Added: (GUI) GUICtrlCreateMonthCal().
  • Added: (GUI) Opt("GUIDataSeparatorChar",...).
  • Added: (GUI) GUICtrlCreateObj().
  • Added: (GUI) GUICtrlSetColor(), GUICtrlSetBkColor(), GUICtrlSetImage() for ListviewItem controls.
  • Added: (GUI) GuiSwitch tabitemID optional parameter to allow dynamic control creation on a tabitem.
  • Added: (GUI) GuiCtrlListView support Icon view.
  • Added: (GUI) $GUI_WS_EX_PARENTDRAG Allow the label or pic control to be used as the title bar to drag the whole the parent window.
  • Added: (GUI) GUICtrlGetHandle().
  • Added: (GUI) $GUI_EVENT_DROPPED @GUI_DRAGID,@GUI_DROPID.
  • Added: (GUI) GuiSetCursor(16),GuiCtrlSetCursor(16) hide the cursor.
  • Added: (GUI) Allow Dragfile to any control. @GUI_DRAGFILE contain the filename to be used in the $GUI_EVENT_DROPPED.
  • Added: (GUI) GUIRegisterMsg() to work with GUI WM_Message-routines at runtime.
  • Added: (GUI) GUICtrlRegisterListViewSort() to create a real sorting routine for GUI ListView's.
  • Added: (GUI) Icons for tab items.
  • Added: (AU3INFO) AutoIt Windows Info : Now shows Style and exStyle values for the controls.
  • Changed: #include search algorithm modified.
  • Changed: The /c command line option has been replaced by /AutoIt3ExecuteLine.
  • Changed: RegEnumKey and RegEnumVal return more precise @error to help diagnostic.
  • Changed: Return,@error, @extended have to be explicit to be return by an UDF.
  • Changed: FileFindFirstFile no longer returns "." or "..".
  • Changed: Set _ to be a continuation character ONLY after whitespace.
  • Changed: FileClose with an invalid handle no longer triggers an AutoIt runtime error.
  • Changed: Fatal error message is now displayed if DLLCall cannot be executed.
  • Changed: RegEnumKey and RegEnumVal return more precise @error values to help diagnostics.
  • Changed: "OnAutoItExit" function is now called on system shutdown or user logoff.
  • Changed: Opt() with just the "option" will now return the current value for that option.
  • Changed: DllCall @error is set when function not found.
  • Changed: SplashTextOn() opt=32 to center vertically.
  • Changed: (GUI) GUICtrlCreateList now forces the style LBS_NOTIFY.
  • Changed: (GUI) GUICtrlCreateIcon default size is 32x32.
  • Changed: (AU3INFO) The default setting on Au3info was changed so that it doesn't highlight controls.
  • Fixed: Many fixes - See the the technical Changelog.

7th Apr, 2005 - v3.1.1

Minor bugfix release.

  • Fixed: @OSVersion did not work for Windows Server 2003
  • Fixed: $LVS_EX_FULLROWSELECT in GUIConstants.au3 was incorrectly defined as $LBS...
  • Fixed: @YDAY was incorrect (one day out)
  • Fixed: SetError(), SetExtended() can return a value.
  • Fixed: GUICtrlCreateMonthCal positioning.
  • Fixed: CmdLine[] limited to 63 parameters.
  • Fixed: FileSetAttrib return 1 on non existing file.
  • Fixed: Filecopy not creating subdir under Netware shared.

7th Feb, 2005 - v3.1.0

  • Added: GUI creation capabilities
  • Added: DllCall(), DllOpen(), DllClose()
  • Added: ControlListView()
  • Added: WinList()
  • Added: DirGetSize()
  • Added: IniReadSectionNames(), IniReadSection()
  • Added: InetGet(), InetGetSize()
  • Added: HttpSetProxy(), FtpSetProxy()
  • Added: FtpBinaryMode (Option)
  • Added: Ping()
  • Added: ControlGetHandle()
  • Added: WinGetProcess() and ProcessList()
  • Added: SetExtended()
  • Added: WinSetTrans()
  • Added: Assign()
  • Added: ConsoleWrite()
  • Added: @AutoItExe macro
  • Added: Const keyword
  • Added: Optional parameter support for user functions
  • Added: "main", "primary", "menu", "secondary" added as valid mouse button types
  • Added: ExpandVarStrings (Option)
  • Added: The user functions OnAutoItStart() and OnAutoItExit() are called during startup/exit
  • Added: OnExitFunc (Option)
  • Removed: URLDownloadToFile() (Replaced by InetGet())
  • Changed: For loops automatically declare the counter variable as a Local variable
  • Changed: IniDelete() can also delete entire sections
  • Changed: StringReplace() also returns the number of replacements in the @extended macro
  • Changed: StringMid() the "count" parameter is now optional (assumes remainder of the string)
  • Changed: PixelChecksum() now has optional step parameter
  • Changed: Control...() functions now accept the Control ID as an extra way to identify a control
  • Changed: InetGet() function can download in the background
  • Changed: Reg...() functions no longer give a hard error when an unknown key is used.
  • Changed: The mouse and pixel functions now have an additional "client area" mode
  • Changed: Added WIN_2003 to the possible values for @OS_VERSION
  • Changed: AU3Spy.exe renamed to AU3Info.exe
  • Changed: Major upgrades to the AutoIt Window Info Tool (control highlighting, magnify, cursor IDs)
  • Changed: FileSelectFolder() supports an initial directory as well as a root directory
  • Changed: File functions no longer give fatal errors when -1 is used as a handle
  • Fixed: Memory leak in SplashImageOn()
  • Fixed: Expressions like "$var = $var" will now give an error if the variable wasn't previously defined
  • Fixed: StringFormat() with \\ characters
  • Fixed: Under rare situations after closing a script AutoIt3.exe would still appear in task manager for a while
  • Fixed: Certain paths like @WindowsDir were incorrect under Windows Terminal Server
  • Fixed: FileSetTime() systems in non-GMT timezones had incorrect results
  • Fixed: FileMove() with UNC paths (does a real move when in the same dir rather than a copy).
  • Fixed: ^ operator
  • Fixed: Chr()
  • Fixed: StatusBarGetText() failed when used with no "Text" parameter
  • Fixed: InputBox() didn't return focus to the previously active window
  • Fixed: ACos() bad result.
  • Fixed: Under certain conditions, GUICtrlSetPos() could cause a label to appear as if it had been painted multiple times.

4th Aug, 2004 - v3.0.102

Major Change: Colors now default to the standard RGB format rather than the previous BGR format. This affects PixelSearch() and PixelGetColor().

The "ColorMode" option has been added to allow old scripts to run with the old BGR mode, just
place this line at the top of your script to use the old method, e.g.:

Opt("ColorMode", 1)

If you use color functions in your code you MUST take notice of the above change and either change the colors in your code OR add the Opt ColorMode option as shown above. This especially affects BOTs and code that interacts with games.

  • Added: DriveMapAdd(), DriveMapDel() and DriveMapGet()
  • Added: @SW_SHOWDEFAULT, @SW_SHOWMAXIMIZED, @SW_SHOWMINIMIZED, @SW_SHOWMINNOACTIVE,
    @SW_SHOWNA, @SW_SHOWNOACTIVATE, @SW_SHOWNORMAL
  • Added: FileGetShortcut()
  • Added: Predefined $CmdLineRaw variable now holds the original command line in full
  • Added: @DesktopDepth
  • Added: ReDim
  • Added: More command line params for Aut2Exe.exe: /nodecompile and /comp 0-4 (compression level, 4=best)
  • Added: Process ID (PID) support for Process...() and Run() functions
  • Added: ProcessSetPriority()
  • Added: Decompiler (Exe2Aut) added
  • Added: PixelChecksum()
  • Added: Strings starting with "0x" are converted from hex when used numerically
  • Added: MouseWheel()
  • Added: RegEnumKey() and RegEnumVal()
  • Added: FileRecycleEmpty()
  • Changed: TimerStart() renamed to TimerInit(). TimerStop() renamed to TimerDiff()
  • Changed: FileSelectFolder() flag parameter changed
  • Changed: REG_MULTI_SZ values in Reg...() functions allow double NULL values
  • Changed: BitOr(), BitAnd() and BitXOR() take up to 255 parameters
  • Changed: Icon and windowstate options added to FileCreateShortcut()
  • Changed: RunAsSet() supports extra profile handling options
  • Changed: RegWrite() now accepts just the keyname in order to create a keyname with no value
  • Changed: "Allow Decompilation" option added to Aut2Exe
  • Changed: Aut2Exe gives feedback during compilation and gives the option to abort
  • Changed: Compiled scripts run/extract much faster when using FileInstall and medium/large files
  • Changed: Max number of user function limits removed
  • Changed: Max number of variable limits removed
  • Changed: -1 does no sleep at all for Send/Mouse delays (SendKeyDelay, etc...)
  • Changed: Optional occurance parameter added to StringInStr()
  • Changed: Optional default filename added to FileOpenDialog() and FileSaveDialog()
  • Changed: Registry functions accept 4 letters keys (HKLM instead of HKEY_LOCAL_MACHINE, etc.)
  • Changed: Remote registry keys are accepted in the form "\\computername\key\subkey"
  • Changed: AutoItSetOption returns the previous setting
  • Fixed: FileGetSize() works on >2GB files and in-use files
  • Fixed: The expression: If "non-blank" And 1 - now evaluates as true
  • Fixed: ToolTip() when the mouse is near the bottom of the screen
  • Fixed: StringIsDigit()
  • Fixed: Process...() functions under NT4 unable to see certain processes
  • Fixed: Some keywords incorrectly allowed after a THEN keyword

11th Mar, 2004 - v3.0.101

  • Added: MemGetStats()
  • Fixed: Windows 95a compatibility
  • Fixed: Minor help file typos

29th Feb, 2004 - v3.0.100

  • Initial release


AutoIt and Developer History

This section is for those interesed in how the AutoIt project began, and how the various developers got involved. Devs should add their own thoughts when they get time :)

Jon

October 1998

I was working on a project to create an automated Windows NT 4 build for a company in the UK. It became clear that around half the applications required featured no way to silently install them. Searched around for a while for some way to force button presses and came across Microsoft ScriptIt which was a compiled WinBatch script designed for clicking buttons in automated builds.

ScriptIt worked OK but it was extremely unreliable. It was notoriously fussy about the speed of the machine it was used on and had no way to control the key delays between keystrokes. Another feature that caused problems was that there was no way to specify a working directory when running a program which caused loads of problems with many of the applications I was scripting. Also, some of the functions didn't work under NT 5 beta (i.e. Windows 2000).

Xmas 1998

To escape the torment that was Xmas I decided to have a go at a C program that would send keystrokes hoping that I could then control the delay.

January 1999

AutoIt version 1 released on the old winfiles.com site. Syntax was similar to ScriptIt (for Send) and featured the functions Send, Run, RunWait, WinWait, WinWaitClose, WinWaitActive, WinHide, WinActivate, WinClose, WinRestore, Sleep and SetKeyDelay. From the v1.0 helpfile:

Advantages
- It's much smaller at 40Kb (600Kb smaller than ScriptIt).
- It will be updated if problems are found.
- The "Reveal" function is much better.
- Non-active as well as active windows can be waitied for.
- Variable delays are possible (defined in milliseconds).
- The time in between keystrokes can be altered.
- When running an application, a working directory can be specified.
- Will force Windows to be active under Win98/NT 5.0 (Use "WinActivate")

Disadvantages
- The "[ADLIB]" section is not implemented
- The script file must be formatted correctly (no white spaces allowed on lines
containing a command).
- None of the Wilson WinBatch commands are featured.
(But who used them anyway? )
- Due to the command names I've used, the scripts tend to be a little larger.

January - April 1999

Numerous versions released up to v1.8 with features like:
- Cool /reveal mode
- Goto!
- IfWin...
- Mouse control
- ScriptIt ADLIB-like support
- Gosub
- %ENV% variable support

August 1999

AutoIt v2 released.
First version of AutoItX created.

September 1999

AutoIt v2.1 - First version of Aut2Exe created.

September 1999 - May 2001

Numerous versions and number of functions increasing at a massive rate. Basically, if someone asked for a function I stuck it in there. The problems this caused is why we don't give in all the time any more.

May 2001

AutoIt source code was a total mess. Entire source rewritten in C++.

January 2002

AutoIt v2.62 - First version of Exe2Aut created (boo...hiss)
First version of AutoItDLL created.

December 2002

AutoIt v2.64 - last version of AutoIt v2.

FileInstall function added after writing my own compression and archive library.

January 2003

Very little development was done from 2001 to 2003. Project had reached the point where I'd lost the will to work on it. The source code was a mess again because in this sort of project you tend to add on every function that everyone wants without thinking about the future. The AutoIt v2 syntax was really horrible.

Half the requests I got were for proper loops and expressions - half of the questions were "how do I use a backslash in a Run command". Arrgh.

In this time there were numerous "add-ons" like Aut2xtra created by Larry that allowed the use of some of the missing functions from AutoIt (because I hadn't the time or motivation to add them).

IIRC Larry suggested that he was frustrated with the lack of development and suggested writing a new version. I decided that if a new version was wanted then it should be more like a "proper" language. I started the developement framework for AutoIt v3.

Previous versions were very strict about syntax it was "Command, param1, param2,..." and it took about a month to come up with something that could read in a line containing complex expressions (a whooooole lot of googling required). Although I "get" it now, writing the expression code in AutoIt was the 2nd hardest thing I'd ever done. (Hardest thing I've written was the compression code used in Aut2Exe that I wrote from scratch )

Most of the current devs starting helping out soon after this point. I forget when each person starting helping so hopefully they can fill in here.

March 2003

First public beta binary of AutoIt v3 (after lots of talk) released.

February 2004

After over 100 beta versions and development spirialling well out of control AutoIt v3.0.100 was finally released.

Jon :)

Larry

Early 2001 started my own automated rollout of WinNT systems. I found that the previous curator used an AutoIt script to handle some interaction. Fascination... I expounded on the control that AutoIt had in the rollout process, scrapping all other means and focussing on an "All-AutoIt" solution.

We all hung out on the Yahoo AutoItList group at that time. I had alot of free time at work (thanks to AutoIt) and paid much attention to the AutoItList. Jon noticed my dedication and allowed (allows) me to moderate/maintain that group. Although, I haven't looked at the files section, much, in years.

By 2003, I pushed AutoIt to its limits, so began to learn C to create command line utilities (including GUI, AutGUI.exe) to use with AutoIt. Then I started to threaten everyone with trying to create a "next-generation" of AutoIt. I got about 2 days into coding a script parser and (I think) Jon got nervous about how horrible my fumbling was, and how feeble a product might ensue. So, he saved me and decided to dedicate his own efforts.

I think Jon and I have some of the same priorities, so he crowned me the original moderator of the AutoItScript forum. Subsequently, in appreciation of my laziness and with commendation to the dedication of others he began to dole out responsibility.

One of my frustrations with the AutoIt community, or just in freeware in general, I guess, is that the efforts and hours will never truly be appreciated. I am only fueled by pride in this endeavor.

Lar.

Jos

I have been using AutoIt since ver 2...
Started to become more active on the old forum just before moving to this new forum.
Started to offer help on things like:
- Helpfile creation automation.
- Made opening the Helpfile for AutoIt3 Functions and Keywords (F1) work from within Editors like Crimsom/TextPad/SciTE.

Wrote a bunch of UDF's.
Wrote Tidy in Autoit3 syntax as way to learn AU3. This is now BCX - C because I wanted it to be faster.
Started developing the AutoIt3 Lexer for SciTE and submitted that for inclusion in SciTE v 1.60.
Started the SciTE4AutoIt3 Installer package to make a single installer for all the goodies developed by others and myself and created the Helpfile for it.
Wrote AutoIt3Wrapper to allow easy access to both Production and Beta version of AutoiT3 and allow Compiler Directives for Updating the output programs resource information.
Started the SciTE4AutoIt3 Sub-Website when SciTE became more popular.

Became Mod when too many (how do I say this politely) script kiddies started to terrorise the forums and Jon didn't always have time to be around and Larry living in a different timezone.

Wrote Obfuscator which is a based on Tidy's sourcecode to make script somewhat unreadable.

Jos :)

Valik

A long time ago I found a Diablo II bot. For whatever reason (Probably to fix something), I learned it was written in AutoIt so I came to the site to get the program. Around the time Jon started work on v3 I started learning C++. Once the v3 beta's were released I started porting some of my old scripts to v3. Eventually I either find problems or wanted features and since the source to AutoIt was available at that time and I was learning C++, it seemed like a good idea to contribute. As for becoming a moderator, much like JdeB, I grew tired of the stupidity on the forum.

Jpm

I cannot remember when I found AutoIt - but it was a simple yet powerful script language. I use it a lot to automate the reinstall process of my Windows Beta testing so that I can have the same environment (system and user) every time. I was able to install it while doing something else. The process was very slow with a 200Mhz machine...

So up until March 2003 I decided to help French people doing the French translation of the V2 version. At this time the Autoit source code V3 was available so I decided to learn more about C and the Windows API. I wrote the converter V2 to V3 to convert my scripts - it doesn't seem so usefull today but at least my C code learning was improving.

I participated in some improvements to help automation of any windows version or any OS language. I created a test AutoIt non regresssion suite to help our internal process of delivering good beta versions. I was so fond of having GUI creation that when Larry start his AU3GUI project, I decided to integrate it into the V3.0 version.

At the time Jon was so busy outside AutoIt so I looked after bug reports and beta versions. I try to manage the BUG report forum as much as I can and to identify/integrate the improvements that I love and that I can implement...

JP ;)


AutoIt Changelog
================

3.3.6.1 (xth April, 2010) (Release)
AutoIt:
- Fixed #1515: FileOpen still opening in exclusive mode in some situations.

3.3.6.0 (7th March, 2010) (Release)
AutoIt:
- Added #1376: FileOpen() mode parameter is now optional. Default mode is read.
- Added #1054: Added FileGetEncoding().
- Added: ControlCommand() "SendCommandID" - used to send WM_COMMAND Control ID messages. Allows the
    automation of ToolBarWindow32 controls (amongst others). For example, the "Back" button of
    Internet Explorer. Use Au3Info to get the Command ID from the ToolBar tab.

- Fixed #1428: AdlibRegister/Unregister() were incorrectly using case-sensitive function names.
- Fixed #1448: #OnAutoItStartRegister did not work in compiled scripts.
- Fixed #961: RegDelete() was not working properly on 64bit keys when using the 32bit version of AutoIt and HKLM64.
- Fixed: Regression in FileOpen() where it wasn't allowed to open files in read mode if they were already open in write mode.
- Fixed #1449: GUICtrlDelete() not working for GUICtrlCreateDummy() types.
- Fixed #1458: Inet sizes were capped to 32-bits.
- Fixed #1459: Hard crash when too much recursion is used.
- Fixed #1464: Regular expressions with a single character * pattern were stopping after the first null match.
- Fixed #1463: StringToASCIIArray() working incorrectly with UTF8 characters.
- Fixed #1475: TrayItemSetState($Value, $Tray_Checked) incorrectly enables a disabled TrayItem.

- Changed: Send() and ControlSend() code reworked to allow for more Unicode characters to be used.
- Changed: FileWriteLine() performance improved.

Aut2Exe:
- Fixed #1409: Ctrl+C is no longer the shortcut for Convert. It is now Ctrl+G (Go) to avoid clashing with a Ctrl+C copy operation.

Au3Info:
- Fixed #1444: Controls in applications like RegEdit were left highlighted.
- Fixed #1391: ToolbarWindow32 info only showing the first toolbar.

- Changed: Better identification of the control under the mouse.

AutoIt3Help:
- Fixed #1423: "Open Script" button stopped working.

AutoItX:
- Fixed: Missing .lib files readded.

UDFs:
- Fixed #1438: AutoIt error when using _ArrayCombinations().
- Fixed #1454: StringBetween() not working correctly.
- Fixed #1441: _GUICtrlRichEdit_GetText() using wrong buffer length.
- Fixed #1446: _ScreenCapture_Capture() was using height/width of 1 pixel less.
- Fixed #1445: Documentation updated for _MemGlobalFree().
- Fixed #1469: _GDIPlus_BitmapCloneArea() documentation updated.
- Fixed #1466: _GUICtrlEdit_GetLine() returns an unexpected character.
- Fixed #1487: _DateToDayOfWeekIso returned 0-6 but should be 1-7 where Monday = 1

3.3.4.0 (15th January, 2010) (Release)
AutoIt:
- Added: Ability to read and write UTF-8 files with no BOM including automatic detection during reading.
- Added #682: Removed the 64KB limitation for FileReadLine()
- Added: AutoIt scripts using the line continuation character "_" are no longer limited to a combined line length of 4095 characters.
- Added: FileRead() returns the number of characters/bytes read in @extended.
- Added #1311: MouseGetCursor() returns hand cursor.

- Fixed #384: Under certain circumstances the network credentials flag would prevent the process from starting when launched with RunAs() or RunAsWait().
- Fixed #1370: StringInStr() would crash with a negative occurrence and start position greater than the string length.
- Fixed #1367: Calling GUIDelete() from a GUIRegisterMsg() callback that returns $GUI_RUNDEFMSG would crash AutoIt.
- Fixed #1363: FileSetPos() did not work when the origin was the current position.
- Fixed #1355: Regression in how unsigned numbers are displayed when returned from DllCall().
- Fixed #1396: Crash in DllCallbackGetPtr() with invalid handle.
- Fixed #1352: StringSplit() hard crash with binary data.
- Fixed #1398: Fixed declaration of $tagPARAFORMAT2 from GuiRichEdit.au3.

- Removed: The "RAW" reading mode from FileOpen() has been removed.
- Removed: InetGet("abort"), @InetGetActive and @InetGetBytesRead have been removed.
- Removed: AdlibEnable() and AdlibDisable() have been removed.
- Removed: OnAutoItStart and OnAutoItExit have been removed.

UDFs:
- Changed: _SQLite 3.6.19 -> 3.6.22
- Fixed #1338: bad _ArrayDisplay() GUI position error.
- Fixed #1362: _WinAPI_WindowFromPoint() did not work with 64-bit AutoIt.
- Fixed #1389: _IEAttach() could fail if called multiple times.
- Fixed #1353: _FileWriteToLine() excessively strict on input text type.
- Fixed: SQLite.au3 various errors in _SQLite_FetchData, $iCharSize, _SQLite_QuerySingleRow, _SQLite_GetTable2d, _SQLite_Display2DResult by jchd.

AutoIt3Help:
- Fixed #1327: Some keywords would fail to open correctly in rare cases.

3.3.2.0 (18th December, 2009) (Release)
AutoIt:
- Added #529: Added the "NAME" property to allow direct search for .NET WinForm control names.
- Added #757: Set defaults for MouseClick()'s x/y parameters.
- Added #764: Return Pid on ProcessWait() and handle on WinWait(), WinWaitActive, WinActivate(), WinActive(), WinMove() when successful.
- Added #414: better handling of OnAutoItStart/OnAutoItExit, now #OnAutoItStartRegister, OnAutoItExitRegister() and OnAutoItExitUnRegister().
- Added: Better handling of AdlibEnable/AdlibDisable, now AdlibRegister(), AdlibUnRegister() and AdlibDisable().
- Added #351: Reverse PixelSearch().
- Added #769: FileFlush() function.
- Added #333: #NoAutoIt3Execute Directive for disabling /AutoIt3ExecuteScript or /AutoIt3ExecuteLine.
- Added #604: $GUI_BKCOLOR_TRANSPARENT can be used with label, group, radio, checkbox controls.
- Added #135: FileSetPos(), FileGetPos() functions for moving the file pointer around.
- Added #582: GUICtrlSetTip() can be used on TabItem controls.
- Added #699: Shutdown() now return @error=GetLastError() when failing.
- Added #461: StringReplace() from right to left if occurrence <0 as for StringInStr().
- Added: GUICtrlSetColor() and GUICtrlSetBkColor() for Combo Controls.
- Added: GUI without title bar (no $WS_CAPTION) can be moved with the mouse.
- Added #815: Temporary variables can be passed ByRef.
- Added #837: FileFindNextFile() set @extended if a directory is returned.
- Added #839: Shutdown() rewritten and now works properly when run as a non-interactive user.
- Added: Shutdown() now takes an optional reason code.
- Added #846: _PathFull() now supports strange but valid syntax where drives do not  have a trailing slash.
- Added #869: @MUILang macro to help MUI environment scripts.
- Added #918: Added Quality parameter to GUICtrlSetFont() and GUISetFont().
- Added: ProcessClose() return info on error.
- Added: PixelChecksum() extra parameter to select CRC32 instead of ADLER.
- Added #984: @OSVersion now returns "WIN_XPe" for Windows XP Embedded.
- Added #938: UDPOpen() flag to allow broadcasting  with 255.255.255.255.
- Added: new types to DllCall and DllStruct to avoid confusion with MSDN description. That avoid specially X64 errors.
- Added #351: PixelSearch() now supports both right-to-left and bottom-to-top searches.
- Added #508: Static keyword.
- Added #1056: New Inet option to by-pass forcing the connection online.
- Added: DllStructSetData() and DllStructGetData() index parameter now supports the Default keyword.
- Added #1270: GuiSetIcon() now finds suitable large and small icons.

- Fixed: CtrlSetStyle listview on non selected tab.
- Fixed #763: GUICtrlCreateIcon() create an empty icon on error.
- Fixed: no mouse move when invalid button used in MouseClick() or MouseClickDrag().
- Fixed #779: infinite loop on Exit due to GUICreate() child badly created.
- Fixed #774: GuiCtrlSetBkColor() bad label display.
- Fixed #790: Windows region constant $ERROR rename in $ERRORREGION.
- Fixed: StringInStr("aaa", "aa", 2) does not return 0.
- Fixed #802: Searching for controls by Height property.
- Fixed: Checkbox or radio painting on tab.
- Fixed #816: data for GUI date control doc clarification.
- Fixed #819: Crash with EventLog functions.
- Fixed #814: InetGet() through a proxy requiring authentication did not work.
- Fixed #813: bad handling of Windows advanced matching for [HANDLE:...] in X64 version.
- Fixed #863: DirMove() extra dot.
- Fixed #867: UDPRecv() can return from IP/Port.
- Fixed #886: More explicit documentation that operator == is a forced string comparison.
- Fixed #885: Default compared to False returned True instead of False.
- Fixed #888: Send("{}}") Extra null char.
- Fixed: DllCall() returning 64-bit int.
- Fixed: GuiCtrlSetImage() after GUI resized.
- Fixed: DirMove() return code wrong under XP.
- Fixed #931: bad GUICtrlSetResizing() for graphic control.
- Fixed #934: MouseGetCursor() hogging mouse double click.
- Fixed #615: License updated to be less restrictive.
- Fixed #919: Remarks added to ConsoleWrite(), ConsoleWriteError() and StdinWrite() regarding how those functions handle binary data and non-ANSI characters.
- Fixed #897: Documented that StringToASCIIArray() does not accept binary input (convert to a string first).
- Fixed #937: Bad event handling of Opt("TrayMenuMode",1)
- Fixed #969: FileFindNextFile() does not set @extended if first found is a dir.
- Fixed #1006: @MSEC returned wrong value for values < 100.
- Fixed #1010: FileRead() UTF8 with BOM files return too many chars.
- Fixed #1013: MDI childs doesn't adjust to parent windows client area.
- Fixed #1005: TraySetClick(64) = hovering.
- Fixed: ClipPut("") not emptying.
- Fixed #1068: Binary to Int.
- Fixed: Bad painting on double GUICtrlSetPos() for label.
- Fixed #1094: Send("{LSHIFT UP}") stay down.
- Fixed #1074: Inputbox() positionning on multi monitor.
- Fixed #1105: disable colored Multiline button not properly displayed.
- Fixed #1077: GUICtrlSetBkColor() bad recoloring.
- Fixed #1116: GUICtrlCreateGraphic don't follow ResizeMode.
- Fixed #1102: Better documentation of the StringInStr() count parameter.
- Fixed #1161: Removed all documentation references to ColorMode.
- Fixed #1156: AutoItSetOption()/Opt() now set @error instead of generating a fatal error with invalid input.
- Fixed: Comparing pointers now works correctly.
- Fixed #906: ActiveX controls were not told what their initial size was.
- Fixed: Boolean tests on binary strings now behaves properly.
- Fixed #1234: COM methods that modified boolean arguments could change them to ints.
- Fixed #1258: System menu could display when trying to dismiss a control menu.
- Fixed #1288: Documented how DllStructSetData() and DllStructGetData() work with arrays when omitting the index parameter.
- Fixed #1300: DLLs could unload when calling DllCall() with an invalid function.
- Fixed #1295: Unicode to ANSI conversion was crashing in certain situations.
- Fixed #1304: _GDIPlus_BitmapLockBits() now correctly takes a Width and Height parameter instead of a Right and Bottom.
- Fixed #1294: Fixed AutoIt deadlock when using the following functions with hanged windows: WinGetTitle, WinSetTitle, WinGetText, WinFlash, WinSetOnTop
- Fixed #1332: Mod() forced a conversion to floating point numbers when it didn't need to which can cause unexpected output.
- Fixed #1321: DllStructCreate() did not support _ in data names.  Documented valid characters for data name.
- Fixed #1322: Crash when using ControlCommand("GetSelected") on non-Edit controls.
- Fixed #1325: Some date functions could attempt to access an invalid array.
- Fixed #1345: Number() failed to handle numbers with a trailing decimal point.

- Changed: It is now possible to read from files opened for writing.
- Changed: PCRE regular expression engine updated to 8.00.
- Changed #899: ShellExecute[Wait]() no longer uses "open" as the default verb.  See remarks section for those functions for more information.
- Changed: Inet functions rewritten with the following additions and changes:
    - Removed: Long deprecate URLDownloadToFile() alias for InetGet().
    - Added: HttpSetUserAgent(), InetClose(), InetGetInfo() and InetRead() functions.
    - Added: Multiple background downloads are now supported with InetGet().
    - Added #408: New flag for ignoring SSL errors for HTTPS connections.
    - Added #884: Better proxy support with mode 0.
    - Added #949: The user-agent can be changed.
    - Changed: InetGet() returns a handle which must be closed.
    - Changed: @InetGetBytes, @InetGetActive and InetGet("abort") are deprecated and will be removed in the future.
- Changed #968: AutoUpdateIt updated by ProgAndy to use new Inet features.
- Changed: @YDAY now returns values in the range 001 - 366 instead of 1 - 366.  This makes the macro more consistent with other languages (like C/C++) and more consistent with all other date related macros which return strings with leading 0s to pad the length.  THIS IS A SCRIPT BREAKING CHANGE.
- Changed #1080: InetGet background downloads now return immediately instead of connecting to the remote host first.
- Changed #1137: RegEnumKey() and RegEnumVal() now correctly return an empty string on failure instead of an error message string.
- Changed: PixelChecksum() can calculate checksums from right-to-left and bottom-to-top.
- Changed: InputBox() no longer requires passing both x and y or w and h.
- Changed #1056: Added new Inet option to by-pass forcing the connection online.

AutoItX:
- Removed: ColorMode option removed from AutoItSetOption().

AU3Info:
- Removed: ColorMode BGR option removed since AutoIt no longer supports the option to use BGR mode.

- Added: Control information now includes the .NET WinForm if available.
- Added #140: ToolsBar button info.

Aut2Exe:
- Fixed #1283: Added new option /x86 to force a 32-bit build and re-added /unicode which also forces a 32-bit build.

Au3Check:
- Fixed #1239: Incorrect library search order.

Others:
- Added #1050: TextPad v5 syntax files installation.

UDFs:
- Added: _GDIPlus_BrushGetSolidColor, _GDIPlus_BrushSetSolidColor (smashly)
- Added: $tagWIN32_FIND_DATA and corresponding attribute constants.
- Added #868: _WinAPI_GetLayeredWindowAttributes(), _WinAPI_SetLayeredWindowAttributes().
- Added: _Date_Time_ ... Str() can return date as yyyy/mm/dd.
- Added #271: FTPEx.au3 for _FTP_...().
- Added #932: mouse event constants in WinDowsConstants.au3.
- Added #952: _ArrayDisplay() extra parameter for column header text.
- Added #957: _Assert() in Debug.au3.
- Added: _WinAPI_GetGuiResources()
- Added #981: _WinAPI_WideCharToMultiByte(), _WinAPI_MultiByteToWideChar() support IN/OUT as "strings"
- Added #1157: Encryption functions in Crypt.au3.
- Added #1128: _WinAPI_PathFindOnPath() in WinAPI.au3.
- Added #1228: _FTP_SetStatusCallback(), _FTP_DecodeInternetStatus() in FTPEx.au3.

- Fixed #755: _FileReadToArray() removing empty end lines.
- Fixed #773: Doc for _GUICtrlStatusBar_SetParts.
- Fixed #786: _SQLite_Exec() does not return @error.
- Fixed #809: _Soundxxx() with first parameter as filename.
- Fixed #887: Related section based on Tweaky work.
- Fixed #951: _ArrayDisplay() speed improvement for nb entries >4000.
- Fixed: _SoundOpen() set @error on MCI Error.
- Fixed #1015: _SQLite_SaveMode() renamed as _SQLite_SafeMode().
- Fixed #1016: _WordDocSaveAs() Doc for error handling.
- Fixed: Sound positioning in case of VBR Format Sound.
- Fixed #1028: _Clipboard_GetData() fix.
- Fixed #1031: _Clipboard_SetData() fix.
- Fixed #1040: _ScreenCapture_Capture() leak memory.
- Fixed #1026: _Gdiplus_BitmapCreate*() doc examples.
- Fixed #1092: _Timer_...() datatype for X64.
- Fixed #1059: Incorrect error handling in _FileListToArray().
- Fixed #1101: _NowTime(), _NowDate() Doc.
- Fixed: _WinAPI_GetWindowLong(), _WinAPI_SetWindowLong support X64.
- Fixed #1111: Bad grammar in comments for _DateAdd().
- Fixed: UDF library now uses #include "" instead of #include <>.
- Fixed #1033: UDF library now has better and more consistent error handling when DllCall() is used.
- Fixed #1215: _ArraySearch() not searching on 2D array.
- Fixed #1168: _ExcelBookOpen() now selects the first visible worksheet to prevent a COM error.
- Fixed #1247: Documented that some _GUICtrlComboBoxEx_* functions don't work with certain ComboBox styles.
- Fixed #1260: Potential buffer overflow in _WinAPI_GetLastErrorMessage().
- Fixed #1276: _TicksToTime() incorrectly rounded seconds up.
- Fixed #1277: Resource clean-up in example script for _GDIPlus_ImageGetGraphicsContext.
- Fixed #1290: Invalid Left coordinate when using _GUICtrlTreeView_DisplayRectEx().
- Fixed #1296: _GUICtrlTreeView_ClickItem() could click outside the control's parent window.
- Fixed #1312: Errors with _GUIImageList_BeginDrag() example.
- Fixed #1320: _GUIImageList_DragMove() documentation contained a parameter that doesn't exist.

- Changed: _StringBetween removed last optional param (not needed after change)(SmOke_N)
- Changed: _StringToHex(), _HexToString() and _StringReverse() have been rewritten and are faster.
- Changed: _SQLite 3.6.7 -> 3.6.19 (SQL statement support UNICODE characters)
- Changed: _InetGetSource() now uses InetRead().

- Removed: _StringAddThousandsSep() has been removed.  Too many opinions on how the function should work means nobody is happy with it.
- Removed #1112: __WinAPI_Check() has been removed as have all calls to it.

3.3.0.0 (24th December, 2008) (Release)

AutoIt:
- Windows 9x and Windows NT 4.0 Operating System support has been removed.

- Added: New flag for StringSplit() to not return the count in element 0.
- Added #328: StringToASCIIArray(), StringFromASCIIArray() functions.
- Added: New flag to Run()/RunAs() to fix issue #415 (Adds new Constants.au3 constant: $STDIO_INHERIT_PARENT).
- Added: New flag to all Run functions for better CUI compatibility (Adds new Constants.au3 constant: $RUN_CREATE_NEW_CONSOLE).
- Added #481: 11 pixel margin around the text in SplashTextOn() (Meets Vista UI guidelines).
- Added #468: Added @MSec macro for obtaining the current milliseconds for the current second.
- Added #277: @CPUArch macro to return the capability of the processor.
- Added #454: $FO_UTF8 allowing FileOpen() in Read mode for reading UTF8 files without BOM.
- Added: $FO_UTF16_LE, $FO_UTF16_BE allowing FileOpen() in Read mode for reading UTF16 files without BOM.
- Added #407: Documented that For...In loops are read-only.
- Added #645: IniDelete() now supports the Default keyword for the 3rd parameter.

- Fixed: Send() was incorrectly inserting a leading zero when using the {ASC 0xNNNN} format.
- Fixed #305: GUICtrlSetFont() for Combo causing highlight.
- Fixed #318: GUICtrlSetTip() on TreeViewItem must return 0.
- Fixed #339: GUICtrlDelete() crashes.
- Fixed #345: @OSVersion for Windows 2008.
- Fixed #366: AutoIt crash on bad syntax.
- Fixed #380: @OSVersion for Windows XP 64-bit Edition.
- Fixed #346: FileOpenDialog/FileSaveDialog filter length limit.
- Fixed #387: DllClose() and DllCallbackFree() crashing when an invalid handle used.
- Fixed #449: @SystemDir does not return SysWOW64 under X64 in 32-bit mode.
- Fixed #440: Fatal error when script ends with EOF (0x1A).
- Fixed #464: Example script for GUICtrlCreateAvi() did not work on Vista.
- Fixed #484: ObjGet() would crash when invalid files were specified.
- Fixed #501: ProcessGetStats() failed for processes running as other users (including SYSTEM).
- Fixed #92: DllStruct data truncated with char[]/wchar[].
- Fixed: GuiCtrlSetState($graphic, $GUI_HIDE) does not hide.
- Fixed: GuiCtrlSetResizing($graphic, ) not moving.
- Fixed: GuiCreate(...,Style without caption) does not resize properly.
- Fixed: GuiSetStyle(caption change) does not resize properly.
- Fixed: GuiCtrlSetState($listviewitem) does not return error.
- Fixed #562: Specifying the TITLE property caused all other properties to be lost (Window title matching).
- Fixed #569 TCPRecv doc example.
- Fixed #589: Some comparison operators did not return a boolean value.
- Fixed #583: Bad formatting of @MSEC in documentation.
- Fixed #574: Using 0 for the SendKeyDelay or SendKeyDownDelay removes the respective delay when using Send().
- Fixed #542: Crash with regular expressions.
- Fixed #531: Clarification of some of the remarks for GUICtrlSetGraphic().
- Fixed #539: StringSplit() with flag 2 and no matching delimiters wasn't returning the full string.
- Fixed #601: Tooltip return 0 when title length >99.
- Fixed #608: listView GUICtrlSetBkColor not redrawn.
- Fixed #628: GuiCtrlRead($ctxmenu, $adv) bad return (Saunders)
- Fixed #640: PCRE does not support \L, \l, \N, \U, or \u : doc updated
- Fixed #642: Installer now correctly opens the merged helpfile to the history page instead of the AutoIt-only helpfile.
- Fixed #646: Call() now sets specific @error and @extended values when it fails to find a function.
- Fixed #669: Typo in Dec() example.
- Fixed #659: Documented that UNC paths are not supported when using FileSelectFolder().
- Fixed #671: Crash when using $WS_EX_MDICHILD without specifying a valid parent.
- Fixed: Crash when using BinaryToString() with invalid UTF16 input string.  BinaryToString() now has new @error codes to support diagnosing invalid input.
- Fixed #743: AutoIt Crash when Tray functions are use with invalid ID.
- Fixed #748: AutoIt Crash with DllCall(0,...).

- Changed #393: Documented that SoundSetWaveVolume() works differently in Windows Vista.
- Changed: PCRE regular expression engine updated to 7.8.
- Changed: @ProcessorArch changed to @OSArch as it was misleading.
- Changed: Size limits removed from RegRead() and RegWrite() (previously 64KB for some registry types).
- Changed: RegRead() and RegWrite() no longer use hex strings for REG_BINARY types - native binary datatypes are enforced.

Aut2Exe:
- Fixed #436: Compression level was ignored when performing compilation from the GUI.
- Added #460: More verbose UPX errors.

AutoItX:
- Changed: Native DLL: All string methods in the native API are now Unicode. The majority of functions no longer have ANSI versions.
- Added: COM: WinList method.
- Fixed: Native DLL: Return strings were sometimes incorrectly terminated.
- Fixed: PixelChecksum() not returning correct values.

UDFs:
- Added: _GDIPlus_StringFormatSetAlign
- Added: _StringExplode()
- Added: _GDIPlus_ImageGetFlags, _GDIPlus_ImageGetHorizontalResolution, _GDIPlus_ImageGetPixelFormat, _GDIPlus_ImageGetRawFormat
         _GDIPlus_ImageGetType, _GDIPlus_ImageGetVerticalResolution
- Added: _PathGetRelative
- Added: _ArrayCombinations, _ArrayPermute, _ArrayUnique
- Added: _WinAPI_CreatePen, _WinAPI_DrawLine, _WinAPI_LineTo, _WinAPI_MoveTo, _WinAPI_GetBkMode, _WinAPI_SetBkMode
- Added: _WinAPI_CombineRgn, _WinAPI_CreateRectRgn, _WinAPI_CreateRoundRectRgn, _WinAPI_SetWindowRgn
- Added: _ExcelHorizontalAlignSet, _ExcelFontSetProperties, _ExcelBookAttach
- Added: _WinAPI_SetEndOfFile, _WinAPI_SetFilePointer
- Added: Missing FrameConstants.au3
- Added: Excel UDFs
- Added: _Timer_GetIdleTime, _WinAPI_GetWindowPlacement, _WinAPI_SetWindowPlacement
- Added #332: Remarks to _GUICtrlStatusBar_Create
- Added #275: _GDIPlus_GraphicsFillPolygon
- Added: _GUICtrlTab_ClickTab
- Added: _GUICtrlComboBoxEx_GetUnicode, _GUICtrlComboBoxEx_SetUnicode

- Removed: _StringSplit, no longer needed

- Fixed #693: _DateTimeFormat() time format
- Fixed #701: _GUICtrlListView_ClickItem() Clicks in the wrong place when $fMove = True
- Fixed #700: _GUICtrlTreeView_ClickItem() Clicks in the wrong place when $fMove = True
- Fixed #703: _GUICtrlListBox_ClickItem() Clicks in the wrong place when $fMove = True
- Fixed #705: _GUICtrlToolbar_ClickButton() Clicks in the wrong place when $fMove = True
- Fixed #707: _GUICtrlMonthCal_Create() width and height
- Fixed #674: _GUICtrlTab_ClickTab() Clicks in the wrong place when $fMove = True
- Fixed #610: _WinAPI_CreateFile() wrong return value upon failure
- Fixed #619: _GUICtrlListView_SetItemSelected memory allocation
- Fixed #617: corrections to six GDI+ ImageGet help file examples
- Fixed #621: _StringAddThousandsSep don't work with negative number
- Fixed #635: _GuiCtrlTab_ClickTab() docs list unused $fPopupScan parameter
- Fixed #650: Missing BorderConstants.au3
- Fixed #656: _FileCountLines returns 0 if file only contains 1 line
- Fixed #600: _ArraySearch fails with 2D array.
- Fixed #603: _FileReadToArray() does not return an array if the file contains only a single line of text.
- Fixed #495: _GUICtrlTreeView_GetTree returns only 1 parent
- Fixed #503: _Date_Time_FileTimeToLocalFileTime example
- Fixed #510: _GUICtrlListView_ClickItem: If columns inside listview exceed visible area, clicks outside of the control
- Fixed #500: _ChooseColor run on 64bit
- Fixed #517: WinAPI UDF - bad error checking after DllCall()
- Fixed #533: Array functions dimension check
- Fixed: various Timer Functions
- Fixed #506: _FileCountLines deal with all common line-end-chars
- Fixed #485: WinAPI missing related links in helpfile
- Fixed #571: return value doc for _GUICtrlListBox_FindString, _GUICtrlListBox_GetAnchorIndex and _GUICtrlListBox_GetText
- Fixed #586: _GuiCtrlListView_SetGroupInfo() destroyed group ID's.
- Fixed #516: _ChooseFont run on 64bit
- Fixed #595: _WinAPI_SetWindowsHookEx help file description of $WH_KEYBOARD_LL
- Fixed #465: _DateTimeSplit if seconds omitted defaulted to -1, now defaults to 0
- Fixed: Excel Examples
- Fixed #422: _GDIPlus_GraphicsSetSmoothingMode $iSmooth accepts only 0 - 4, doc updated
- Fixed #388: _GUICtrlToolbar_SetButtonSize Example
- Fixed #400: SQLite.dll.au3 @ProcessorArch replaced with @OSArch
- Fixed #390: _viPrintf replaced return type
- Fixed #371: _GDIPlus_Startup return value
- Fixed #368: _ArrayToClip return value
- Fixed #361, #362: _GUICtrlListView_InsertItem doc
- Fixed #285: _ChooseColor Example
- Fixed #299: _GUICtrlTab_SetItemText buffer length for Unicode
- Fixed #292: _EventLog__Clear not clearing log when backup parameter is empty
- Fixed #258: _ClipBoard_GetData
- Fixed #294: _FileReadToArray where the file contains no @LF
- Fixed #303: Clock.au3 in Examples\GUI\Advanced
- Fixed: _GUICtrlListView_SetItemEx text buffer
- Fixed #320: _WinNet_EnumResource struct pointers
- Fixed #321: _GUICtrlStatusBar_GetText buffer length for Unicode

- Changed: StringAddThousandsSep params in regards to #442
- Changed #733: Doc for _GUICtrlButton_SetImageList
- Changed: _SQLite -> 3.6.7
- Changed #442: _StringAddThousandsSep() allows for regional settings
- Changed #290: _GDIPlus_DrawImagePoints
- Changed: _Soundxxxx functions
- Changed #599: _FileListToArray speed optimization

3.2.12.1 (12th June, 2008) (Release)

AutoIt:
- Fixed #309: RunAs() and RunAsWait() now use @SystemDir as the working directory instead of @WorkingDir when a user-supplied working directory is not specified.
- Fixed #325: contextmenuitem not firing events.
- Fixed #282: Icon transparency refresh when on tab regression.
- Fixed #360: RunAs() under Windows 2000.

3.2.12.0 (16th May, 2008) (Release)

AutoIt:
- Removed: Unnecessary optional parameter from ProcessClose().
- Removed: RunAsSet().  (Replaced with RunAs() and RunAsWait())
- Removed: RunErrorsFatal option ( Opt() ).
- Removed: ColorMode option ( Opt() ).

- Changed: @Unicode renamed in @AutoItUnicode. @Unicode is an alias for now. It will be removed > 3.2.14.0
- Changed: The behavior of StdoutRead(), StderrRead(), StdinWrite() and ConsoleRead() has been changed.
- Changed: PCRE regular expression engine updated to 7.6.
- Changed: AutoIt internet functions (e.g. InetGet()) now use "AutoIt" as a user-agent.  Previously using blank
            which was blocked by many websites.
- Changed: ControlClick() now accepts the same mouse buttons as MouseClick() - left/right/middle/primary/secondary/main/menu.
- Changed: Maximum controls in a GUI window 4093 -> 65532.
- Changed: @OSVersion can now return "WIN_2008" for Windows Server 2008.

- Added: RunAs(), RunAsWait().
- Added: GUISetAccelerators().
- Added: REGEXPCLASS in Advanced Window and control definitions.
- Added: X, Y, W, H in advanced window/control definitions.
- Added: DllCall() new types int_ptr, uint_ptr, long_ptr, ulong_ptr. Special types that change size on x86/x64.
- Added: "REG_QWORD" type for RegWrite().
- Added: HotKeySet() modified to work with the {} notation.
- Added: FileReadLine( ,-1) read last line.
- Added: Std I/O redirection works with RunAs...().
- Added: Std I/O merged flag for using the same stream for stdout/stderr.
- Added: Std I/O supports binary data.
- Added: ConsoleWrite()/ConsoleWriteError() now return the amount of data written.
- Added: Remarks in Run() about how to close streams/release resources associated with STDIO.
- Added: StdioClose() function to force STDIO data closed for a process.
- Added: ProcessClose() now closes processes started by other users.
- Added: ProcessWaitClose() returns exitcode in @extended
- Added: Pixel...() can specified a window handle as last parameter.
- Added: "start" and "count" parameters added to StringInStr().
- Added: GUICtrlSetDefColor(), GUICtrlSetDefBkColor().
- Added: Added parent window parameter to MsgBox(), FileSelectFolder(), FileOpenDialog(), FileSaveDialog().

- Fixed: DllCall() setting wrong @error values.
- Fixed: BlockInput() returns errors.
- Fixed: WinWaitActive() not matching (more frequent with Windows Vista).
- Fixed: GUICtrlSetState($GUI_SHOW) on hidden radio on an active tab.
- Fixed: SciTe Lite not installed in the AutoIt Choosen release dir.
- Fixed: WinMove() with Speed = 0 crash the script.
- Fixed: Mysterious return value of 1 when no explicit value was set.
- Fixed: ControlCommand(), "GetLineCount"
- Fixed: _FileListToArray() when using root drive dir as c:\ under Win9x.
- Fixed: TraySetState(4) flashing tray icon for Windows Vista.
- Fixed: ProcessExists() wrong return.
- Fixed: StringRegExp() crashing under Win95.
- Fixed: Handle leak when using Run() with I/O redirection.
- Fixed: Disabled input control background on Tab.
- Fixed: GUICtrlDelete() of a tab if two GUI windows are used.
- Fixed: AutoIt crash in Random() when range exceeds 2^31.
- Fixed: #include parsing error detection.
- Fixed: Array entry passed Byref to a UDF.
- Fixed: FileSetTime() erronously rounds UP on non NTFS partition.
- Fixed: STDIO redirection sometimes failed on Windows 9x.
- Fixed: IniReadSectionNames() returning incorrect number of sections under Win9x.
- Fixed: AutoIt tray icon removal on script exiting.
- Fixed: AutoIt crash when removing ObjEvent() object.
- Fixed: ObjEvent() handler can destroy return of AutoIt Function : as winwait("title") can return 0.
- Fixed: Dirmove() on different volume.
- Fixed: Crash with RegRead() and REG_MULTI_SZ on x64.
- Fixed: GuiCtrlListView() behind BG Picture. Doc updated.
- Fixed: Various Edit control focus and DefPushButton issues.
- Fixed: ControlTreeview() returning @error=1 on success.
- Fixed: COM objects could lose numeric precision.
- Fixed: StringReplace() with start float number.
- Fixed: ControlCommand() "SelectString" wrong selection.
- Fixed: StringSplit() flag=1 delimiters not case sensitive.
- Fixed: In advanced Window descriptions only semi-colon must be escaped.
- Fixed: ObjGet() memory leak.
- Fixed: Modified AutoUpdateIt.au3 to work under x64.
- Fixed: Resizing GUI before GUISetState().
- Fixed: Radio events fired when GUI reactivated.
- Fixed: GUICtrlDelete() on contextMenuItem.
- Fixed: An attempt to FileDelete() a file that was just executed with RunWait() would sometimes fail.
- Fixed: GUI performance problem when creating a large number of windows.
- Fixed: GuiGetCursorInfo() with swapped mouse buttons.
- Fixed: Random(Min,Max,1). Previously this would never actually return Max,
    so if Max was artificially incremented by one the script will now need to be changed.

AutoItX:
- Added: ControlTreeView().
- Fixed: ControlListView() for native DLL version.

Aut2Exe:
- Added: Option to compile scripts as console applications.

AU3Info:
- Changed: Controls are always highlighted when using the finder tool.
- Changed: Controls are not highlighted by default.
- Changed: Control description gives the advanced version of class and instance.

SciTE "lite":
- Updated the source to version 1.76
- Added Save Dialog extension.

UDFs:
 - See the script breaking changes page.

3.2.10.0 (25th November, 2007) (Release)

- Changed: DllCall() new method of passing types by reference using *.
- Changed: DllCall(): short_ptr, long_ptr, int_ptr types deprecated.  Use short*, long* and int* respectively.
- Changed: Limits on Execute() removed.

- Changed: PCRE regular expression engine updated to 7.4.

- Added: 64bit (x64) versions of AutoIt, Aut2Exe, Au3Info and AutoItX.
- Added: DllCallbackRegister(), DllCallbackGetPtr() and DllCallbackFree()
- Added: DllCall() now accept doubles, int64, uint64, wparam and lparam types.
- Added: SendKeepActive().
- Added: ControlTreeView().
- Added: ProcessGetStats().
- Added: VarGetType().
- Added: @AutoItX64 macro.
- Added: Au3Info : Handle info for windows and controls.
- Added: DllStructCreate() added "align" keyword to set structure alignment.

- Fixed: Control...() functions using CLASS and TEXT together sometimes incorrect.
- Fixed: Control...() functions using CLASSNN sometimes incorrect.
- Fixed: Windows Vista taskbar previews causing problems with windows matching.
- Fixed: $var = $var was not giving an error when $var didn't already exist.
- Fixed: GUICtrlSetImage() sizing regression from 3.2.4.9.
- Fixed: GUICtrlCreateListView() with no column.
- Fixed: _GUICtrlListViewInsertColumn() after _GUICtrlListViewDeleteColumn() of the first column of a ListView control.
- Fixed: Extra notification on colored button.
- Fixed: IniReadSectionNames() for [] sections.
- Fixed: Opt("WinTitleMatchMode", Default) fatal error.
- Fixed: GUICtrlSetStyle() with $ES_READONLY bad $WS_TABSTOP.
- Fixed: AutoIt Crash on exit if Win...() used with a Title being a COM object.
- Fixed: ProcessExists() on service process under Win2K.
- Fixed: DefPushButton behavior.
- Fixed: ControlCommand(SelectString) order selection.
- Fixed: Array cannot have 2^24 entries.
- Fixed: GuiCreateMenu() on a windows without title and without client area.
- Fixed: WinWaitActive() sometimes failing after a WinActivate().
- Fixed: _SQLite_SQLiteExe() referencing by default "Extras\SQLite\SQlite3.exe".
- Fixed: _Sound...() when refering to a file with "!" characters.
- Fixed: Looping GUIRegisterMsg() doesn't unregister.
- Fixed: Focus on ES_READONLY edit control.

3.2.8.1 (10th September, 2007) (Release)

- Fixed: Possible crash with StringRegExp().

3.2.8.0 (8th September, 2007) (Release)

- Changed: General speed improvements (currently up to 24% in some cases compared to 3.2.6.0).
- Changed: PCRE regular expression engine updated to 7.3.
- Changed: Recursion-based code limits relaxed.

- Added: wchar type added to DllStructCreate().
- Added: WinMove() speed parameter.

- Fixed: Crash on AutoIt exit if TrayCreateItem() is not deleted.
- Fixed: AutoIt crash on bad parameter when calling TrayCreateMenu()
- Fixed: Character positions used in StringRegExp() not correct for characters > 127 (accents, non-Western)
- Fixed: ProcessExist() under Windows 9x.
- Fixed: GUISetState(@SW_DISABLE) not disabling keyboard input.
- Fixed: Sometimes AutoIt crashes on DllStructGetData() with char[] types.
- Fixed: Au3Info restoring last settings at startup.
- Fixed: Better handling of notifications when using colored buttons.
- Fixed: ControlGetText() crash on Scite windows.
- Fixed: $LVSCW_AUTOSIZE column truncates display string.
- Fixed: Incorrect listview creation with GUICtrlCreateListView().
- Fixed: Memory leak when AutoIt needed to get long file name.
- Fixed: ListviewItem not created after other child Window creation/deletion.
- Fixed: ControlGetFocus() returning bad ClassNN values.
- Fixed: Detection of invalid CONTINUELOOP statement.

3.2.6.0 (25th August, 2007) (Release)

- Changed: IconId in all GUI functions is now the same as GUICtrlSetImage().

WARNING: Previous scripts using GUICtrlSetImage(), GUISetIcon(), TraySetIcon() and TraySetPauseIcon()
    may display a wrong Icon. To get the same icon "if nId > 0 Then newId = - nId - 1".

- Changed: AutoIt .a3x and compiled script format.  Exe2Aut will only decompile 3.2.5.1
           and earlier files. No ExeAut utility is supplied for ongoing versions.

- Changed: General performance improvements (currently around 30-40% over 3.2.4.9)
- Changed: Limited Unicode support added in regular expressions.
- Changed: ControlMove() just resizing as WinMove() if X=Y=Default.
- Changed: PCRE engine updated from 7.0 to 7.1
- Changed: Suppress delay when speed=0 in MouseMove().

- Added: GUIGetStyle().
- Added: byte and ubyte type to DllCall().
- Added: ClassnameNN in control and summary info in Au3Info.
- Added: Float type to dllCall.
- Added: AU3Check v1.54.8 support for both "#AutoIt3Wrapper_plugin_funcs" and "#Compiler_plugin_funcs".
- Added: Extra parameter in ProcessClose() to close Stream handles.

- Fixed: AutoIt crash on WinWait("","text") when a Scite is open.
- Fixed: Some crashes on Chinese systems during Unicode/ANSI conversions.
- Fixed: Aut2Exe crashing on Chinese systems when running in ANSI.
- Fixed: Wrong Notification on {ENTER} after clicking on a listviewItem.
- Fixed: Wrong resetting of image on listviewitems if image set on the listview.
- Fixed: Resizing of listview control.
- Fixed: @error not set on bad WinGetPos() return.
- Fixed: LVM_EDITLABEL hogging cpu.
- Fixed: AutoIt (non UNICODE version) crash with some COM objects.
- Fixed: GUISetState() on GUI with W=0 or H=0.
- Fixed: GUI control Tip not reappearing after a click or timeout.
- Fixed: GUI controls not at the right position if a Control menu is in use.
- Fixed: EnvUpdate() in UNICODE AutoIt version not working since 3.2.3.3.
- Fixed: FileRead(..., count) returning count-1 chars.
- Fixed: Unicode filenames in FileInstall().
- Fixed: LVS_EX_HEADERDRAGDROP extendedstyle.
- Fixed: UpDown control shows through tabbed pages.
- Fixed: GUICtrlSetState on UPDOWN control without changing the state.
- Fixed: FileInstall() in compiled scripts causing GUI problems.
- Fixed: ControlGetFocus() on control not created with AutoIt GUI.
- Fixed: @AutoItPID and processlist coherency under Win9x.
- Fixed: GUICtrlSetResizing not returning error on non resizable control.
- Fixed: Regression for ControlSend SHIFTDOWN/UP since 3.2.3.13.
- Fixed: Drag and drop on a listview control after clicking on its header.
- Fixed: Support "resource only" dlls for GUISetImage().
- Fixed: Default minimum for GUICtrlSetLimit() set to 0.
- Fixed: Z order after GUICtrlSetStyle() on edit or input control.
- Fixed: FileReadLine() getting bad cached data when reading specific line numbers with file handles.
- Fixed: Slight lag in GUIGetMsg() under certain circumstances.
- Fixed: StringReplace() and occurances parameter.
- Fixed: GuiCtrlSetFont() on Tab control.
- Fixed: Leading blanks before #include cannot be compiled.
- Fixed: Notification on ENTER on Colored button.
- Fixed: RegWrite() setting bad registry entry in certain circumstances.
- Fixed: AutoIt hogging CPU when text msgbox too big.
- Fixed: ControlSend() sometime to wrong control when using empty controlid.
- Fixed: ProcessExists() under Win2K with processname >15 chars.
- Fixed: Int() with string comparison wrong match.
- Fixed: InetGetSize() in unicode version returns 0.
- Fixed: GUICtrlCreateListview() with more than 254 columns.
- Fixed: AutoIt Crash on recursive RegExp.
- Fixed: BitRotate() with left bit set.
- Fixed: Filemove() returning 1 without any move.
- Fixed: FileRead() returning chr(0) in ANSI mode.
- Fixed: Au3Info control coords relative to client.
- Fixed: StringInStr() not returning 0 when searching backward and search length greater than string.

3.2.4.9 (25th May, 2007) (Release)

- Added: StringCompare()

- Fixed: Basic string comparisons were not working with locale as in previous versions.

3.2.4.8 (23rd May, 2007) (Release)

- Fixed: Errors with non-western codepages and ANSI format scripts.

3.2.4.7 (22nd May, 2007) (Release)

- Added: Aut2Exe options for forcing ANSI mode compilation (/ansi and /unicode)
- Added: StringToBinary()
- Added: Additional unicode related options for BinaryToString()

3.2.4.6 (20th May, 2007) (Release)

- Fixed: StringReplace() and occurances parameter.

3.2.4.5 (20th May, 2007) (Release)

- Added: BinaryToString() for binary buffer to ANSI string quick conversions.
- Added: @Unicode to show if AutoIt is being run in Unicode or ANSI mode.

- Changed: StringReplace() speeded up - a lot.
- Changed: Au3Info is now resizable.

- Fixed: Chr(0) now properly works with Binary()

3.2.4.4 (17th May, 2007) (Release)

- Fixed: Chr(0) now acting more sensible (now acts in a similar way to VBScript).

3.2.4.3 (17th May, 2007) (Release)

- Fixed: FileRead() not working properly with unicode files.

3.2.4.2 (15th May, 2007) (Release)

- Changed: Au3Info graphical tweaks and Summary tab.

- Fixed: FileReadLine() getting bad cached data when reading specific line numbers with file handles.
- Fixed: Slight lag in GUIGetMsg() under certain circumstances.

3.2.4.1 (13th May, 2007) (Release)

- Added: ChrW() and AscW() for unicode operations.

- Fixed: Chr() and Asc() for character codes 128-255 in unicode mode.
- Fixed: Unicode BOM was not being written in file append modes if the file was empty.
- Fixed: Error in Include\GuiCombo.au3 and Include\IE.au3.

3.2.4.0 (10th May, 2007) (Release)

Big Changes:

- AutoIt is now compiled for Unicode!  AutoIt3.exe is Unicode - AutoIt3A.exe is ANSI.
- Au3Info tool rewritten.
- Binary data functions completely rewritten - scripts using these functions will need to be changed.

Other Changes:

- Added: New modes for FileOpen() to force Unicode and binary operations.
- Added: BinaryLen(), BinaryMid()
- Added: Colored GUI buttons.
- Added: DllStruct...() can reference elements by name rather than index.

- Changed: Removed restrictions on the maximum number of #include directives.
- Changed: Removed restrictions on the maximum number of DllOpen() handles.
- Changed: Removed restrictions on the maximum number of open files.
- Changed: Removed restrictions on the maximum number of hotkeys.
- Changed: Performance improvements in StringStripWS().
- Changed: Binary data in variants are now treated as a special type, separate from normal strings.
- Changed: BinaryString() renamed to Binary()
- Changed: IsBinaryString() renamed to IsBinary()
- Changed: ControlClick() can now click a control at a certain position.
- Changed: ControlClick() can now properly simulate double-clicks.
- Changed: ControlClick() no longer forces the activation of the parent window (up to the user now).
- Changed: ControlClick() related coordinates added to Au3Info.
- Changed: Improved the searches that can be done for windows/controls/instances.
- Changed: From DEFAULT_QUALITY to PROOF_QUALITY for Change/Set Font functions.
- Changed: x^y compatible with C99 standard.

- Fixed: Possible crash when using StringStripWS(), flag 4 and empty strings.
- Fixed: GUICtrlSetLimit() for UpDown controls wher min = max.
- Fixed: GuiCtrlSetTip() not always working correctly.
- Fixed: Slow GUI tab redrawing under Windows Vista fixed.
- Fixed: HotKeySet bad notification.
- Fixed: FileGetAttrib() on pagefile.sys.
- Fixed: Invalid default parameter in GUICtrlSetData() not detected.
- Fixed: Assign does return error on array element.
- Fixed: FileOpen("test.txt", 2+8) returning error.
- Fixed: Error detection in Enum statement.
- Fixed: Opt("WinTitleMatchMode").
- Fixed: Stack corruption resulting from improper use of DllCall() now gracefully aborts the script instead of hard crashing.
- Fixed: Crash when reading empty REG_MULTI_SZ.
- Fixed: Round() not returning an integer.
- Fixed: ControlSend() to empty "" ctrl fixed for inactive window. Also shift state behavior.
- Fixed : O^(-1).
- Fixed: Non detection of illegal statement.
- Fixed: HotKeySet("^{PAUSE]",... notification.
- Fixed: {CTRLBREAK} ->{BREAK} as ctrl is user responsability.
- Fixed: $var = Default passed as parameter to Com object.
- Fixed: Edit control would always have focus the first time the GUI was displayed even if it shouldn't.  This behavior also ignored $GUI_FOCUS.
- Fixed: range value for seed Number in SRandom().
- Fixed: Fileread crash if no count in raw mode.
- Fixed: Opt("WinTitleMatchMode", <0) really matching case insensitive.
- Fixed: FileSetAttrib/FileSetTime wrong setting.
- Fixed: Execute/Call recursive overflow display error message.
- Fixed: Aut2exe warning message if icon not found.
- Fixed: WinGetTitle() returns 1 on error.
- Fixed: Memory leak on keyword variable deallocation.

3.2.2.0 (23rd December, 2006) (Release)

- Added: StringRegExp() and StringRegExpReplace() regular expression support (Perl compatible)
- Added: Regular expression support for Window title matching.
- Added: ShellExecute() and ShellExecuteWait() functions.
- Added: #RequireAdmin for UAC/Windows Vista
- Added: Windows Vista help file entry.
- Added: GuiCtrlSetState() $GUI_DROPNOTACCEPTED.
- Added: $GUI_FOCUS, $GUINOFOCUS for listviewitem control.
- Added: IsDllStruct()
- Added: SRandom() to set seed for random number generation.
- Added: WinTitleMatchMode for case insensitive matching.
- Added: IconId can be reference by ordinal value if negative 1-based index is use.
- Added: CompiledScript string file info for compiled script.
- Added: Support >32x32 icon from .exe/.dll in GUICtrlCreateIcon or GUICtrlSetImage.
- Added: Expanded GUICtrlSetTip() to allow creation of tooltips with titles, icons and using the balloon tip style.
- Added: Tooltip supports Default keyword.
- Added: Remark added to _PathSplit() mentioning that it does not accept command line strings, only paths.
- Added: 2 UDF's to GUIStatusBar.au3.
- Added: GUICtrlCreateIcon and GUICtrlSetImage can select in multiple icon file by name.
- Added: @KBLayout to retrieve the current keyboard configuration.
- Added: ToolTip() option to ensure the tooltip is always displaying on a monitor.
- Added: IniWriteSection() function.
- Added: @extended error code on DriveMapAdd error.
- Added: Listview Alternate coloring with $GUI_BKCOLOR_LV_ALTERNATE.

- Removed: old WinShow, TimerStart and TimerStop functions.

- Changed: Performance improvements (up to 100% on some scripts!).
- Changed: @error set to WinAPI GetLastError() for Run().
- Changed: Small tweak to Floor() to ensure it is not as susceptible to floating point precision errors.
- Changed: Small tweak to Ceiling() to ensure it is not as susceptible to floating point precision errors.
- Changed: PixelChecksum() is now over 30x faster.
- Changed: FileGetVersion() extra parameter to retrieve string file info.

- Fixed: MsgBox() timeout on Windows Vista.
- Fixed: GuiCtrlRead on listview control when sorted.
- Fixed: @OSVERSION on Windows 9x.
- Fixed: GuiGetCursorInfo() with Handle not retrieving mouse click info.
- Fixed: DllCall() crashes when using uint, ushort.
- Fixed: List control height when font size changes.
- Fixed: GUICtrlSetImage() not testing icon on error.
- Fixed: @ScriptDir equal @WorkingDir for rootdir (x:\).
- Fixed: GUIGetCursorInfo() (winhandle) when child not active.
- Fixed: _StringAddComma().
- Fixed: drag & drop $GUI_EVENT_DROPPED notififation on edit control.
- Fixed: Coherency of type parameter for DLLCall() and DLLSructCreate()
- Fixed: Default keyword didn't always work correctly with COM objects.
- Fixed: COM property write fails when using arguments
- Fixed: Send/ControlSend for US international keyboard
- Fixed: Send/ControlSend char>=chr(128) for english keyboards.
- Fixed: COM property write fails when using arguments.
- Fixed: MsgBox() with task modal flag left GUI's disabled on timeout.
- Fixed: Error reporting by messagebox even with /ErrorStdOut.
- Fixed: GUICtrlSetImage default icon value for Icon Ctrl.
- Fixed: GUIRegisterMSG() destroyed @error.
- Fixed: $LVS_SORTASCENDING with GUICtrlSetImage icon gave bad display.
- Fixed: Some Object Collections could not be parsed in one AutoIt statement.
- Fixed: Bad screen updating of already unchecked radiobuttons.
- Fixed: Tray icon tooltip not displaying the scriptname when compiled.
- Fixed: UDP... return code on error.
- Fixed: UDPRecv() crashed on bad parameter.
- Fixed: COM was corrupting floating point values.
- Fixed: GUICtrlSetState doc remarks about menu control.
- Fixed: Refresh after a GUICtrlSetBkColor().
- Fixed: Crash on line begining with ~  : "Unable to parse line".
- Fixed: IniReadSectionNames() returned bogus data in Windows 98 when the INI file was empty or did not exist.
- Fixed: @compiled when the script is compiled.
- Fixed: Send() to italian keyboard.
- Fixed: MouseMove() in secondary screen.
- Fixed: StringInStr() not converting to string search parameter.
- Fixed: Int() of a binarystring.
- Fixed: ControlSend sending() special characters.
- Fixed: Crash in Au3exe with badly formed input file in FileInstall().
- Fixed: Wrong execution of a compiled script containing FileInstall() inside #CS-#CE.
- Fixed: FileInstall() referencing a file without any path will reference it from the ScriptDir to be coherent with the compiled script.
- Fixed: Aut2exe crashed using cmdline with shortnames.
- Fixed: Tooltip state (such as icon or title) was showing up on subsequent tooltips that didn't want those items.  This affected both ToolTip() and GUICtrlSetTip().
- Fixed: GUIRegisterMSG() destroy @error.
- Fixed: $LVS_SORTASCENDING with GUICtrlSetImage() icon bad display.
- Fixed: Wrong default arguments for _ArrayToString().
- Fixed: Bad "#" instruction inhibit whole script.
- Fixed: Installer SciTE bad link creation.
- Fixed: Uninstaller include file removal

3.2.0.1 (13th August, 2006) (Release)

- Fixed: (AU3INFO) Buffer overrun in control code.
- Fixed: Exe2Aut.exe was missing its digital signature.

3.2.0 (12th August, 2006) (Release)

- Added: COM object support.
- Added: Aut2Exe can now created .a3x encoded files (similar to .zip for .au3).
- Added: Support for custom tray icons.
- Added: "default" keyword.
- Added: IsKeyword() so "default" keyword can be used as parameter in a user function call.
- Added: Boolean support and keywords of 'false' and 'true'.
- Added: IsBool()
- Added: +=, -=, *=, /= operators.
- Added: DLLCall() cdecl and stdcall support.
- Added: DLLStruct... functions.
- Added: Limited TCP and UDP functions.
- Added: Added support for reading and writing stdio.
- Added: ConsoleRead(), ConsoleWriteError().
- Added: Ability to initialize arrays in DIM and CONST keywords.
- Added: Switch, EndSwitch structure.
- Added: HWnd() and IsHWnd() functions.
- Added: BinaryString(), IsBinaryString() functions.
- Added: FileCreateNTFSLink().
- Added: /AutoIt3ExecuteScript command line option.
- Added: Call() now supports parameters.
- Added: Execute()
- Added: @HotKeyPressed macro.
- Added: Unary NOT operations on strings are now allowed. A NOT operation on a non-empty string will result in FALSE.
- Added: Beep() and WinFlash() functions.
- Added: Floor() and Ceiling() functions.
- Added: SetError can optionally set @extended.
- Added: RegRead, RegEnumVal return the type of the value in @extended.
- Added: FileSaveDialog(), FileOpenDialog() supports multiple filter groups.
- Added: @ScriptLineNumber, @ProcessorArch, @AutoItPID.
- Added: BitRotate().
- Added: Fileopen(), FileCopy(), FileMove() additional flags to create non existent subfolders.
- Added: FileRead(), FileWrite() work with binary files.
- Added: (GUI) GUICtrlSetData text for treeview.
- Added: (GUI) $WS_EX_MDICHILD support for GUICreate().
- Added: (GUI) GUICtrlCreateGraphic(), GUICtrlSetGraphic().
- Added: (GUI) Opt('GUIEventOptions',1) to suppress window action when clicking on Minimize,restore or Maximize buttons.
- Added: (GUI) Right-click support for List/Treeview GUI control.
- Added: (GUI) GuiCtrlRead return ControlID if Opt("GUIEventCompatibilityMode',2).
- Added: (GUI) GUICtrlCreateMonthCal().
- Added: (GUI) Opt("GUIDataSeparatorChar",...).
- Added: (GUI) GUICtrlCreateObj().
- Added: (GUI) GUICtrlSetColor(), GUICtrlSetBkColor(), GUICtrlSetImage() for ListviewItem controls.
- Added: (GUI) GuiSwitch tabitemID optional parameter to allow dynamic control creation on a tabitem.
- Added: (GUI) GuiCtrlListView support Icon view.
- Added: (GUI) $GUI_WS_EX_PARENTDRAG Allow the label or pic control to be used as the title bar to drag the whole the parent window.
- Added: (GUI) GUICtrlGetHandle().
- Added: (GUI) $GUI_EVENT_DROPPED @GUI_DRAGID,@GUI_DROPID.
- Added: (GUI) GuiSetCursor(16),GuiCtrlSetCursor(16) hide the cursor.
- Added: (GUI) Allow Dragfile to any control. @GUI_DRAGFILE contain the filename to be used in the $GUI_EVENT_DROPPED.
- Added: (GUI) GUIRegisterMsg() to work with GUI WM_Message-routines at runtime.
- Added: (GUI) GUICtrlRegisterListViewSort() to create a real sorting routine for GUI ListView's.
- Added: (GUI) Icons for tab items.
- Added: (AU3INFO) AutoIt Windows Info : Now shows Style and exStyle values for the controls.

- Changed: #include search algorithm modified.
- Changed: The /c command line option has been replaced by /AutoIt3ExecuteLine.
- Changed: RegEnumKey and RegEnumVal return more precise @error to help diagnostic.
- Changed: Return,@error, @extended have to be explicit to be return by an UDF.
- Changed: FileFindFirstFile no longer returns "." or "..".
- Changed: Set _ to be a continuation character ONLY after whitespace.
- Changed: FileClose with an invalid handle no longer triggers an AutoIt runtime error.
- Changed: Fatal error message is now displayed if DLLCall cannot be executed.
- Changed: The default setting on Au3info was changed so that it doesn't highlight controls.
- Changed: RegEnumKey and RegEnumVal return more precise @error values to help diagnostics.
- Changed: "OnAutoItExit" function is now called on system shutdown or user logoff.
- Changed: Opt() with just the "option" will now return the current value for that option.
- Changed: DllCall @error is set when function not found.
- Changed: SplashTextOn() opt=32 to center vertically.
- Changed: (GUI) GUICtrlCreateList now forces the style LBS_NOTIFY.
- Changed: (GUI) GUICtrlCreateIcon default size is 32x32.

- Fixed: ContinueCase to keywords allowed after IF.
- Fixed: Mouse... invalid button definition.
- Fixed: IniDelete() could create an empty file if the file did not exist.
- Fixed: ToolTip Centering go around.
- Fixed: Menu/ContextMenu enable/disable.
- Fixed: Hotkey for filecreateshortcut.
- Fixed: MemGetStats >2Gb.
- Fixed: StringInStr return 0 when searching for "".
- Fixed: RegRead under Windows 2000.
- Fixed: Bad refresh on double GUICtrlSetPos.
- Fixed: ControlSend (...,"{CTRLDOWN}b{CTRLUP}).
- Fixed: ContextMenu position.
- Fixed: Made sure that declaring a UDF parameter in a Local or Global statement will raise an error.
- Fixed: File...Dialog browse through links.
- Fixed: ControlCommand "GetCurrentSelection".
- Fixed: Mouse... returns.
- Fixed: MouseClick, MouseUp bad behavior.
- Fixed: StringReplace("abc","","") returns 1 instead of "".
- Fixed: WinSetTrans returns error.
- Fixed: Assign not creating/assigning macro variable.
- Fixed: Assign respect Opt("MustDeclareVars",1).
- Fixed: @NumParams destroyed after UDF call.
- Fixed: MouseClickDelay option. (Fixed by Nutster)
- Fixed: Redim of array byRef parameter.
- Fixed: InputBox left,top values when not defined.
- Fixed: FileFindNextFile return error.
- Fixed: HWND string concatanation.
- Fixed: Exit inside UDF.
- Fixed: SendKeyDelay, SendKeyDownDelay when  no shift required.
- Fixed: FileReadLine with line=0.
- Fixed: Listview sorting with using styles: $LVS_SORTASCENDING and $LVS_SORTDESCENDING.
- Fixed: StringLen(integer) returning 0.
- Fixed: Reg... functions on IA64/X64.
- Fixed: FileFindFirstFile() leak handles.
- Fixed: @IpAddress when not network installed.
- Fixed: FileCopy, FileInstall, DirCopy, FileMove replacing the same file.
- Fixed: FileClose,FileFindNextFile, FileRead, FileReadLine, FileWrite, FileWriteLine, PluginClose, DllClose return 0 on bad handle.
- Fixed: FileCopy when creating subdir.
- Fixed: String... on nonstring parameters.
- Fixed: Float to Integer precision.
- Fixed: Bad FatalError after Exit in UDF. Only the first FatalError will be displayed if any before Exit.
- Fixed: Integer to string conversion.
- Fixed: StringMid($a,3).
- Fixed: StringSplit($a,"").
- Fixed: Refreshing of dispayed tabitem after a tabitem delete.
- Fixed: StringSplit($a," - ",1) string delimiter.
- Fixed: Return code from delayed function as WinWait destroyed by Adlib execution.
- Fixed: FileInstall on same dir.
- Fixed: Func definition with Byref and default value.
- Fixed: FileRead returning @error=-1 on empty file.
- Fixed: INetGetSize, INetGet @error return.
- Fixed: Run("a.tmp") a.tmp being a compiled script.
- Fixed: StringSplit("a : b + "," : ").
- Fixed: #include-once in main script.
- Fixed: PixelSearch performance.
- Fixed: HotKeySet("",...) return 0.
- Fixed: ExpandVarStrings $$, ExpandEnvStrings %%.
- Fixed: FileInstall in a compiled script whose name is not .exe or .a3x.
- Fixed: RegRead return right number of fields on REG_MULTI_SZ type.
- Fixed: FileRead($handle).
- Fixed: ElseIf ... Then statement not detected.
- Fixed: Illegal #include with no error message.
- Fixed: SplashTextOn Memory Leak.
- Fixed: #include recursion depth enforced.
- Fixed: @OSVERSION for WIN_XP running under X64 edition.
- Fixed: Comparison case insensitive accentuated upper case.
- Fixed: DriveMapDel /DriveMapAdd interaction.
- Fixed: RegRead MULTI_REG_SZ malformed key.
- Fixed: For Next with boundary,stepping being a string (no conversion to integer).
- Fixed: InetGet() could block the foreground execution even when run in background mode.
- Fixed: WinGetProcess and ProcessExist return same pid precision.
- Fixed: InetGet("abort") and exiting AutoIt with a download in progres now correctly stop the download immediately.
- Fixed: @InetGetBytesRead Byte count could be wrong due to a race condition.
- Fixed: DirCreate not creating subdir on dir with read/hidden/system attributes.
- Fixed: FileSetAttrib, FileSetTime destroy @workingdir.
- Fixed: (GUI) GUICtrlSetImage for 16x16 icon not repainting.
- Fixed: (GUI) The use of $GUI_GR_RECT and $GUI_GR_ELLIPSE under fixed under Win98.
- Fixed: (GUI) GUI Edit/Input control change notification.
- Fixed: (GUI) Avoid GuiSwitch when only one remain.
- Fixed: (GUI) GUI Multiple files drag & drop on edit/input control.
- Fixed: (GUI) GUI Colors on edit/input control.
- Fixed: (GUI) GuiCtrlSetImage return 0 on error.
- Fixed: (GUI) crash Autoit when click on header button of a listview control.
- Fixed: (GUI) GUICtrlState(@SW_MAXIMIZE or @SW_RESTORE).
- Fixed: (GUI) GuiCtrlSetStyle ES_READONLY on input/edit control.
- Fixed: (GUI) GUICtrlCreateTab disapearing.
- Fixed: (GUI) Resizing of GUI Combo control.
- Fixed: (GUI) GUICtrlSetData for list or combo not inserting.
- Fixed: (GUI) GUICtrlSetState for Menu/menuitem.
- Fixed: (GUI) GUICtrlDelete of a Listview control lead to crash after recreation with more columns.
- Fixed: (GUI) GUICtrlCreateListViewItem with more field than column.
- Fixed: (GUI) GUISetFont and Input Control not displayed.
- Fixed: (GUI) GUICtrlRead return on expanded TreeviewItem.
- Fixed: (GUI) Windows centering of GUICreate.
- Fixed: (GUI) GuiCtrlSetPos on Icon control.
- Fixed: (GUI) GuiGetCursorInfo on tab.
- Fixed: (GUI) Some flickering in GUICtrlSetImage.
- Fixed: (GUI) GuiCtrlSetState on non active tab.
- Fixed: (GUI) TreeviewItem notify when clicking a second time on the same item.
- Fixed: (GUI) GuiCtrlSetData on inactive tabitem not refreshing active item.
- Fixed: (GUI) GuiCtrlSetState on control tab.
- Fixed: (GUI) GuiCtrlSetState disable on hidden control tab.
- Fixed: (GUI) GuiGetCursorInfo with nonactive GUI.
- Fixed: (GUI) Bug with accelerator keys (Alt+...) and tabs.
- Fixed: (GUI) Treeview painting under OS <XP.
- Fixed: (GUI) GUICtrlSetData with float value.
- Fixed: (GUI) GuiCtrlSetImage repainting.
- Fixed: (GUI) Weird behavior when resizing column of listview on a tab.
- Fixed: (GUI) GuiCtrlSetState($tabitem,$GUI_SHOW) on visible GUI.
- Fixed: (GUI) GuiGetCursorInfo primary/secondary under nonXP.
- Fixed: (GUI) GuiCtrlSendMsg, TraySetState doc link.
- Fixed: (GUI) Crash when deleting an input control.
- Fixed: (GUI) GuiCtrlCreateCombo and $CBS_DROPDOWNLIST color.
- Fixed: (GUI) GuiCtrlCreateDate and $DTS_UPDOWN.
- Fixed: (GUI) GUI click return position.
- Fixed: (GUI) GuiGetMsg returning on Input control change.
- Fixed: (GUI) GUICtrlCreateInput/Edit forcing WS_TABSTOP when ES_READONLY.
- Fixed: (GUI) Resizing of controls dynamically created.
- Fixed: (GUI) a small flickering bug in CtrlSetImage() for treeview items.
- Fixed: (GUI) GuiCtrlSetPos, GuiCtrlSetResizing use visible window.
- Fixed: (GUI) GuiCtrlCreateIcon icon size in multiple icon .ico file.
- Fixed: (GUI) Pic control size inside a group control.
- Fixed: (GUI) listview repainting on tab.
- Fixed: (GUI) Memory overflow in customdraw operations in GUI while scrolling.
- Fixed: (GUI) Bad GuiCtrlSetResizing when no first show has occured.
- Fixed: (GUI) bkcolor label on tab if ListViewItem.
- Fixed: (GUI) $SS_CENTERIMAGE on pic control.
- Fixed: (GUI) AutoIt Crash when creating a control on a minimized window.
- Fixed: (GUI) GUICtrlSetImage icon.
- Fixed: (GUI) Grey coloring of input/edit control when disabled.
- Fixed: (GUI) Crash after GUICtrldelete of a control having the focus.
- Fixed: (GUI) UICreate with WS_VISIBLE do an implicit GUISetState().
- Fixed: (GUI) Background label bad firing when overlayed by an edit control.
- Fixed: (GUI) GuiCtrlSetData can delete a specific column.
- Fixed: (GUI) memory leak on GuiDelete($tabitem with icon).
- Fixed: (GUI) GUI updown control notification if change with keyboard.
- Fixed: (GUI) GUIGetCursorInfo on listview header.
- Fixed: (GUI) GUICreate WS_POPUP Centering.
- Fixed: (GUI) Bad Notification on end of drag when $GUI_DROPACCEPTED not set on a control.
- Fixed: (GUI) GUISetState(@SW_UNLOCK) force repainting.
- Fixed: (GUI) GUICtrlSetState $GUI_SHOW on tab with $TCS_BUTTON style.
- Fixed: (GUI) Bad tabitem creation when no tab defined.
- Fixed: (GUI) Bad combo disable 16-bit color under W2K.
- Fixed: (GUI) GUISetBKColor freezing the display.
- Fixed: (GUI) GUICreate $WS_CHILD+$WS_VISIBLE w=0 or h=0 lead to crash AutoIt.
- Fixed: (GUI) GuiCtrlCreatePic w=h=0.
- Fixed: (GUI) GUICtrlRead menuitem checked.
- Fixed: (GUI) Labels were not painted correctly on tab controls.
- Fixed: (GUI) GUICtrlSetState(tabitem,@SW_SHOW) under creation bad tabitem display.
- Fixed: (GUI) GUICtrlSetData on listview/listviewItem bad erasing.
- Fixed: (GUI) GUICtrlSetImage on a GUI defined with $WS_VISIBLE.
- Fixed: (GUI) GuiCtrlSetState( ,$GUI_FOCUS) changing tab ordering. Need to create a new state $GUI_ONTOP.
- Fixed: (GUI) Extra notification on first/default control after GUISetState().
- Fixed: (GUI) Event notification on {enter} on an edit control.
- Fixed: (GUI) $GUI_EVENT_MOUSE firing without any mouse movement.
- Fixed: (GUI) GuiCtrlSetState( ,$GUI_FOCUS) on button repainting.
- Fixed: (GUI) Drag&Drop of listviewitem onto another listview. $GUI_ACCEPTFILES has been renamed in $GUI_DROPACCEPTED.
- Fixed: (GUI) TabStop order.
- Fixed: (GUI) GUICtrlSetPos with a Child window.

3.1.1 (7th Apr, 2005) (Release)

- Fixed: @OSVersion did not work for Windows Server 2003
- Fixed: $LVS_EX_FULLROWSELECT in GuiConstants.au3 was defined $LBS...
- Fixed: @YDAY was incorrect (one day out)

3.1.0 (7th Feb, 2005) (Release)

- Added: GUI creation capabilties
- Added: DllCall(), DllOpen(), DllClose()
- Added: ControlListView()
- Added: WinList()
- Added: DirGetSize()
- Added: IniReadSectionNames(), IniReadSection()
- Added: InetGet(), InetGetSize()
- Added: HttpSetProxy(), FtpSetProxy()
- Added: FtpBinaryMode (Option)
- Added: Ping()
- Added: ControlGetHandle()
- Added: WinGetProcess() and ProcessList()
- Added: SetExtended()
- Added: WinSetTrans()
- Added: Assign()
- Added: ConsoleWrite()
- Added: @AutoItExe macro
- Added: Const keyword
- Added: Optional parameter support for user functions
- Added: "main", "primary", "menu", "secondary" added as valid mouse button types
- Added: ExpandVarStrings (Option)
- Added: The user functions OnAutoItStart() and OnAutoItExit() are called during startup/exit
- Added: OnExitFunc (Option)
- Added: (Internal) Native HWND datatype added to variants

- Removed: URLDownloadToFile() (Replaced by InetGet())

- Changed: For loops automatically declare the counter variable as a Local variable
- Changed: IniDelete() can also delete entire sections
- Changed: StringReplace() also returns the number of replacements in the @extended macro
- Changed: StringMid() the "count" parameter is now optional (assumes remainder of the string)
- Changed: PixelChecksum() now has optional step parameter
- Changed: Control...() functions now accept the Control ID as an extra way to identify a control
- Changed: InetGet() function can download in the background
- Changed: Reg...() functions no longer give a hard error when an unknown key is used.
- Changed: The mouse and pixel functions now have an additional "client area" mode
- Changed: Added WIN_2003 to the possible values for @OS_VERSION
- Changed: AU3Spy.exe renamed to AU3Info.exe
- Changed: Major upgrades to the AutoIt Window Spy (control highlighting, magnify)
- Changed: FileSelectFolder supports an initial directory as well as a root directory
- Changed: File functions no longer give fatal errors when -1 is used as a handle
- Changed: (Internal) new quicker variable lookup using a binary tree
- Changed: (Internal) new shared process memory class used for StatusBarGetText()
- Changed: (Internal) Unified structure stacks (If, Func, Select, While, Do, For)
- Changed: (Internal) Variant rewrite (now handles int32, int64, double, string, HWND data)

- Fixed: Memory leak in SplashImageOn()
- Fixed: Expressions like "$var = $var" will now give an error if the variable wasn't previously defined
- Fixed: StringFormat() with \\ characters
- Fixed: Under rare situations after closing a script AutoIt3.exe would still appear in task manager for a while
- Fixed: Certain paths like @WindowsDir were incorrect under Windows Terminal Server
- Fixed: FileSetTime() systems in non-GMT timezones had incorrect results
- Fixed: FileMove() with UNC paths (does a real move when in the same dir rather than a copy).
- Fixed: ^ operator
- Fixed: Chr()
- Fixed: StatusBarGetText() failed when used with no "Text" parameter
- Fixed: InputBox() didn't return focus to the previously active window

3.0.102 (4th August, 2004) (Release)

- Major Change: Colors now default to the standard RGB format rather than the previous BGR format.

    This affects PixelSearch, PixelGetColor.

    The "ColorMode" option has been added to allow old scripts to run with the old BGR mode, just
    place this line at the top of your script to use the old method:

    Opt("ColorMode", 1)

- Added: DriveMapAdd(), DriveMapDel() and DriveMapGet()
- Added: @SW_SHOWDEFAULT, @SW_SHOWMAXIMIZED, @SW_SHOWMINIMIZED, @SW_SHOWMINNOACTIVE,
        @SW_SHOWNA, @SW_SHOWNOACTIVATE, @SW_SHOWNORMAL
- Added: FileGetShortcut()
- Added: Predefined $CmdLineRaw variable now holds the original command line in full
- Added: @DesktopDepth
- Added: ReDim
- Added: Command line option /ErrorStdOut
- Added: More command line params for Aut2Exe.exe: /nodecompile and /comp 0-4  (compression level, 4=best)
- Added: Process ID (PID) support for Process...() and Run() functions
- Added: ProcessSetPriority()
- Added: Decompiler (Exe2Aut) added
- Added: PixelChecksum()
- Added: Strings starting with "0x" are converted from hex when used numerically
- Added: Multi-directory #include <> paths
- Added: MouseWheel()
- Added: FileRecycleEmpty()
- Added: RegEnumKey() and RegEnumVal()

- Changed: TimerStart() renamed to TimerInit().  TimerStop() renamed to TimerDiff()
- Changed: FileSelectFolder() flag parameter changed
- Changed: REG_MULTI_SZ values allow double NULL values.
- Changed: BirOr(), BitAnd() and BitXOR() take up to 255 parameters
- Changed: Icon and windowstate options added to FileCreateShortcut()
- Changed: RunAsSet() supports extra profile handling options
- Changed: RegWrite() now accepts just the keyname in order to create a keyname with no value
- Changed: "Allow Decompilation" option added to Aut2Exe
- Changed: Aut2Exe gives feedback during compilation and gives the option to abort
- Changed: Compiled scripts run/extract much faster when using FileInstall and medium/large files
- Changed: Max number of user function limits removed
- Changed: Max number of variable limits removed
- Changed: -1 does no sleep at all for Send/Mouse delays (SendKeyDelay, etc...)
- Changed: Optional occurance parameter added to StringInStr()
- Changed: Optional default filename added to FileOpenDialog() and FileSaveDialog()
- Changed: Registry functions accept 4 letters keys (HKLM instead of HKEY_LOCAL_MACHINE, etc.)
- Changed: Remote registry keys are accepted in the form "\\computername\key\subkey"
- Changed: AutoItSetOption returns the previous setting
- Changed: (Internal)  Built-in function lookups completely rewritten
- Changed: (Internal) String functions speeded up (concat in astring and variants)
- Changed: (Internal) ControlSearch modified to include the windowsearch

- Fixed: FileGetSize() works on >2GB files and in-use files
- Fixed: The expression: If "non-blank" And 1 - now evaluates as true
- Fixed: /c command line use in compiled scripts
- Fixed: ToolTip() when the mouse is near the bottom of the screen
- Fixed: StringIsDigit()
- Fixed: Process... functions under NT4 unable to see certain processes
- Fixed: Some keywords incorrectly allowed after a THEN keyword
- Fixed: (Internal) Hotkey registering logic

3.0.101 (11th Mar, 2004) (Release)
- Added: MemGetStats()
- Fixed: Compatibility problem under Windows 95a
- Fixed: Some minor help file typos corrected

3.0.100 (29th Feb, 2004) (Release)
- Added: WinTextMatchMode (Option)
- Fixed: ExitLoop and ContinueLoop failed during a recursive function
- Fixed: Sleep(0) (or < 0 ) no longer hangs
- Fixed: $ with no name was allowed as a variable
- Fixed: For Loop bug when used in recursion
- Fixed: FileGetLongName() return value
- Fixed: @UserProfileDir under 9x
- Fixed: IsDeclared()
- Fixed: Random()

3.0.94 (21st Feb, 2004) (Beta)

SCRIPT BREAKING CHANGES for FileReadLine and FileWriteLine:

FileWriteLine now automatically writes a DOS @CRLF pair UNLESS the last character of
the string to write is already @CR or @LF (to make it possible to write non-DOS text files)

FileReadLine will correctly read a DOS, UNIX or MAC line (@CRLF, @LF and @CR terminated respectively).

FileWrite and FileRead added to add further support.

CHANGE YOUR SCRIPTS AS FOLLOWS:

From: FileWriteLine($handle, "line" & @LF)
To: FileWriteLine($handle, "line" & @CRLF) or FileWriteLine($handle, "line")

From: FileWriteLine($handle, "line")
To: FileWrite($handle, "line")

- Added: FileWrite() and FileRead()
- Changed: FileReadLine() and FileWriteLine()
- Added: ToolTip()
- Added: Eval() and IsDeclared()
- Added: CaretCoordMode (AutoItSetOption)
- Added: WinGetCaretPos()
- Added: WinGetState()
- Added: MustDeclareVars (AutoItSetOption)
- Added: Editors page in help
- Changed: EnvSet()
- Changed: WinShow() renamed to WinSetState()  (With WinShow() as an alias)
- Fixed: Splash() and moveable flag (and -1 default flag in options)
- Fixed: Odd elseif error message showing wrong line
- Fixed: Crashes with bad function calls: MsgBox(MsgBox(MsgBox))
- Fixed: HotKey crashes when unregistering a key that was not registered

- Fixed: (Internal) WinWaitDelay, SendKeyDelay, etc type commands now more accurate (previously only accurate to 10ms (NT) or 55ms (9x))
- Fixed: (Internal) Execute() recursion limit dropped to 384 levels
- FIxed: (Internal) Calls to Util_AttachThreadInput will not attach to hung windows
- Fixed: (Internal) some RegRead/RegWrite sizing problems (Ta, Chris)

3.0.93 (12th Feb, 2004)
- Added: SendAttachMode (AutoItSetOption)
- Added: Opt() is an alias for AutoItSetOption() :)
- Added: Doc updates
- Added: WinSearchChildren (AutoItSetOption)
- Changed: Splash and Progress functions have a "moveable" option
- Changed: StringStripWS (new strip all ws mode)
- Changed: InputBox (timeout param)
- Changed: Hot keys are no longer buffered when the script is paused.
- Fixed: REG_MULTI_SZ support
- Fixed: TrayIconDebug not showing correct filename
- Fixed: ControlClick, ControlCommand("CHECK")
- Fixed: Control functions now using return values rather than @error where appropriate.
- Fixed: Error with '' quotes in Aut2Exe
- Fixed: StringFormat()
- Fixed: Lexer checks that potential user function calls are for existing functions
- Fixed: Input thread attachment in Send() ( check Send("{... down}") still works)

- Changed: (Internal) Removed the only sscanf call and replaced with own code - saves 4KB.

3.0.92 (6th Feb, 2004)

Note: Script breaking changes to ControlLeftClick(), FileFindFirstFile(), SendSetCapslockState()

- Added: Dec()
- Added: BitNOT(), BitXOR(), BitShift()
- Added: TrayIconDebug (AutoItSetOption)
- Added: Dim single-line initialization and multiple variables
- Added WinTitleMatchMode 4 (AutoItSetOption)
- Added: #comments-start and #comments-end for multiline comments
- Added: DirCopy()
- Added: DirMove()
- Added: Controls will be checked by visible text as well as classname (waves to Chris :) )
- Added: Macros: @USERPROFILEDIR, @HOMEDRIVE, @HOMEPATH, @HOMESHARE, @LOGONSERVER, @LOGONDOMAIN, @LOGONDNSDOMAIN
- Removed: SendSetCapslockState() - Use Send("{CAPSLOCK on/off}")
- Changed: FileFind works differently (handles used and multiple finds now supported)
- Changed: ControlLeftClick() renamed to ControlClick() and options added.
- Changed: Window Spy options added and ability to freeze display
- Changed: StringSplit will return each char if delimiters are ""
- Changed: WinMenuSelectItem return value
- Changed: optional variation added to PixelSearch()
- Changed: optional step value added to PixelSearch()
- Changed: FileMove() overwrite flag added
- Changed: *.* assumed if a directory is used in FileCopy/FileMove/FileDelete
- Fixed: @TempDir under certain conditions
- Fixed: Hotkeys were ignored while another hotkey function was running

- Changed: (Internal) DirRemove changed
- Changed: (Internal) Sendkeys tweaked A LOT

3.0.91 (29th Jan, 2004)
- Added: Options: MouseClickDelay, MouseClickDownDelay, MouseClickDragDelay (AutoItSetOption)
- Added: REG_BINARY type for RegRead() and RegWrite()
- Added: FileChangeDir()
- Added: ControlCommand() - added GETCURRENTSELECTION
- Added: Added some standard library includes (See Program Files\AutoIt3\Include\)
- Added: SendKeyDownDelay (AutoItSetOption) (alters the amount a time a key is held down before released)
- Added: AutoIt returns an exit code of 1 if script could not be loaded
- Added: FileSetAttrib(), FileSetTime()
- Added: In Au3_Spy pixel colour is also shown in hex
- Fixed: While loops failing when used in recursive functions of themselves... (!?)
- Fixed: Small line coninuation _ bug
- Fixed: URLDownloadToFile()
- Fixed: FileRecycle() not always working
- Fixed: FileRecycle() return value
- Fixed: Relative #include use
- Fixed: Smart boolean comparision re-added
- Fixed: FileFindFirst() not releasing memory when called multiple times
- Changed: FileGetTime outputs strings with leading 0s when required
- Changed: Default value of Local/Global/Dim is the String "" (equates to 0 when used as a number)

- Changed: (Internal) More scriptfile.cpp optimization
- Changed: (Internal) Execute() recursion levels limited to 512 to prevent stack overflows

3.0.90 (20th Jan, 2004)
- Fixed: Serious nested IF bug

- Changed: (Internal) Rollback of variabletable.cpp and stacks/vectors

3.0.89 (19th Jan, 2004)
- Added: Method for standard library functions and includes
- Added: #include < > support (must be fully installed to work)
- Added: #include-once directive (put at the top of a file to make sure it is only
       included once)
- Added: @UserName and @TempDir macros
- Fixed: Nasty fatal bug in 3.0.88

3.0.88 (18th Jan, 2004)
- Added: ElseIf
- Changed: All block structures (IF/WHILE/FOR, etc.) are now checked before execution.
- Fixed: Some single hotkeys not working
- Fixed: Better detection of illegal nesting, e.g.:
         if 1 = 1
           while 1
         endif
           wend

- Changed: (Internal) lots of error checking code removed as a nice side effect of
         initial block structure checking
- Changed: (Internal) windows string functions (lstrcmp etc) moved back to C versions
         due to massive performance penalty

3.0.87 (15th Jan, 2004)
- Changed: Aut2Exe stores files it can't compress (.zip etc) rather than expanding
- Fixed: Aut2Exe crashing if FileInstall used a file less than 4 bytes
- Fixed: Aut2Exe crashing with uncompressable files
- Fixed: RegRead not working correctly with large DWORD values
- Fixed: NOT fixed when skipped during a boolean expression

- Changed: (Internal) variable_table.cpp rewritten
- Changed: (Internal) All stacks/vectors replaced with templated code

3.0.86 (12th Jan, 2004)
- Added: Enhanced boolean comparisons
- Added: Send can hold keys down, e.g. Send("{a down}") will hold the A key down (only works usefully with games)
- Fixed: 0 ^ 0 = 1
- Fixed: on_top parameter of ProgressOn()
- Fixed: No longer hanging with blank search in StringReplace()
- Fixed: Asc() giving -1 in some cases
- Fixed: Tray icon's tip not updating when un-pausing
- Changed: Single keys of 0-9, a-z can no longer be used as hotkeys if alt,ctrl or win is NOT also used.

- Changed: (Internal) FPU assembler used for advanced math (sin,cos,pow, etc) functions due to
         exe size problems under VC7

3.0.85 (9th Jan, 2004)
- Added: HotKeySet()
- Added: Abs(), Sin(), Cos(), Tan(), ASin(), ACos(), ATan(), Sqrt(), Log(), Exp()
- Added: ^ operator
- Added: Round()
- Added: Call()
- Changed: IniWrite/IniDelete() return 0 if they fail
- Changed: No longer need to use virtual keys for FileCreateShortcut()
- Fixed: Return value for FileCopy/FileInstall()
- Fixed: Incorrect use of ExitLoop/ContinueLoop trapped

- Changed: (Internal) Send() tweaking
- Fixed: (Internal) Function calling/scope slightly bugged (Adlib, Hotkey)

3.0.84 (30th Dec, 2003)
- Added: New window WinTitleMatchMode of 3 (for exact title match)
- Added: Some more details added to helpfile
- Changed: The key # is no longer used as a delimiter but as a left Win key combination.  So
           Send("#e") now presses the left win+e keys.  I don't think anyone actually used
           it as a delimiter anyway - it was just a left over from v1 and it never made
           lines easier to read anyway
- Changed: FileReadLine() and FileWriteLine() modified so that they optionally accept a filename
           instead of a filehandle for "quick 'n' dirty" file access - I'm sure this will be
           popular :)

3.0.83 (30th Dec, 2003)
- Changed: Due to popular demand, by default functions now return 0 for error and 1 for success.
           This affects the following functions: FileWriteLine, CDTray, DriveSetLabel, DirCreate,
           DirRemove, FileCopy, FileMove, FileDelete, FileInstall, ClipPut, URLDownloadToFile,
           RunAsSet, Shutdown, RegWrite, RegDelete, WinWait, WinWaitActive, WinWaitClose, WinWaitNotActive,
           ProcessWait, ProcessWaitClose.  If you were using the return values of one of
           these functions then please check your scripts.

- Changed: ControlSend() supports {} (for most things at least...)

3.0.82 (29th Dec, 2003)
- Added: Files installed with FileInstall() now have original timestamps (created/modified)
- Added: IsNumber()
- Fixed: Number to string conversions and general float parsing

- Changed: (Internal) FileInstall() compression code updated

3.0.81
- Fixed: Yet more bugs with single line IF - regretting adding this feature already...
- Fixed: Bugs with NOT operator and the new variant code
- Fixed: Bug with clicking CANCEL on the open script window (introduced in 3.0.80)
- Fixed: StringIs... functions failing when using numbers as parameters

- Fixed: (Internal) AVector<Variant> modified to allow reference access to variants (instead of copying everytime)

3.0.80 (15th Dec, 2003)
- Changed: Number to String conversions tweaked
- Fixed: Massive bug fixed with arrays introduced in 3.0.76
- Fixed: Line continuation crash

- Changed: (Internal) script reading code updated for Aut2Exe and merged with AutoIt

3.0.79 (15th Dec, 2003)
- Added: Lines can be continued over many lines - use _ at the end of a line to continue it (as VBScript)
- Added: Single line IF statements possible
- Changed: Maximum line length (including total of combined lines) increased from 1023 to 4095 characters.
- Changed: "Then" keyword in IF statements no longer optional (helps with single line IFs)

e.g.
MsgBox(0, "Test", "This is some text _
    And more text _
    And even more text")

3.0.78 (15th Dec, 2003)
- Changed: Variants work differently - no longer a seperate INTEGER type
- Changed: Float() changed to Number()

    All numbers now 15digit precision (internal C double type)
    Also affects Random() you will get floating point numbers back unless you use Int()
        with the result

3.0.77 (30th Nov, 2003)
- Added: New option "TrayIconHide" (AutoItSetOption)
- Changed: "AutoIt -" prefix removed from compiled a script's tray icon
- Changed: Compiled script's file properties point to a custom web page
- Fixed: Tray icon should redraw after an explorer crash

3.0.76 (30th Nov, 2003)
- Fixed: Couple of bugs with ContinueLoop and ExitLoop
- Fixed: Statements like $test[$test[0]] now working

3.0.75 (30th Nov, 2003)
- Added: ControlGetFocus()
- Added: Local and Global keywords
- Changed: Dim (along with Local/Global) can now be used as in vbscript to declare variables
- Changed: FileOpenDialog() uses "|" as the delimiter instead of ","
- Fixed: PixelSearch()
- Fixed: SoundPlay()...maybe
- Fixed: Splash() sizing issues

3.0.74
- Added: Hex notation for integer numbers ($var = 10 or $var = 0xa)
- Added: MouseDown(), MouseUp()
- Added: TrayTip()
- Fixed: PixelCoordMode not working correctly
- Fixed: Compiled exes not producing random numbers

3.0.73
- Added: New option "RunErrorsFatal" (AutoItSetOption)
- Added: New option "ExpandEnvStrings" (AutoItSetOption)
- Changed: FileMove() moves/renames without affecting timestamps - can also be used
           for directories
- Changed: RegRead/RegWrite() now supports REG_EXPAND_SZ
- Changed: Extra options added to FileGetTime()
- Changed: Extra 250ms delay added to start and end of mouse drags
- Fixed: Odd error message fixed where a user function contained a badly formatted line

3.0.72
- Fixed: Compiler was ignoring comments near FileInstall() functions
- Fixed: Memory leak in StatusBarGetText()
- Fixed: PixelGetColor
- Added: New option "PixelCoordMode" (AutoItSetOption)

3.0.71
  Get ready for some script rewriting...*holds up banner with BETA written on it :) *

- Added: ControlSend()
- Added: Framework for AutoItSetOption() - note: this function replaces all
         functions like WinSetDelay, SendSetDelay, MouseSetMode, etc.
- Removed: MouseSetMode(), SendSetCapslockMode(), SendSetDelay(), WinSetDelay(), WinSetDetectHiddenText()
           WinSetTitleMatchMode()

3.0.70
- Fixed: SoundPlay()
- Removed: AutoItWinShow(), AutoItWinWrite(), AutoItWinGetText()
- Changed: ControlCommand() (updated with Larry's recent changes)
- Changed: RegRead() extended error codes
- Added: FileFindFirstFile(), FileFindNextFile()
- Added: AutoItWinGetTitle()
- Added: WinGetClientSize()
- Added: EnvUpdate()
- Added: SoundSetWaveVolume()
- Added: FileGetLongName(), FileGetShortName()
- Added: TimerStart(), TimerStop()

3.0.69
- Fixed: Small delay added into mouseclick functions
- Fixed: FileGetVersion()
- Fixed: WinMenuSelectItem()
- Fixed: StringSplit() buffer overrun

3.0.68
- Added: FileGetAttrib(), WinMenuSelectItem(), FileGetVersion()
- Added: Added options to ControlCommand()

- Changed: (Internal) Larry's nFlag functions split

3.0.67
- Changed: InputBox() narrowed slightly
- Fixed: AutoIt icon not refreshing if Return was used at top level of script
- Fixed: Crash with extra long lines fixed
- Fixed: @OS_VERSION weirdness fixed

- Changed: (Internal) MessagePump handled differently and recursion level of Execute() tracked

3.0.66
- Changed: StringSplit() returns full string in array if no delimiters matched (and count=1 not 0)
- Fixed: Crash related to window titles and text fixed.

3.0.65
- Added: ControlCommand() option GetCurrentLine
- Fixed: Possible bug with optional "Then" statement fixed
- (Internal) Window searching functions altered to check for hung windows

3.0.64
Fixed: IniWrite/Delete() functions were not flushing immediately under 9x.
Added: Errors now include the file name that contained the error

3.0.63
- Changed: ControlCommand() various internal changes.
- Fixed: MsgBox() character limit bug fixed
- Changed: Can now specify a custom time for AdlibEnable()

3.0.62
- Fixed: Aut2Exe icon changing code bugged
- Changed: Timing of "paused" flash and icon modified a little.

3.0.61
- Fixed: FileOpenDialog()
- Changed: (Internal)Encryption code modified - check compiling thoroughly
- Added: AutoIt icon flashes when in paused state

3.0.60
- Changed: Aut2Exe strips version info from compiled script. (Hoping to be custom versioninfo in future)
- Fixed: FileGetSize() (change made, unsure if problem fixed)
- Fixed: FileMove wasn't supported on 9x (9x has no MoveFileEx function, Dave... :) )

3.0.59
- Fixed: InputBox was not returning "" on cancel

3.0.58
- Fixed: The window text searching in AutoIt was not the same as AU3_Spy or WinGetText()
- Added: InputBox() (and very nice it is too...)
- Added: FileMove()

3.0.57
- Fixed: MsgBox under 9x was doing odd things with timeouts - tried something else.

3.0.56
- Fixed: Selecting the default icon in Aut2Exe was not saved between sessions
- Fixed: @OSLang under NT4...
- Added: SysTabControl32 tabbing

3.0.55
- Changed: Better icon support added to Aut2Exe
- Changed: (Internal) upx.exe called during the compiler to compress data -
    necessary to do it this way as you can't edit the resources of a compressed
    exe
- Changed: SoundPlay()

3.0.54
- Fixed: Compiled scripts with custom icons were failing
- Fixed: @OS_LANG under 9x

3.0.53
- Added: StringSplit()

3.0.52
- Changed: SoundPlay() option to wait added
- Added: ChangeIcon support back in Aut2Exe (32x32x16) - Slightly better than v2 in that
        a multiimage iconfile can be used - although only the 32x32x16 image is actually used.

3.0.51
- Fixed: Aut2Exe still used ' comments when including files -whoops.

3.0.50
- Changed: (Internal)A little error checking added to the lexer
- Added: @TAB, @COMSPEC
- Changed: MouseClick() parameters changed
- Added: MouseClickDrag()

3.0.49
- Fixed: Statusbar in Aut2Exe with Visual Styles
- Changed: Single line comment character is now ;
- Changed: ' and " may now be used for strings

3.0.48
- Added: StringIsFloat(), StringIsInt()
- Fixed: MsgBox() wasn't returning -1 on timeout
- Fixed: StringReplace() error if string to replace was at end of string
- Changed: StringReplace() count is now optional (assumes global)
- Added: Aut2Exe and AutoIt3 now use Visual Styles

3.0.47
- Changed: FileExists() to work with wildcards
- Changed: Extra options added to AutoItWinShow()
- Changed: RegRead returns the string "" in addition to @error if the (default) key was requested
    and not found.
- Fixed: DriveGetDrive()  (still an a: drive bug to find though)

3.0.46
- Fixed: RegDelete() return value when value does not exist
- Fixed: CDTray() open/closed problems
- Fixed: FileSelectFolder() crash due to missing initialisers

3.0.45
- Changed: Set...() functions renamed (SendSetDelay, WinSetDelay, etc.)
- Added: StatusbarGetText()

3.0.44
- Added: Break()
- Fixed: DriveStatus()
- Fixed: RegDelete()

3.0.43
- Fixed: @OSLang for 2000+
- Added: Hex(), AutoItWinGetText()
- Changed: UBound() back to how it was again (same as VBScript syntax)

3.0.42 (30th Aug, 2003)
- Tweaked: Mouse coords were 1 pixel out
- Added: MouseSetMode() to allow for screen _and_ relative coords - yay everyone's happy

3.0.41 (30th Aug, 2003)
- Fixed: Bug with invalid filehandles (again!).
- Changed: Mouse commands may now work on multiple monitors.
- Fixed: $CmdLine wasn't working correctly for compiled scripts.
- Fixed: The operator == wasn't properly comparing strings
- Fixed: INI functions, filename now doesn't need ".\file.ini" to work in the current directory
- Fixed: Bug in Run() directory would not be set if last parameter was used

3.0.40
- Added: Windows API error messages added onto errors for the Run() commands
    (directory invalid, bad logon, etc).

3.0.39 (29th Aug, 2003)
- Added: RunAsSet() (2000/XP only)
- Added: FileRecycle()

3.0.38 (28th Aug, 2003)
- Changed: WinGetText now correctly takes note of detecthiddentext setting
- Added: StringStripWS()
- Added: DriveGetLabel(), DriveGetSerial(), DriveGetFileSystem(),
        DriveSetLabel(), DriveGetType(), MouseGetCursor()

3.0.37
- Changed: Compression tweaked in Aut2Exe

- Changed: UBound($array) now returns number of dimensions
- Renamed all the IsUpper/IsAlpha, etc functions to StringIsUpper/StringIsAlpha, etc.
- Added: IsFloat(), IsArray(), IsInt(), IsString()
- Added: Mod()

3.0.36
- Fixed: Main dialog in Aut2Exe
- Added: New compression code (slower but better at higher levels)

3.0.35
- Added: FileInstall() support
- Added: SplashImageOn(), SplashTestOn(), SplashOff()
- Added: ProgressOn(), ProgressOff(), ProgressSet()
- Added: Compression level option in Aut2Exe

3.0.34
- Fixed: subscript must be > 0 in Dim statement
- Added: Compiled script reading code added
- Added: @Compiled
- Added: Aut2Exe

3.0.33 (22nd Aug, 2003)
- Added: Case Else
- Added: @DesktopWidth, @DesktopHeight
- Fixed: CDTray - closed/close
- Fixed: Incorrect reference passing of global variables
- Fixed: Bad file handle causing a crash in FileWrite/Read/Close
- Fixed: Crash with badly formatted Func statements
- Parsing speeded up (doubled the speed)
- Optimized string handling in variants

3.0.32 (20th Aug, 2003)
- Started proper version logging :)

First public beta binary - 4th Mar, 2003.

Development started - 20th Jan, 2003.


AutoIt Changelog (including beta version changes)
=================================================

3.3.6.1 (xth April, 2010) (Release)
AutoIt:
- Fixed #1515: FileOpen still opening in exclusive mode in some situations.

3.3.6.0 (7th March, 2010) (Release)

3.3.5.6 (28th February, 2010) (Beta)
AutoIt:
- Fixed: StringRegExp() functions were accidentally removed.

3.3.5.5 (28th February, 2010) (Beta)
AutoIt:
- Fixed #1475: TrayItemSetState($Value, $Tray_Checked) incorrectly enables a disabled TrayItem.
- Fixed: StringToASCIIArray() was incorrectly truncating UTF-16 values at 8 bits.

UDFs:
- Fixed #1445: Documentation updated for _MemGlobalFree().
- Fixed #1469: _GDIPlus_BitmapCloneArea() documentation updated.
- Fixed #1466: _GUICtrlEdit_GetLine() returns an unexpected character.
- Fixed #1487: _DateToDayOfWeekIso returned 0-6 but should be 1-7 where Monday = 1

3.3.5.4 (13th February, 2010) (Beta)
AutoIt:
- Changed: FileWriteLine() performance improved.

- Added: ControlCommand() "SendCommandID" - used to send WM_COMMAND Control ID messages. Allows the
    automation of ToolBarWindow32 controls (amongst others). For example, the "Back" button of
    Internet Explorer. Use Au3Info to get the Command ID from the ToolBar tab.

- Fixed #1458: Inet sizes were capped to 32-bits.
- Fixed #1459: Hard crash when too much recursion is used.
- Fixed #1464: Regular expressions with a single character * pattern were stopping after the first null match.
- Fixed #1463: StringToASCIIArray() working incorrectly with UTF8 characters.

Au3Info:
- Fixed #1391: ToolbarWindow32 info only showing the first toolbar.

- Changed: Better identification of the control under the mouse (again...)

UDFs:
- Fixed #1441: _GUICtrlRichEdit_GetText() using wrong buffer length.
- Fixed #1446: _ScreenCapture_Capture() was using height/width of 1 pixel less.

3.3.5.3 (6th February, 2010) (Beta)
AutoIt:
- Fixed: Regression in FileOpen() where it wasn't allowed to open files in read mode if they were already open in write mode.
- Fixed #1449: GUICtrlDelete() not working for GUICtrlCreateDummy() types.
- Fixed: Error loading on Windows XP due to previous RegDelete() fix.

Au3Info:
- Fixed #1444: Controls in applications like RegEdit were left highlighted.
- Changed: Better identification of the control under the mouse.

UDFs:
- Fixed #1454: StringBetween() not working correctly.

3.3.5.2 (6th February, 2010) (Beta)
AutoIt:
- Fixed #1448: #OnAutoItStartRegister did not work in compiled scripts.
- Fixed #961: RegDelete() was not working properly on 64bit keys when using the 32bit version of AutoIt and HKLM64.

AutoItX:
- Fixed: Missing .lib files readded.

UDFs:
- Fixed #1438: AutoIt error when using _ArrayCombinations().

3.3.5.1 (26th January, 2010) (Beta)
AutoIt:
- Fixed #1428: AdlibRegister/Unregister() were incorrectly using case-sensitive function names.

- Changed: Send() and ControlSend() code reworked to allow for more Unicode characters to be used.

Aut2Exe:
- Fixed #1409: Ctrl+C is no longer the shortcut for Convert. It is now Ctrl+G (Go) to avoid clashing with a Ctrl+C copy operation.

3.3.5.0 (22nd January, 2010) (Beta)
AutoIt:
- Added #1376: FileOpen() mode parameter is now optional. Default mode is read.
- Added #1054: Added FileGetEncoding().

AutoIt3Help:
- Fixed #1423: "Open Script" button stopped working.

3.3.4.0 (15th January, 2010) (Release)

3.3.3.3 (10th January, 2010) (Beta)
AutoIt:
- Added #1311: MouseGetCursor() returns hand cursor.

- Fixed #1403: Error with FileWrite() and UTF8 output streams not being correctly converted to UTF8.

UDFs:
- Fixed #1398: Fixed declaration of $tagPARAFORMAT2 from GuiRichEdit.au3.
- Fixed #1353: _FileWriteToLine() excessively strict on input text type.
- Fixed: SQLite.au3 various errors in _SQLite_FetchData, $iCharSize, _SQLite_QuerySingleRow, _SQLite_GetTable2d, _SQLite_Display2DResult by jchd.

3.3.3.2 (7th January, 2010) (Beta)
AutoIt:
- Added: FileRead() returns the number of characters/bytes read in @extended.
- Added: AutoIt scripts using the line continuation character "_" are no longer limited to a combined line length of 4095 characters.

- Fixed #1392: Crash with OnAutoItExitRegister().
- Fixed #1396: Crash in DllCallbackGetPtr() with invalid handle.
- Fixed #1352: StringSplit() hard crash with binary data.

UDFs:
- Changed: _SQLite 3.6.21 -> 3.6.22

3.3.3.1 (4th January, 2010) (Beta)
AutoIt:
- Added #682: Removed the 64KB limitation for FileReadLine()

- Fixed: Crash when using Stdio redirection.

- Removed: InetGet("abort"), @InetGetActive and @InetGetBytesRead have been removed.
- Removed: AdlibEnable() and AdlibDisable() have been removed.
- Removed: OnAutoItStart and OnAutoItExit have been removed.

UDFs:
- Fixed #1389: _IEAttach() could fail if called multiple times.

3.3.3.0 (3rd January, 2010) (Beta)
AutoIt:
- Added: Ability to read and write UTF-8 files with no BOM including automatic detection during reading.

- Fixed #1345: Number() failed to handle numbers with a trailing decimal point.
- Fixed #384: Under certain circumstances the network credentials flag would prevent the process from starting when launched with RunAs() or RunAsWait().
- Fixed #1370: StringInStr() would crash with a negative occurrence and start position greater than the string length.
- Fixed #1367: Calling GUIDelete() from a GUIRegisterMsg() callback that returns $GUI_RUNDEFMSG would crash AutoIt.
- Fixed #1363: FileSetPos() did not work when the origin was the current position.
- Fixed #1355: Regression in how unsigned numbers are displayed when returned from DllCall().

- Removed: The "RAW" reading mode from FileOpen() has been removed.

UDFs:
- Changed: _SQLite 3.6.19 -> 3.6.21
- Fixed #1338: bad _ArrayDisplay() GUI position error.
- Fixed #1362: _WinAPI_WindowFromPoint() did not work with 64-bit AutoIt.

AutoIt3Help:
- Fixed #1327: Some keywords would fail to open correctly in rare cases.

3.3.2.0 (18th December, 2009) (Release)

3.3.1.7 (10th December, 2009) (Beta)
AutoIt:
- Fixed #1332: Mod() forced a conversion to floating point numbers when it didn't need to which can cause unexpected output.
- Fixed #1321: DllStructCreate() did not support _ in data names.  Documented valid characters for data name.
- Fixed #1322: Crash when using ControlCommand("GetSelected") on non-Edit controls.
- Fixed #1328: StringFormat() was no longer accepting sequences such as %000s.

UDFs:
- Fixed #1312: Errors with _GUIImageList_BeginDrag() example.
- Fixed #1320: _GUIImageList_DragMove() documentation contained a parameter that doesn't exist.
- Fixed #1325: Some date functions could attempt to access an invalid array.
- Fixed: Invalid syntax in MenuConstants.au3.

3.3.1.6 (22nd November, 2009) (Beta)
AutoIt:
- Added: DllStructSetData() and DllStructGetData() index parameter now supports the Default keyword.
- Added #1270: GuiSetIcon() now finds suitable large and small icons.

- Fixed #1285: Reverted revision 5025 and all it's bad changes to the way numbers are handled.
- Fixed #1288: Documented how DllStructSetData() and DllStructGetData() work with arrays when omitting the index parameter.
- Fixed #1300: DLLs could unload when calling DllCall() with an invalid function.
- Fixed #1295: Unicode to ANSI conversion was crashing in certain situations.
- Fixed #1294: Fixed AutoIt deadlock when using the following functions with hanged windows: WinGetTitle, WinSetTitle, WinGetText, WinFlash, WinSetOnTop
- Fixed #975: Backgrounds of controls on tabs should be less likely to corrupt.

UDFs:
- Fixed #1287: _Debug functions were blocking input.
- Fixed #1276: _TicksToTime() incorrectly rounded seconds up.
- Fixed #1277: Resource clean-up in example script for _GDIPlus_ImageGetGraphicsContext.
- Fixed #1304: _GDIPlus_BitmapLockBits() now correctly takes a Width and Height parameter instead of a Right and Bottom.
- Fixed #1290: Invalid Left coordinate when using _GUICtrlTreeView_DisplayRectEx().
- Fixed #1296: _GUICtrlTreeView_ClickItem() could click outside the control's parent window.

Aut2Exe:
- Fixed #1283: Added new option /x86 to force a 32-bit build and re-added /unicode which also forces a 32-bit build.

Au3Check:
- Fixed #1299: Using single quotes in #include now works again.

3.3.1.5 (5th November, 2009) (Beta)
AutoIt:
- Added #1056: New Inet option to by-pass forcing the connection online.

- Fixed #1248: Regression in IsHWND() that caused it to erroneously return true in some cases.
- Fixed #1234: COM methods that modified boolean arguments could change them to ints.
- Fixed #1066: FileOpen() with mode 1 now allows text to be overwrriten if the write pointer is repositioned.
- Fixed #1258: System menu could display when trying to dismiss a control menu.

- Changed: InputBox() no longer requires passing both x and y or w and h.

UDFs:
- Added #1228: _FTP_SetStatusCallback(), _FTP_DecodeInternetStatus() in FTPEx.au3.

- Fixed: Regression in _InetGetSource().  Also includes a new parameter to control how the data is returned.
- Fixed #1247: Documented that some _GUICtrlComboBoxEx_* functions don't work with certain ComboBox styles.
- Fixed #1260: Potential buffer overflow in _WinAPI_GetLastErrorMessage().

Au3Check:
- Fixed #1239: Incorrect library search order.

3.3.1.4 (26 October, 2009) (Beta)
AutoIt:
- Added #508: Static keyword.

- Fixed #906: ActiveX controls were not told what their initial size was.
- Fixed: Boolean tests on binary strings now behaves properly.
- Fixed #1242: Beta Regression in _WinAPI_WideCharToMultiByte().
- Fixed: Fatal error under certain conditions when using minus sign.

- Changed: PCRE regular expression engine updated to 8.00.

UDFs:
- Fixed #1223: _GUICtrlStatusBar_EmbedControl() failing.
- Fixed #1226: _DateDayOfWeek() had an off-by-one error.
- Fixed: Order of parameters was documented wrong for _WinAPI_MakeQWord().
- Fixed #1168: _ExcelBookOpen() now selects the first visible worksheet to prevent a COM error.

- Changed: _SQLite 3.6.18 -> 3.6.19

3.3.1.3 (15th October, 2009) (Beta)
AutoIt:
- Fixed: Hex() no longer crashes.

UDFs:
- Fixed #1215: _ArraySearch() not searching on 2D array.
- Fixed: Typos in _Crypt_EncryptData() documentation and _Crypt_EncryptFile example.
- Fixed: GDIPlus return values.
- Fixed #1026: GDIPlus Bitmap examples and documentation use the correct function to free resources.

3.3.1.2 (14th October, 2009) (Beta)
AutoIt:
- Added: new type to DllCall and DllStruct to avoid confusion with MSDN description. That avoid specially X64 errors.
- Added #967: Ftp via proxy now works for the Inet functions.
- Added #351: PixelSearch() now supports both right-to-left and bottom-to-top searches.

- Changed: AutoIt exit callback functions are called in reverse order of registration.
- Changed: AdlibUnRegister() now returns the count of remaining Adlib functions that are registered.
- Changed: AdlibUnRegister()'s function argument is now optional.  Called without arguments causes the last registered function to be unregistered.
- Changed: @YDAY now returns values in the range 001 - 366 instead of 1 - 366.  This makes it more consistent with other languages.  THIS IS A SCRIPT BREAKING CHANGE.
- Changed #1080: InetGet background downloads now return immediately instead of connecting to the remote host first.
- Changed #1137: RegEnumKey() and RegEnumVal() now correctly return an empty string on failure instead of an error message string.
- Changed: PixelChecksum() can calculate checksums from right-to-left and bottom-to-top.

- Fixed #1013: MDI childs doesn't adjust to parent windows client area.
- Fixed: Crash due to unregistering an Adlib while an Adlib was firing.
- Fixed: Adlib functions no longer dominate when more than one are registered.
- Fixed #1005: TraySetClick(64) = hovering.
- Fixed #1049: InetRead() inserted arbitrary null terminators.
- Fixed: ClipPut("") not emptying.
- Fixed #1068: Binary to Int.
- Fixed #1087: Checkbox or Radio repainting when mouse hovering.
- Fixed: Bad painting on double GUICtrlSetPos() for label.
- Fixed #1094: Send("{LSHIFT UP}") stay down.
- Fixed #1074: Inputbox() positionning on multi monitor.
- Fixed #1079: GUISetFont(), GUICrlSetFont() doc related to issue #918
- Fixed #1105: disable colored Multiline button not properly displayed.
- Fixed #1077: GUICtrlSetBkColor() bad recoloring.
- Fixed #1116: GUICtrlCreateGraphic don't follow ResizeMode.
- Fixed #1102: Better documentation of the StringInStr() count parameter.
- Fixed #1161: Removed all documentation references to ColorMode.
- Fixed #1156: AutoItSetOption()/Opt() now set @error instead of generating a fatal error with invalid input.
- Fixed #1093: StringFormat() beta regression for non latin chars
- Fixed: Comparing pointers now works correctly.

AutoItX:
- Removed: ColorMode option removed from AutoItSetOption().

Aut2Exe:
- Fixed #1036: Inet-related functions now work in compiled scripts.

Au3Info:
- Removed: ColorMode BGR option removed since AutoIt no longer supports the option to use BGR mode.

Others:
- Added #1050: TextPad v5 syntax files installation.

UDFs:
- Added: GuiRichEdit and functions
- Added: _WinAPI_GetGuiResources()
- Added #981: _WinAPI_WideCharToMultiByte(), _WinAPI_MultiByteToWideChar() support IN/OUT as "strings"
- Added #1157: Encryption functions in Crypt.au3.
- Added #1128: _WinAPI_PathFindOnPath() in WinAPI.au3.

- Fixed #999: _GUICtrlTreeView_SetFocused documentation
- Fixed #1016: _WordDocSaveAs() Doc for error handling.
- Fixed: Sound positioning in case of VBR Format Sound.
- Fixed #1031: _Clipboard_SetData() fix.
- Fixed #1040: _ScreenCapture_Capture() leak memory.
- Fixed #1026: _Gdiplus_BitmapCreate*() doc examples.
- Fixed #1092: _Timer_...() datatype for X64.
- Fixed #1059: Incorrect error handling in _FileListToArray().
- Fixed #1101: _NowTime(), _NowDate() Doc.
- Fixed: _WinAPI_GetWindowLong(), _WinAPI_SetWindowLong support X64.
- Fixed #1111: Bad grammar in comments for _DateAdd().
- Fixed #1155: _WinAPI_CreateSolidBitmap() updated
- Fixed: all includes use Unicode for Dllcall and SendMessage
- Fixed: _WinAPI_Get/SetWindowLong under X64
- Fixed: UDF library now uses #include "" instead of #include <>.
- Fixed #1033: UDF library now has better and more consistent error handling when DllCall() is used.

- Changed: _SQLite 3.6.14.2 -> 3.6.18
- Changed: _InetGetSource() now uses InetRead().

- Removed #1112: __WinAPI_Check() has been removed as have all calls to it.

3.3.1.1 (14th June, 2009) (Beta)
AutoIt:
- Added #529: Added the "NAME" property to allow direct search for .NET WinForm control names.
- Added: PixelChecksum() extra parameter to select CRC32 instead of ADLER.
- Added #984: @OSVersion now returns "WIN_XPe" for Windows XP Embedded.
- Added #938: UDPOpen() flag to allow broadcasting  with 255.255.255.255.

- Fixed #969: FileFindNextFile() does not set @extended if first found is a dir.
- Fixed #975: Checkbox or Radio bkcolor on tab regression with Theme.
- Fixed #983: InetGet() crash with IE6.
- Fixed #1006: @MSEC returned wrong value for values < 100.
- Fixed #1010: FileRead() UTF8 with BOM files return too many chars.
- Fixed #1028: _Clipboard_GetData() fix.

- Changed #968: AutoUpdateIt updated by ProgAndy to use new Inet features.

AU3Info:
- Added: Control information now includes the .NET WinForm if available.

UDFs:
- Fixed #979: _ArrayDisplay() - just old/incorrect syntax in header comment
- Fixed #974: _WinAPI_WindowFromPoint tagPoint structure
- Fixed #1000: _GUICtrlListBox_Create result error message _WinAPI_CreateWindowEx: Cannot find window class
- Fixed #1004: _PathFull() was returning invalid results.
- Fixed #1015: _SQLite_SaveMode() renamed as _SQLite_SafeMode().
- Fixed #1019: _GUICtrlListView_SetItemCut, _GUICtrlListView_SetItemFocused, _GUICtrlListView_SetItemDropHilited enabled flag not working correctly.

- Changed: Error msg with UTF8 info can be displayed on Scite console. Extra parameter in _SQLite_Startup().
- Changed: _SQLite 3.6.14.1 -> 3.6.14.2

- Removed: _StringAddThousandsSep() has been removed.  Too many opinions on how the function should work means nobody is happy with it.

3.3.1.0 (20th May, 2009) (Beta)
AutoIt:
- Added #757: Set defaults for MouseClick()'s x/y parameters.
- Added #764: Return Pid on ProcessWait() and handle on WinWait(), WinWaitActive, WinActivate(), WinActive(), WinMove() when successful.
- Added #414: better handling of OnAutoItStart/OnAutoItExit, now #OnAutoItStartRegister, OnAutoItExitRegister() and OnAutoItExitUnRegister().
- Added: Better handling of AdlibEnable/AdlibDisable, now AdlibRegister(), AdlibUnRegister() and AdlibDisable().
- Added #351: Reverse PixelSearch().
- Added #769: FileFlush() function.
- Added #333: #NoAutoIt3Execute Directive for disabling /AutoIt3ExecuteScript or /AutoIt3ExecuteLine.
- Added #604: $GUI_BKCOLOR_TRANSPARENT can be used with label, group, radio, checkbox controls.
- Added #135: FileSetPos(), FileGetPos() functions for moving the file pointer around.
- Added #582: GUICtrlSetTip() can be used on TabItem controls.
- Added #699: Shutdown() now return @error=GetLastError() when failing.
- Added #461: StringReplace() from right to left if occurrence <0 as for StringInStr().
- Added: GUICtrlSetColor() and GUICtrlSetBkColor() for Combo Controls.
- Added: GUI without title bar (no $WS_CAPTION) can be moved with the mouse.
- Added #815: Temporary variables can be passed ByRef.
- Added #837: FileFindNextFile() set @extended if a directory is returned.
- Added #839: Shutdown() rewritten and now works properly when run as a non-interactive user.
- Added: Shutdown() now takes an optional reason code.
- Added #846: _PathFull() now supports strange but valid syntax where drives do not  have a trailing slash.
- Added #869: @MUILang macro to help MUI environment scripts.
- Added #918: Added Quality parameter to GUICtrlSetFont() and GUISetFont().
- Added: ProcessClose() return info on error.

- Fixed: CtrlSetStyle listview on non selected tab.
- Fixed #763: GUICtrlCreateIcon() create an empty icon on error.
- Fixed: no mouse move when invalid button used in MouseClick() or MouseClickDrag().
- Fixed #779: infinite loop on Exit due to GUICreate() child badly created.
- Fixed #774: GuiCtrlSetBkColor() bad label display.
- Fixed #790: Windows region constant $ERROR rename in $ERRORREGION.
- Fixed: StringInStr("aaa", "aa", 2) does not return 0.
- Fixed #802: Searching for controls by Height property.
- Fixed: Checkbox or radio painting on tab.
- Fixed #816: data for GUI date control doc clarification.
- Fixed #819: Crash with EventLog functions.
- Fixed #814: InetGet() through a proxy requiring authentication did not work.
- Fixed #813: bad handling of Windows advanced matching for [HANDLE:...] in X64 version.
- Fixed #863: DirMove() extra dot.
- Fixed #867: UDPRecv() can return from IP/Port.
- Fixed #886: More explicit documentation that operator == is a forced string comparison.
- Fixed #885: Default compared to False returned True instead of False.
- Fixed #888: Send("{}}") Extra null char.
- Fixed #916: Line inversion in INet.au3
- Fixed: DllCall() returning 64-bit int.
- Fixed: GuiCtrlSetImage() after GUI resized.
- Fixed: DirMove() return code wrong under XP.
- Fixed #931: bad GUICtrlSetResizing() for graphic control.
- Fixed #934: MouseGetCursor() hogging mouse double click.
- Fixed #615: License updated to be less restrictive.
- Fixed #919: Remarks added to ConsoleWrite(), ConsoleWriteError() and StdinWrite() regarding how those functions handle binary data and non-ANSI characters.
- Fixed #897: Documented that StringToASCIIArray() does not accept binary input (convert to a string first).
- Fixed #937: Bad event handling of Opt("TrayMenuMode",1)

- Changed: It is now possible to read from files opened for writing.
- Changed: PCRE regular expression engine updated to 7.9.
- Changed #899: ShellExecute[Wait]() no longer uses "open" as the default verb.  See remarks section for those functions for more information.
- Changed: Inet functions rewritten with the following additions and changes:
    - Removed: Long deprecate URLDownloadToFile() alias for InetGet().
    - Added: HttpSetUserAgent(), InetClose(), InetGetInfo() and InetRead() functions.
    - Added: Multiple background downloads are now supported with InetGet().
    - Added #408: New flag for ignoring SSL errors for HTTPS connections.
    - Added #884: Better proxy support with mode 0.
    - Added #949: The user-agent can be changed.
    - Changed: InetGet() returns a handle which must be closed.
    - Changed: @InetGetBytes, @InetGetActive and InetGet("abort") are deprecated and will be removed in the future.

AU3Info:
- Added #140: ToolsBar button info.

UDFs:
- Added: _GDIPlus_BrushGetSolidColor, _GDIPlus_BrushSetSolidColor (smashly)
- Added: $tagWIN32_FIND_DATA and corresponding attribute constants.
- Added #868: _WinAPI_GetLayeredWindowAttributes(), _WinAPI_SetLayeredWindowAttributes().
- Added: _Date_Time_ ... Str() can return date as yyyy/mm/dd.
- Added #271: FTPEx.au3 for _FTP_...().
- Added #932: mouse event constants in WinDowsConstants.au3.
- Added #952: _ArrayDisplay() extra parameter for column header text.
- Added #957: _Assert() in Debug.au3.

- Fixed #755: _FileReadToArray() removing empty end lines.
- Fixed #773: Doc for _GUICtrlStatusBar_SetParts
- Fixed #786: _SQLite_Exec() does not return @error.
- Fixed: Doc for _ClipBoard_SetData
- Fixed #793: _WinNet_EnumResource error always returned
- Fixed #809: _Soundxxx() with first parameter as filename.
- Fixed #850: _ExcelReadSheetToArray doesn't work with German Excel 2003 (Prog@ndy) Note: not tested with other languages
- Fixed #887: Related section based on Tweaky work.
- Fixed #958: _ArrayDisplay - bad centering of window after adjust its width
- Fixed #951: _ArrayDisplay() speed improvement for nb entries >4000.
- Fixed: _SoundOpen() set @error on MCI Error.

- Changed: _StringBetween removed last optional param (not needed after change)(SmOke_N)
- Changed: _StringAddThousandsSep() has been rewritten and now takes different input.
- Changed: _StringToHex(), _HexToString() and _StringReverse() have been rewritten and are faster.
- Changed: Excel docs (litlmike)
- Changed: _SQLite 3.6.7 -> 3.6.14.1 (SQL statement support UNICODE characters)
- Changed: _ArrayCombinations, _ArrayPermute, _ArrayUnique (litlmike)

- Removed: _WinAPI_MakeDWord

3.3.0.0 (24th December, 2008) (Release)

AutoIt:
- Fixed: Send() was incorrectly inserting a leading zero when using the {ASC 0xNNNN} format.

UDFs:
- Added: _GDIPlus_MatrixScale, _GDIPlus_MatrixTranslate (monoceres)

3.2.13.13 (20th December, 2008) (Beta)

AutoIt:
- Added #744: StringFromASCIIArray() and StringToASCIIArray() now allow specifying an encoding.

- Fixed: Send() was incorrectly inserting a leading zero when using the {ASC 0xNNNN} format.
- Fixed: DllStructSetData() wasn't correctly terminating string buffers that had been used previously.
- Fixed #743: AutoIt Crash when Tray functions are use with invalid ID.
- Fixed #748: AutoIt Crash with DllCall(0,...).

- Updated #734: StringRegExpReplace() doc for backward reference.

UDFs:
- Updated: _SQLite 3.6.6.2 -> 3.6.7

3.2.13.12 (9th December, 2008) (Beta)

AutoIt:
- Changed #596: StringFromASCIIArray() and StringToASCIIArray() now correctly handle embedded terminators.  Also, StringToASCIIArray() no longer inserts a trailing 0 into arrays.
- Fixed: Crash when using BinaryToString() with invalid UTF16 input string.  BinaryToString() now has new @error codes to support diagnosing invalid input.
- Fixed: ControlGetText() regression from last beta.
- Updated: Shutdown documentation.

UDFs:
- Added: _GDIPlus_StringFormatSetAlign (monoceres)

- Updated: StringAddThousandsSep params in regards to #442
- Updated: _SQLite 3.6.5 -> 3.6.6.2
- Updated #733: Doc for _GUICtrlButton_SetImageList

- Fixed #693: _DateTimeFormat() time format
- Fixed #701: _GUICtrlListView_ClickItem() Clicks in the wrong place when $fMove = True
- Fixed #700: _GUICtrlTreeView_ClickItem() Clicks in the wrong place when $fMove = True
- Fixed #703: _GUICtrlListBox_ClickItem() Clicks in the wrong place when $fMove = True
- Fixed #705: _GUICtrlToolbar_ClickButton() Clicks in the wrong place when $fMove = True
- Fixed #707: _GUICtrlMonthCal_Create() width and height

3.2.13.11 (17th November, 2008) (Beta)

AutoIt:
- Fixed #669: Typo in Dec() example.
- Fixed #659: Documented that UNC paths are not supported when using FileSelectFolder().
- Fixed #671: Crash when using $WS_EX_MDICHILD without specifying a valid parent.

AutoItX:
- Added: COM: WinList method.
- Fixed: Native DLL: Return strings were sometimes incorrectly terminated.
- Fixed: PixelChecksum() not returning correct values.

UDFs:
- Fixed #674: _GUICtrlTab_ClickTab() Clicks in the wrong place when $fMove = True

- Updated: _SQLite 3.6.4 -> 3.6.5
- Updated #442: _StringAddThousandsSep() allows for regional settings

3.2.13.10 (8th November, 2008) (Beta)

AutoIt:
- Added #407: Documented that For...In loops are read-only.
- Added #645: IniDelete() now supports the Default keyword for the 3rd parameter.

- Fixed #628: GuiCtrlRead($ctxmenu, $adv) bad return (Saunders)
- Fixed #640: PCRE does not support \L, \l, \N, \U, or \u : doc updated
- Fixed: StringToASCIIArray() crash (Part of issue #596).
- Fixed #642: Installer now correctly opens the merged helpfile to the history page instead of the AutoIt-only helpfile.
- Fixed #646: Call() now sets specific @error and @extended values when it fails to find a function.

- Changed: Documented StringToASCIIArray() and StringFromASCIIArray() use UNICODE codes (Part of issue #596)

AutoItX:
- Fixed: multiple unicode related problems introduced in a previous beta.

UDFs:
- Added: _StringExplode() (WeaponX)

- Fixed #610: _WinAPI_CreateFile() wrong return value upon failure
- Fixed #619: _GUICtrlListView_SetItemSelected memory allocation
- Fixed #617: corrections to six GDI+ ImageGet help file examples
- Fixed #621: _StringAddThousandsSep don't work with negative number
- Fixed #635: _GuiCtrlTab_ClickTab() docs list unused $fPopupScan parameter
- Fixed #650: Missing BorderConstants.au3
- Fixed #656: _FileCountLines returns 0 if file only contains 1 line

- Changed: _Soundxxxx functions (RazerM)
- Changed #599: _FileListToArray speed optimization (code65536)
- Changed: _SQLite 3.5.9 -> 3.6.4.

3.2.13.9 (12th October, 2008) (Beta)

AutoIt:
- Fixed #601: Tooltip return 0 when title length >99.
- Fixed #608: listView GUICtrlSetBkColor not redrawn.
- Fixed: Regression in writing Unicode files introduced in 3.2.13.8.

UDFs:
- Fixed #600: _ArraySearch fails with 2D array.
- Fixed #603: _FileReadToArray() does not return an array if the file contains only a single line of text.

3.2.13.8 (4th October, 2008) (Beta)

AutoIt:
- Added #454: $FO_UTF8 allowing FileOpen() in Read mode for reading UTF8 files without BOM.
- Added: $FO_UTF16_LE, $FO_UTF16_BE allowing FileOpen() in Read mode for reading UTF16 files without BOM.

- Fixed #501: ProcessGetStats() failed for processes running as other users (including SYSTEM).
- Fixed #92: DllStruct data truncated with char[]/wchar[].
- Fixed #562: Specifying the TITLE property caused all other properties to be lost (Window title matching).
- Fixed: GuiCtrlSetState($graphic, $GUI_HIDE) does not hide.
- Fixed: GuiCtrlSetResizing($graphic, ) not moving.
- Fixed: GuiCreate(...,Style without caption) does not resize properly.
- Fixed: GuiSetStyle(caption change) does not resize properly.
- Fixed: GuiCtrlSetState($listviewitem) does not return error.
- Fixed #569 TCPRecv doc example.
- Fixed #589: Some comparison operators did not return a boolean value.
- Fixed #583: Bad formatting of @MSEC in documentation.
- Fixed #574: Using 0 for the SendKeyDelay or SendKeyDownDelay removes the respective delay when using Send().
- Fixed #542: Crash with regular expressions.
- Fixed #531: Clarification of some of the remarks for GUICtrlSetGraphic().
- Fixed #539: StringSplit() with flag 2 and no matching delimiters wasn't returning the full string.

- Changed: PCRE regular expression engine updated to 7.8.

UDFs:
- Fixed #495: _GUICtrlTreeView_GetTree returns only 1 parent
- Added: _WinAPI_CreatePen, _WinAPI_DrawLine, _WinAPI_LineTo, _WinAPI_MoveTo, _WinAPI_GetBkMode, _WinAPI_SetBkMode (Zedna)
- Fixed #503: _Date_Time_FileTimeToLocalFileTime example (cbruce)
- Added: _ArrayCombinations, _ArrayPermute, _ArrayUnique (litlmike)
- Fixed #510: _GUICtrlListView_ClickItem: If columns inside listview exceed visible area, clicks outside of the control
- Added: _GDIPlus_ImageGetFlags, _GDIPlus_ImageGetHorizontalResolution, _GDIPlus_ImageGetPixelFormat, _GDIPlus_ImageGetRawFormat
         _GDIPlus_ImageGetType, _GDIPlus_ImageGetVerticalResolution (rover)
- Added: _PathGetRelative (wraithdu)
- Fixed #500: _ChooseColor run on 64bit
- Fixed #517: WinAPI UDF - bad error checking after DllCall()
- Added: _WinAPI_CombineRgn, _WinAPI_CreateRectRgn, _WinAPI_CreateRoundRectRgn, _WinAPI_SetWindowRgn (Zedna)
- Fixed #533: Array functions dimension check
- Fixed: various Timer Functions
- Fixed #506: _FileCountLines deal with all common line-end-chars
- Fixed #485: WinAPI missing related links in helpfile
- Fixed #571: return value doc for _GUICtrlListBox_FindString, _GUICtrlListBox_GetAnchorIndex and _GUICtrlListBox_GetText
- Fixed #586: _GuiCtrlListView_SetGroupInfo() destroyed group ID's.
- Fixed #516: _ChooseFont run on 64bit
- Fixed #595: _WinAPI_SetWindowsHookEx help file description of $WH_KEYBOARD_LL

3.2.13.7 (6th August, 2008) (Beta)

AutoIt:
- Fixed: Really stupid mistake with Run functions.

- Added #481: 11 pixel margin around the text in SplashTextOn() (Meets Vista UI guidelines).
- Added #468: Added @MSec macro for obtaining the current milliseconds for the current second.
- Added #277: @CPUArch macro to return the capability of the processor.

- Changed: Tweaked DEP and Image randomization linker options.

AutoItX:
- Changed: Converted to full unicode - ANSI DLL prototypes removed. (For now, depends on demand for adding in).

3.2.13.6 (30th July, 2008) (Beta)

AutoIt:
- Fixed #475: StringSplit() with flag 2 and empty delimiter did not work correctly.
- Fixed #464: Example script for GUICtrlCreateAvi() did not work on Vista.
- Fixed #484: ObjGet() would crash when invalid files were specified.

- Added #328: StringToASCIIArray(), StringFromASCIIArray() functions.
- Added: New flag to Run()/RunAs() to fix issue #415 (Adds new Constants.au3 constant: $STDIO_INHERIT_PARENT).
- Added: New flag to all Run functions for better CUI compatibility (Adds new Constants.au3 constant: $RUN_CREATE_NEW_CONSOLE).

- Changed #393: Documented that SoundSetWaveVolume() works differently in Windows Vista.
- Changed: PCRE regular expression engine updated to 7.7.

UDFs:
- Added: _ExcelHorizontalAlignSet, _ExcelFontSetProperties, _ExcelBookAttach (litlmike)
- Fixed: Excel Examples
- Added: _WinAPI_SetEndOfFile, _WinAPI_SetFilePointer (Zedna)
- Fixed #465: _DateTimeSplit if seconds omitted defaulted to -1, now defaults to 0

Aut2Exe:
- Added #460: More verbose UPX errors.

3.2.13.5 (24th July, 2008) (Beta)

AutoIt:
- Fixed #449: @SystemDir does not return SysWOW64 under X64 in 32-bit mode.
- Fixed #440: Fatal error when script ends with EOF (0x1A).
- Fixed: Error compiling with custom icons since last beta.

3.2.13.4 (19th July, 2008) (Beta)

AutoIt:
- Fixed #346: FileOpenDialog/FileSaveDialog filter length limit.
- Fixed #387: DllClose() and DllCallbackFree() crashing when an invalid handle used.

UDFs:
- Added #334: _SQLite 3.5.9 x86 and X64 version.
- Fixed #422: _GDIPlus_GraphicsSetSmoothingMode $iSmooth accepts only 0 - 4, doc updated
- Added: Missing FrameConstants.au3
- Added: Excel UDFs
- Updated: GuiComboBox Documentation

Aut2Exe:
- Fixed #436: Compression level was ignored when performing compilation from the GUI.

3.2.13.3 (22nd June, 2008) (Beta)

AutoIt:
- Fixed #381: DirCreate() was trashing input variables (old bug brought to light by recent optimizations).

UDFs:
- Fixed #388: _GUICtrlToolbar_SetButtonSize Example
- Fixed #400: SQLite.dll.au3 @ProcessorArch replaced with @OSArch
- Fixed #390: _viPrintf replaced return type
- Added: _Timer_GetIdleTime, _WinAPI_GetWindowPlacement, _WinAPI_SetWindowPlacement (PsaltyDS)

3.2.13.2 (15th June, 2008) (Beta)

AutoIt:
- Changed: @ProcessorArch changed to @OSArch as it was misleading.
- Changed: Size limits removed from RegRead() and RegWrite() (previously 64KB for some registry types).
- Changed: RegRead() and RegWrite() no longer use hex strings for REG_BINARY types - native binary datatypes are enforced.

- Fixed #380: @OSVersion for Windows XP 64-bit Edition.
- Fixed: Increased memory use since last beta.

UDFs:
- Fixed #371: _GDIPlus_Startup return value (wraithdu)
- Fixed #368: _ArrayToClip return value

3.2.13.1 (10th June, 2008) (Beta)

AutoIt:
- Added: New flag for StringSplit() to not return the count in element 0.

- Fixed #358: Install dir documentation cleaned up.
- Fixed #355: Child not visible beta regression.
- Fixed #366: AutoIt crash on bad syntax.
- Fixed #360: RunAs() under Windows 2000.
- Fixed #367: STDIO functions in compiled scripts work again.

- Removed #357: @AutoItUnicode macro.

UDFs:
- Added: _GUICtrlTab_ClickTab (Gary)
- Fixed #361, #362: _GUICtrlListView_InsertItem doc (Zedna)
- Removed: _StringSplit, no longer needed
- Added: _GUICtrlComboBoxEx_GetUnicode, _GUICtrlComboBoxEx_SetUnicode (Gary)

3.2.13.0 (7th June, 2008) (Beta)

AutoIt:
- Fixed #309: RunAs() and RunAsWait() now use @SystemDir as the working directory instead of @WorkingDir when a user-supplied working directory is not specified.
- Fixed #325: contextmenuitem not firing events.
- Fixed #305: GUICtrlSetFont() for Combo causing highlight.
- Fixed #318: GUICtrlSetTip() on TreeViewItem must return 0.
- Fixed #282: Icon transparency refresh when on tab regression.
- Fixed #339: GUICtrlDelete() crashes.
- Fixed #345: @OSVersion for Windows 2008.

UDFs:
- Fixed #285: _ChooseColor Example (water)
- Fixed #299: _GUICtrlTab_SetItemText buffer length for Unicode (benners)
- Fixed #292: _EventLog__Clear not clearing log when backup parameter is empty
- Updated #290: _GDIPlus_DrawImagePoints (Zedna)
- Fixed #258: _ClipBoard_GetData
- Fixed #294: _FileReadToArray where the file contains no @LF (GEOSoft)
- Added #275: _GDIPlus_GraphicsFillPolygon (smashly)
- Fixed #303: Clock.au3 in Examples\GUI\Advanced
- Fixed: _GUICtrlListView_SetItemEx text buffer
- Fixed #320: _WinNet_EnumResource struct pointers
- Fixed #321: _GUICtrlStatusBar_GetText buffer length for Unicode
- Added #332: Remarks to _GUICtrlStatusBar_Create

3.2.12.1 (12th June, 2008) (Release)

AutoIt:
- Fixed #309: RunAs() and RunAsWait() now use @SystemDir as the working directory instead of @WorkingDir when a user-supplied working directory is not specified.
- Fixed #325: contextmenuitem not firing events.
- Fixed #282: Icon transparency refresh when on tab regression.
- Fixed #360: RunAs() under Windows 2000.

3.2.12.0 (11th May, 2008) (Release)

AutoIt:
- Fixed #252: Edit control not correctly getting focus after ALT-TAB.
- Fixed #254: GuiGetCursorInfo() fixed again!
- Fixed #256: Multiple windows and multiple tab controls were messing each other up.
- Fixed #255: Random(Min,Max,1). Previously this would never actually return Max,
    so if Max was artificially incremented by one the script will now need to be changed.
- Fixed #251: GUIRegisterMsg() and Return values.
- Fixed: Icon transparency refresh when on tab.

UDFs:
- Fixed #249: _WinAPI_UpdateLayeredWindow error checking.
- Fixed #260: _ArrayToString() doc return value.
- Fixed #259: _ArraySort() not returning 1 on success.

3.2.11.12 (8th May, 2008) (Beta)

AutoIt:
- Removed #238: ColorMode option ( Opt() ).

- Fixed #246: GuiGetCursorInfo() with swapped mouse buttons.

AutoItX:
- Added #244: ControlTreeView().

- Fixed: ControlListView() for native DLL version.

UDFs:

- Fixed: _GUICtrlTreeView_GetText for Unicode.

3.2.11.11 (7th May, 2008) (Beta)

AutoIt:

- Fixed #222: GUIRegisterMsg() regression.
- Fixed #230: GUICtrlSetResizing after GuiSetState() regression.
- Fixed #89: The "Environment" flag and environment variables are correctly loaded.
- Fixed #90: RunAs() and RunAsWait() now correctly work with limited user accounts.

UDFs:

- Fixed #198: _FileReadToArray() removing empty lines at the end.
- Fixed: _WinAPI_CreateSolidBitmap not releasing DC.
- Fixed: _ArrayDisplay Separator handling.
- Fixed: _IEAttach, windowtitle, fixed bug matching window title when IE windowtitle registry key is not set (DaleHohm)
- Fixed: _IEPropertyGet, toolbars, broken, now works (DaleHohm)
- Added: Unicode support to _GUICtrlListView_xxxx, _GUICtrlStatusBar_xxxx, _GUICtrlComboBoxEx_xxxx
         _GUICtrlHeader_xxxx, _GUICtrlTab_xxxx, _GUICtrlToolBar_xxxx, _GUIToolTip_xxxx, _GUICtrlTreeView_xxxx functions (Gary)
- Fixed: _GUIImageList_GetIcon using wrong variable for param (SmOke_N)
- Added: $iFlag parameter to _FileWriteLog (MrCreatoR)

3.2.11.10 (20th April, 2008) (Beta)

AutoIt:
- Fixed #185: GUI performance problem when creating a large number of windows.

- Changed: Tried to make each GUI window have an independent accelerator table.

3.2.11.9 (19th April, 2008) (Beta)

AutoIt:
- Fixed: Regression in right-click/context menus.

3.2.11.8 (19th April, 2008) (Beta)

AutoIt:
- Added #212: Added parent window parameter to InputBox().

- Fixed #213: GUISetAccelerator() regression since 3.2.11.6.
- Fixed #214: Regression in GUI resizing code when menus are present.

AU3Info:
- Changed: Controls are always highlighted when using the finder tool.
- Changed: Controls are not highlighted by default.
- Changed: Control description gives the advanced version of class and instance.

3.2.11.7 (15th April, 2008) (Beta)

- Added: X, Y, W, H in advanced window definitions.

- Fixed: GUI crash introduced into last beta.
- Fixed: An attempt to FileDelete() a file that was just executed with RunWait() would sometimes fail.

3.2.11.6 (13th April, 2008) (Beta)

AutoIt:

- Added #39: Added parent window parameter to MsgBox(), FileSelectFolder(), FileOpenDialog(), FileSaveDialog().
- Added #79: X, Y, W, H in advanced control definitions.

- Fixed #195: Impossible to compile a script with GUICtrlSetDef..Color().
- Fixed #193: crash when GUICtrldelete() of a already deleted Ctrl.
- Fixed: Resizing GUI before GUISetState() (again).
- Fixed #178: GUIRegisterMsg() return value.

UDFs:

- Added: _GDIPlus_DrawImagePoints (Malkey)
- Added: 21 _WinAPI_xxxx examples (Gary)
- Fixed: Constants declared in Constants.au3 and ScrollBarConstants.au3
- Fixed: _GDIPlus_DrawImagePoints Documentation (Malkey)
- Added: _GUICtrlAVI_IsPlaying (Gary)
- Added: _GUICtrlButton_GetNote, _GUICtrlButton_GetNoteLength, _GUICtrlButton_GetSplitInfo
    _GUICtrlButton_SetNote, _GUICtrlButton_SetShield, _GUICtrlButton_SetSplitInfo
    _GUICtrlComboBox_GetCueBanner, _GUICtrlComboBox_SetCueBanner, _GUICtrlMonthCal_GetCalendarBorder
    _GUICtrlMonthCal_GetCalendarCount, _GUICtrlMonthCal_SetCalendarBorder, _GUICtrlListView_GetFocusedGroup
    _GUICtrlListView_GetGroupCount, _GUICtrlListView_GetGroupInfoByIndex, _GUICtrlListView_GetGroupRect (Gary)
- Updated: _GUICtrlButton_Create, _GUICtrlButton_GetIdealSize, _GUICtrlMonthCal_Create, _GUICtrlListView_SetGroupInfo (Gary)
- Added: _GUICtrlButton_SetDontClick (Gary)

3.2.11.5 (25th March, 2008) (Beta)

AutoIt:

- Added: REGEXPCLASS in Advanced control definition.
- Added: "start" and "count" parameters added to StringInStr().
- Added #182: GUICtrlSetDefColor(), GUICtrlSetDefBkColor().

- Fixed: Resizing GUI before GUISetState().
- Fixed #183: radio fired when GUI reactivated.
- Fixed: GUICtrlDelete on contextMenuItem.

UDFs:

- Added: _ArrayDisplay() GUI width adapted to column sizes (Jpm)

3.2.11.4 (20th March, 2008) (Beta)

AutoIt:

- Added #78: REGEXPCLASS in Advanced Windows definition.

- Fixed #177: Pixel...() does not accept optional hwnd parameter.
- Fixed #173: Advanced window descriptions only reading to the first ;

UDFs:

- Fixed: _Timer_KillTimer array assignment correction (-Ultima-)

3.2.11.3 (18th March, 2008) (Beta)

AutoIt:

- Changed: PCRE regular expression engine updated to 7.6.

- Added #128: GUISetAccelerators().

- Fixed: Modified AutoUpdateIt.au3 to work under x64.

UDFs:

- Fixed: $tagREBARINFO declaration (Zedna)
- Added: _GUICtrlRebar_GetBarInfo, _GUICtrlRebar_SetBarInfo (Gary)

3.2.11.2 (14th March, 2008) (Beta)

AutoIt:

- Added: Pixel...() can specified a window handle as last parameter.

- Changed: Maximum controls in a GUI window 4093 -> 65532.
- Changed: @OSVersion can now return "WIN_2008" for Windows Server 2008.

- Fixed: ControlTreeview() returning @error=1 on success (more).
- Fixed: StringSplit() flag=1 delimiters not case sensitive.
- Fixed: In advanced Window descriptions only semi-colon must be escaped.
- Fixed: ObjGet() memory leak.
- Fixed #152: STDIO redirection could cause (AutoIt) child process to max CPU.

UDFs:

   Added: _Debug...() can be used to debug concurrent scripts using the same Notepad session.
   Fixed: UDF Doc for _StringSplit (Gary)
 Changed: re-write _StringSpit (Randallc)
   Fixed: Doc for _GUICtrlListView_InsertGroup (MsCreatoR)
   Added: UDF Examples _GDIPlus_GraphicsSetTransform, _GDIPlus_MatrixCreate, _GDIPlus_MatrixDispose, _GDIPlus_MatrixRotate (Malkey)
   Fixed: UDF _Timer_KillTimer subscript error if function called more times than number of Timers (Gary)
   Fixed: Include file constant name from $DTS_SHORTDATECENTFORMAT to $DTS_SHORTDATECENTURYFORMAT as stated in the help
   Fixed: _ScreenCapture_Capture memory leak
   Added: UDF _WinAPI_CallWindowProc
    Added: UDF _GUICtrlListBox_ClickItem
   Changed: _StringAddComma replaced with _StringAddThousandsSep

3.2.11.1 (9th February, 2008) (Beta)

AutoIt:

- Added: ProcessWaitClose() returns exitcode in @extended

- Fixed: Unexpected AutoIt exit code.
- Fixed: AutoIt tray icon removal on script exiting.
- Fixed: AutoIt crash when removing ObjEvent() object.
- Fixed: ObjEvent() handler can destroy return of AutoIt Function : as winwait("title") can return 0.
- Fixed: Dirmove() on different volume.
- Fixed: Crash with RegRead() and REG_MULTI_SZ on x64.
- Fixed: GuiCtrlListView() behind BG Picture. Doc updated.
- Fixed: Various Edit control focus and DefPushButton issues.
- Fixed: ControlTreeview() returning @error=1 on success.
- Fixed: COM objects could lose numeric precision.
- Fixed: StringReplace() with start float number.
- Fixed: ControlCommand() "SelectString" wrong selection.

UDFs:

   Fixed: _GUICtrlListView_GetItemChecked for use with external listviews (Siao)
   Fixed: UDF _GUICtrlListView_Create freezes window when dragging an item (Gary Frost)
   Added: UDFs _GUICtrlHeader_Destroy, _GUIToolTip_Destroy, _WinAPI_SetSysColors (Gary Frost)
    Fixed: _IEPropertyGet() with "toolbar".
   Fixed: UDF Doc _ChooseFont missing $hWndOwner from parameter explanation (Bert)
   Added: UDF Examples: _WinAPI_Beep, _WinAPI_ClientToScreen, _WinAPI_EnumDisplayDevices, _WinAPI_EnumWindows
                _WinAPI_EnumWindowsPopup, _WinAPI_FlashWindow, _WinAPI_FlashWindowEx, _WinAPI_FloatToInt
                _WinAPI_GetCursorInfo, _WinAPI_GetDesktopWindow, _WinAPI_GetFocus, _WinAPI_GetModuleHandle
                _WinAPI_HiWord, _WinAPI_IntToFloat, _WinAPI_LoWord, _WinAPI_ScreenToClient (Bert/Gary)
   Updated: UDF Docs Remarks for _ScreenCapture_Capture, _ScreenCapture_CaptureWnd, _ScreenCapture_SaveImage (Gary)
    Updated: UDF description _Timer_SetTimer (Gary)
    Updated: UDF Documentation for _GUICtrlHeader_SetItemFormat, _GUICtrlListView_RegisterSortCallBack (Gary)
    Fixed: UDF _ScreenCapture_Capture Cursor is not on the right position (progandy)
    Fixed: UDF Date function(s) documentation (JerryD)
    Fixed: UDF _GUICtrlListView_RegisterSortCallBack no longer depends on WM_NOTIFY
   Added: UDFs _ColorConvertHSLtoRGB, _ColorConvertRGBtoHSL (-Ultima-)
    Added: UDF _StringSplit (Randallc)

3.2.11.0 (25th January, 2008) (Beta)

AutoIt:

- Removed: Unnecessary optional parameter from ProcessClose().
- Removed: RunErrorsFatal Option.
- Removed: RunAsSet().

- Changed: @Unicode renamed in @AutoItUnicode. @Unicode is an alias for now. It will be removed > 3.2.14.0
- Changed: The behavior of StdoutRead(), StderrRead(), StdinWrite() and ConsoleRead() has been changed.
- Changed: PCRE regular expression engine updated to 7.5.
- Changed: AutoIt internet functions (e.g. InetGet()) now use "AutoIt" as a user-agent.  Previously using blank
            which was blocked by many websites.
- Changed: ControlClick() now accepts the same mouse buttons as MouseClick() - left/right/middle/primary/secondary/main/menu.

- Added: DllCall() new types int_ptr, uint_ptr, long_ptr, ulong_ptr. Special types that change size on x86/x64.
- Added: "REG_QWORD" type for RegWrite().
- Added: Option to compile scripts as console applications.
- Added: HotKeySet() modified to work with the {} notation.
- Added: _DebugBugReportEnv() function in Debug.au3 to retrieve basic Info for Bug Reporting.
- Added: FileReadLine( ,-1) read last line.
- Added: Std I/O redirection works with RunAs...().
- Added: Std I/O merged flag for using the same stream for stdout/stderr.
- Added: Std I/O supports binary data.
- Added: ConsoleWrite()/ConsoleWriteError() now return the amount of data written.
- Added: Remarks in Run() about how to close streams/release resources associated with STDIO.
- Added: StdioClose() function to force STDIO data closed for a process.
- Added: ProcessClose() now closes processes started by other users.
- Added: RunAs(), RunAsWait().

- Fixed: DllCall() setting wrong @error values.
- Fixed: BlockInput() returns errors.
- Fixed: WinWaitActive() not matching (more frequent with Windows Vista).
- Fixed: GUICtrlSetState($GUI_SHOW) on hidden radio on an active tab.
- Fixed: SciTe Lite not installed in the AutoIt Choosen release dir.
- Fixed: WinMove() with Speed = 0 crash the script.
- Fixed: Mysterious return value of 1 when no explicit value was set.
- Fixed: ControlCommand(), "GetLineCount"
- Fixed: _FileListToArray() when using root drive dir as c:\ under Win9x.
- Fixed: TraySetState(4) flashing tray icon for Windows Vista.
- Fixed: ProcessExists() wrong return.
- Fixed: StringRegExp() crashing under Win95.
- Fixed: Handle leak when using Run() with I/O redirection.
- Fixed: Disabled input control background on Tab.
- Fixed: GUICtrlDelete() of a tab if two GUI windows are used.
- Fixed: AutoIt crash in Random() when range exceeds 2^31.
- Fixed: #include parsing error detection.
- Fixed: Array entry passed Byref to a UDF.
- Fixed: FileSetTime() erronously rounds UP on non NTFS partition.
- Fixed: STDIO redirection sometimes failed on Windows 9x.
- Fixed: IniReadSectionNames() returning incorrect number of sections under Win9x.

UDFs:

   Updated: _GDIPlus_ImageLoadFromFile, error check after dllcall (martin)
   Updated: GDIPlus functions error checking and Failure return types where needed (Gary Frost)
   Moved: _SendMessage, _SendMessageA from Misc.au3 to SendMessage.au3 (Gary Frost)
   Added:  UDF Files: _GUICtrlListView_ClickItem, _GUICtrlListView_RegisterSortCallBack, _GUICtrlListView_UnRegisterSortCallBack
           _GUICtrlTreeView_ClickItem, _WinAPI_GetXYFromPoint, _WinAPI_PointFromRect, _WinAPI_CreateFont
           _WinAPI_CreateSolidBrush, _WinAPI_DrawEdge, _WinAPI_DrawFrameControl, _WinAPI_FillRect, _WinAPI_FrameRect
           _GUIImageList_BeginDrag, _GUIImageList_DragEnter, _GUIImageList_DragLeave, _GUIImageList_DragMove, _GUIImageList_EndDrag
           _GUICtrlEdit_FmtLines, _GUICtrlEdit_GetPasswordChar, _GUICtrlEdit_HideBalloonTip, _GUICtrlEdit_SetPasswordChar
           _GUICtrlEdit_ShowBalloonTip, _GUICtrlSlider_GetLogicalTics, $tagLVHITTESTINFO, $tagNMLVCUSTOMDRAW
          _GUICtrlToolbar_ClickAccel, _GUICtrlToolbar_ClickButton, _GUICtrlToolbar_ClickIndex (Gary Frost)
           _GDIPlus_GraphicsDrawImageRect (smashly)
 Updated: UDF Files: _GUICtrlListView_GetOrigin - added check for dll call success
          _GUICtrlListView_SetItemSelected now supports -1 for index and focus
          _GUICtrlEdit_Create doc (Gary Frost)
   Fixes: And Added Param Paremeter: _GUICtrlListView_AddItem, _GUICtrlListView_InsertItem (Gary Frost, Koder)
          _DateDiff doc (Jos/tinjaw), _GUICtrlTreeView_GetNext, _GUICtrlTreeView_SetState (Gary Frost/Bowmore), _ScreenCapture_SaveImage (christian)
          _IsPressed doc (JustinReno), _Net_Share_ShareAdd doc (Wooltown)
    Changed: GUIConstants.au3 is now deprecated.  It is the same as using GUIConstantsEx.au3 which should be used instead.
    Fixed: _PathFull() did not handle paths with a leading \ correctly.
    Removed: MsgBox from _GUICtrlListView_DeleteAllItems and _GUICtrlListView_DeleteItem (Gary Frost)
   Updated: _GUIImageList_AddIcon added Large Icon option (Gary Frost)
   Added: _WinAPI_CallNextHookEx, _WinAPI_SetWindowsHookEx, _WinAPI_UnhookWindowsHookEx, $tagKBDLLHOOKSTRUCT (Gary Frost)
    Fixed: _ArrayDisplay more that 3999 items (-Ultima-)
    Added: _ArrayConcatenate, _ArrayFindAll (-Ultima-)
  Changed: _Arrayxxxx functions/examples (-Ultima-)
    Added: _DebugBugReportEnv (jpm)
    Fixed: _ClipPutFile offset calculated incorrectly (Gary Frost)
    Added: Advanced Examples _NamedPipes_Client, _NamedPipes_Server   (Gary Frost)
    Added:	$tagOPENFILENAME, _WinAPI_CommDlgExtendedError, _WinAPI_GetOpenFileName, _WinAPI_GetSaveFileName (Gary Frost)
     Added: _Singleton() now supports a new flag for creating an insecure object accessible by anybody.
    Changed: _Singleton() no longer does an over-zealous check to remove \ from the name.
    Fixed: _SoundLength() badly formatted (jpm)
    Fixed: _IELoadWait nuisance console COM messages with small loadwait timeouts.  (DaleHohm)
    Fixed: _IEAttach embedded and dialogbox modes failure (dependant on DllCall fix to 3.2.10.0).  (DaleHohm)
    Fixed: _IEAttach embedded and dialogbox modes to work without explorer shell running.  (DaleHohm)
    Fixed: _IEFormElementGetValue now returns NULL string if value is NULL instead of integer 0.  (DaleHohm)
     Fixed: _GUICtrlListView_AddArray Example (Gary Frost)
    Added: uniqueID to _IEPropertyGet.  (DaleHohm)
    Added: "instance" mode and $i_instance parameter to _IEAttach.  (DaleHohm)
     Fixed: _GUICtrlRebar_AddToolBarBand Button height clipped when Toolbar added to Rebar (rover)
    Fixed: _GUICtrlListView_InsertColumn, _GUICtrlListView_SetColumn align and image now work together (Gary Frost)
    Fixed: _GUICtrlToolbar_SetButtonInfo documentation, style and state param descriptions were reversed (Gary Frost)
    Fixed: _GUICtrlStatusBar_Create example documentation (Gary Frost)
    Added: Timers UDFs - _Timer_Diff, _Timer_GetTimerID, _Timer_Init, _Timer_KillAllTimers, _Timer_KillTimer, _Timer_SetTimer (Gary Frost)
    Fixed: UDF Doc for _WinAPI_LoadShell32Icon (MadBoy)
    Added: GuiScrollBars UDFs (Gary Frost)
  Updated: _GUICtrlListView_DeleteAllItems, _GUICtrlListView_DeleteItem, _GUICtrlListView_DeleteItemsSelected support control ID again (Gary Frost)
    Fixed: _FileReadToArray leaving last line feed in the array (mlowery)
    Fixed: Doc Example for _ArrayTrim (Emiel Wieldraaijer)
    Fixed: _GUICtrlTab_GetItemState, _GUICtrlTab_SetItemState, _GUICtrlTab_GetItem, _GUICtrlTab_SetItem State Mask was missing (Gary Frost)
    Fixed: UDF Docs for GUICtrlListBox_AddString, _GUICtrlListBox_DeleteString (Gary Frost)
    Fixed: Example using wrong function calls in _GUIImageList_AddBitmap (Gary Frost)
  Removed: UDF Documentation and Example for _ArrayCreate, function no longer needed (Gary Frost)
    Fixed: _GUICtrlTreeView_GetState hard crashes external application(s) (Gary Frost)
    Added: GuiButton UDFs (Gary Frost)

3.2.10.0 (25th November, 2007) (Release)

3.2.9.14 (21st November, 2007) (Beta)

- Fixed: Incorrect predicted stack size causing DllCallbacks with int64 parmeters to fail (e.g. CopyFileEx)

3.2.9.13 (19th November, 2007) (Beta)

- Fixed: DllCallbacks crashing when tray icon is clicked.  (Note: Callbacks now cannot be paused).

- Added: DllCall() and DllCallbackRegister() now accept doubles, int64 and uint64 types.

3.2.9.12 (17th November, 2007) (Beta)

- Added: DllCallbackRegister(), DllCallbackGetPtr() and DllCallbackFree()

3.2.9.11 (15th November, 2007) (Beta)

- Changed: Added a temporary pop-up warning when deprecated DllCall types are used.

- Fixed: UPX is not used when creating a 64bit compiled script.

3.2.9.10 (12th November, 2007) (Beta)

- Fixed: DllCall() stack error if multiple DllCalls happen at the same time.

3.2.9.9 (10th November, 2007) (Beta)

- Changed: Limits on Execute() removed.

- Fixed: DllStructCreate() now properly aligns the end of the structure if required.

3.2.9.8 (6th November, 2007) (Beta)

- Added: DllStructCreate() added "align" keyword to set structure alignment.

3.2.9.7 (6th November, 2007) (Beta)

- Fixed: Arithmetic (addition and subtraction) not working on Variants containing pointers.

3.2.9.6 (4th November, 2007) (Beta)

- Fixed: Looping GUIRegisterMsg() doesn't unregister.
- Fixed: Focus on ES_READONLY edit control.

3.2.9.5 (2nd November, 2007) (Beta)

- Changed: DllCall() new method of passing types by reference using *.
- Changed: DllCall(): short_ptr, long_ptr, int_ptr types deprecated.  Use short*, long* and int* respectively.

- Added: VarGetType().
- Added: @AutoItX64 macro.
- Added: DllCall() new types of wparam and lparam.
- Added: Au3Info : Handle info for windows and controls.

- Fixed: Control...() functions using CLASS and TEXT together sometimes incorrect.
- Fixed: Control...() functions using CLASSNN sometimes incorrect.
- Fixed: Windows Vista taskbar previews causing problems with windows matching.
- Fixed: _SQLite_SQLiteExe() referencing by default "Extras\SQLite\SQlite3.exe".
- Fixed: _Sound...() when refering to a file with "!" characters.

3.2.9.4 (25th October, 2007) (Beta)

- Fixed: ProcessExists() on service process under Win2K.
- Fixed: $GUI_DEFBUTTON behavior.
- Fixed: ProcessGetStats() retrieving IO counters for Win9x, WinNT, Win2000.
- Fixed: ControlCommand(SelectString) order selection.
- Fixed: GUISetStyle(), GUIGetStyle(), ProcessGetStats() cannot be compiled.
- Fixed: Array cannot have 2^24 entries.
- Fixed: DefPushButton behavior.
- Fixed: GuiCreateMenu() on a windows without title and without client area.
- Fixed: WinWaitActive() sometimes failing after a WinActivate().

3.2.9.3 (5th October, 2007) (Beta)

- Fixed: $var = $var was not giving an error when $var didn't already exist.
- Fixed: Opt("WinTitleMatchMode", Default) fatal error.
- Fixed: 3.2.9.2 AutoIt error when launched under Windows 2000.
- Fixed: GUICtrlSetStyle() with $ES_READONLY bad $WS_TABSTOP.
- Fixed: AutoIt Crash on exit if Win...() used with a Title being a COM object.

3.2.9.2 (30th September, 2007) (Beta)

- Changed: PCRE regular expression engine updated to 7.4.

- Added: ProcessGetStats().

- Fixed: Extra notification on colored button.
- Fixed: IniReadSectionNames() for [] sections.

3.2.9.1 (18th September, 2007) (Beta)

- Added: SendKeepActive().
- Added: More commands for ControlTreeView().

- Fixed: GUICtrlSetImage() sizing regression from 3.2.4.9.
- Fixed: GUICtrlCreateListView() with no column.
- Fixed: _GUICtrlListViewInsertColumn() after _GUICtrlListViewDeleteColumn() of the first column of a ListView control.

3.2.9.0 (12th September, 2007) (Beta)

- Added: ControlTreeView().

3.2.8.1 (10th September, 2007) (Release)

- Fixed: Possible crash with StringRegExp().

3.2.8.0 (8th September, 2007) (Release)

3.2.7.6 (7th September, 2007) (Beta)

- Added: WinMove() speed parameter.

- Fixed: Crash on AutoIt exit if TrayItemCreate is not deleted.
- Fixed: AutoIt crash on bad parameter when calling TrayCreateMenu

3.2.7.5 (6th September, 2007) (Beta)

- Fixed: Character positions returned by StringRegExp() not correct for characters > 127 (accents, non-Western)

3.2.7.4 (5th September, 2007) (Beta)

- Changed: General speed improvements (currently up to 24% in some cases compared to 3.2.6.0).

- Fixed: Memory leak when AutoIt need to get longfilename (a lot of file functions).
- Fixed: ListviewItem not created after other Child Windows creation/deletion.
- Fixed: ControlGetFocus() returning bad ClassNN.
- Fixed: Detection of invalid CONTINUELOOP.

3.2.7.3 (3rd September, 2007) (Beta)

- Fixed: String memory allocation error introduced in 3.2.7.2.

3.2.7.2 (2nd September, 2007) (Beta)

- Changed: PCRE regular expression engine updated to 7.3.
- Changed: Recursion-based code limits relaxed.

- Fixed: ProcessExist() under Windows 9x.
- Fixed: $LVSCW_AUTOSIZE column truncates display string.
- Fixed: Incorrect listview creation.

3.2.7.1 (30th August, 2007) (Beta)

- Changed: More speed improvements.

- Fixed: ControlGetText() crash on Scite windows.

3.2.7.0 (25th August, 2007) (Beta)

- Added: wchar type added to DllStructCreate()

- Fixed: GUISetState(@SW_DISABLE) not disabling keyboard input.
- Fixed: Sometimes AutoIt crashes on DllStructGetData of char[].
- Fixed: Au3Info restoring last settings.
- Fixed: Better handling of notifications when using colored buttons.

3.2.6.0 (24th August, 2007)  (Release)

3.2.5.7 (22nd August, 2007) (Beta)

- Changed: More speed improvements (currently around 30-40% over 3.2.4.9)

- Added: GUIGetStyle().
- Added: byte and ubyte type to DllCall().

- Fixed: AutoIt crash on WinWait("","text") when a Scite is open.

3.2.5.6 (19th August, 2007) (Beta)

- Changed: Limited Unicode support added in regular expressions.

- Fixed: Some crashes on Chinese systems during conversions.

3.2.5.5 (18th August, 2007) (Beta)

- Fixed: Aut2Exe crashing on Chinese systems when running in ANSI.
- Fixed: resizing of treeview.
- Fixed: IE.au3 bad 3.2.5.4 version. (Sorry Dale)
- Fixed: Cmdline /ErrorStdOut working with /AutoItExecuteLine.
- Fixed: Detection of no separator after keyword or function.

3.2.5.4 (14th August, 2007) (Beta)

- Changed: Slight expression parsing speed improvement.

- Added: ControlMove() just resizing as WinMove() if X=Y=Default.

- Fixed: Wrong Notification on {ENTER} after clicking on a listviewItem.
- Fixed: Wrong resetting of image on listviewitems if image set on the listview.
- Fixed: FileselectFolder() out-of-bounds popup.
- Fixed: Resizing of listview control.

3.2.5.3 (11th August, 2007) (Beta)

- Changed: Some speed improvements.

- Fixed: @error not set on bad WinGetPos() return.
- Fixed: LVM_EDITLABEL hogging cpu.
- Fixed: AutoIt (non UNICODE version) crash with some COM objects.

3.2.5.2 (9th August, 2007) (Beta)

- Changed: IconId in all GUI functions is coherent with the actual GUICtrlSetImage() for icon control.

WARNING Previous scripts using GUICtrlSetImage(), GUISetIcon(), TraySetIcon() and TraySetPauseIcon()
    may display a wrong Icon. To get the same icon "if nId > 0 Then newId = - nId - 1".

- Changed: AutoIt .a3x and compiled script format.  Exe2Aut will only decompile 3.2.5.1
           and earlier files. The new format doesn't support decompilation.

- Fixed: GUISetState() on GUI with W=0 or H=0.
- Fixed: GUI control Tip not reappearing after a click or timeout.
- Fixed: GUI controls not at the right position if a Control menu is in use.
- Fixed: EnvUpdate() in UNICODE AutoIt version not working since 3.2.3.3.
- Fixed: FileRead(..., count) returning count-1 chars.
- Fixed: Unicode filenames in FileInstall().

3.2.5.1 (29th July, 2007) (Beta)

- Fixed: LVS_EX_HEADERDRAGDROP extendedstyle.
- Fixed: UpDown control shows through tabbed pages.
- Fixed: GUICtrlSetState on UPDOWN control without changing the state.
- Fixed: FileInstall() in compiled scripts causing GUI problems.
- Fixed: ControlGetFocus() on control not created with AutoIt GUI.
- Fixed: @AutoItPID and processlist coherency under Win9x.
- Fixed: GUICtrlSetResizing not returning error on non resizable control.
- Fixed: regression for ControlSend SHIFTDOWN/UP since 3.2.3.13.
- Fixed: Fileread bad return length.

3.2.5.0 (11th July, 2007) (Beta)

- Added: ClassnameNN in control and summary info.
- Added: Float type to dllCall.
- Added: AU3Check v1.54.8 support for both "#AutoIt3Wrapper_plugin_funcs" and "#Compiler_plugin_funcs".
- Added: Extra parameter in ProcessClose() to close Stream handles.

- Changed: GUICtrlSetImage() on Button Ctrl with id<0 coherent with icon ctrl setting.
- Changed: PCRE engine updated from 7.0 to 7.1

- Fixed: Drag and drop on a listview control after clicking on its header.
- Fixed: Support "resource only" dlls for GUISetImage().
- Fixed: Default minimum for GUICtrlSetLimit() set to 0.
- Fixed: Z order after GUICtrlSetStyle() on edit or input control.
- Fixed: FileReadLine() getting bad cached data when reading specific line numbers with file handles.
- Fixed: Slight lag in GUIGetMsg() under certain circumstances.
- Fixed: StringReplace() and occurances parameter.
- Fixed: GuiCtrlSetFont() on Tab control.
- Fixed: Leading blanks before #include cannot be compiled.
- Fixed: Notification on ENTER on Colored button.
- Fixed: suppress delay when speed=0 in MouseMove.
- Fixed: RegWrite() setting bad registry entry.
- Fixed: AutoIt hogging CPU when text msgbox too big.
- Fixed: ControlSend() sometime to wrong control when using empty controlid.
- Fixed: ProcesExists() under Win2K with processname >15 chars.
- Fixed: Int() with string comparison wrong match.
- Fixed: InetGetSize() in unicode version returns 0.
- Fixed: GUICtrlCreateListview() with more than 254 columns.
- Fixed: AutoIt Crash on wrong recursive RegExp.
- Fixed: BitRotate() with left bit set.
- Fixed: Filemove() returning 1 without any move.
- Fixed: FileRead() returning chr(0) in ANSI mode.
- Fixed: Au3Info control coords relative to client.
- Fixed: StringInStr() not returniong 0 when searching backward and searh lenght greater than string.
- Fixed: AutoUpdateIT from Saunders.

UDF's
   -  Added _IEGetObjByID to IE.au3 (DaleHohm)
   -  Fixed _IEPropertyGet() directives appversion and appminorversion (Dale Hohm)
   -  Fixed _IELoadWait to trap ClientDisconnected Com errors (DaleHohm)
   -  Fixed and enhanced web links in _IE_Introduction('basic') (DaleHohm)
   -  Several updates to IE.au3 documentation and examples (DaleHohm)
   -  Total rewrite of _ArrayDisplay with more options. (randallc)
   -  Fixed _ArrayDisplay to set the Opt("GUIOnEventMode",0) before dsiplaying the Array and changing is back before returning.
   -  Added Optional: Handle of owner window to _ChooseColor andf ChooseFont. (gafrost)
   -  Fixed _ArraytoString for array with only one element.
   -  Fixed _SetDate in Date.au3 if daylight saving is involved.
   -  Fixed: bad checking of SQlite version.
   -  Added: CompareVersion() in Misc.au3.
   -  Fixed: _IsClassName doc.

3.2.4.9 (25th May, 2007) (Release)

- Added: StringCompare()

- Fixed: Basic string comparisons were not working with locale as in previous versions.

3.2.4.8 (23rd May, 2007) (Release)

- Fixed: Errors with non-western codepages and ANSI format scripts.

3.2.4.7 (22nd May, 2007) (Release)

- Added: Aut2Exe options for forcing ANSI mode compilation (/ansi and /unicode)
- Added: StringToBinary()
- Added: Additional unicode related options for BinaryToString()

3.2.4.6 (20th May, 2007) (Release)

- Fixed: StringReplace() and occurances parameter.

3.2.4.5 (20th May, 2007) (Release)

- Added: BinaryToString() for binary buffer to ANSI string quick conversions.
- Added: @Unicode to show if AutoIt is being run in Unicode or ANSI mode.

- Changed: StringReplace() speeded up - a lot.
- Changed: Au3Info is now resizable.

- Fixed: Chr(0) now properly works with Binary()

3.2.4.4 (17th May, 2007) (Release)

- Fixed: Chr(0) now acting more sensible (now acts in a similar way to VBScript).

3.2.4.3 (17th May, 2007) (Release)

- Fixed: FileRead() not working properly with unicode files.

3.2.4.2 (15th May, 2007) (Release)

- Changed: Au3Info graphical tweaks and Summary tab.

- Fixed: FileReadLine() getting bad cached data when reading specific line numbers with file handles.
- Fixed: Slight lag in GUIGetMsg() under certain circumstances.

3.2.4.1 (13th May, 2007) (Release)

- Added: ChrW() and AscW() for unicode operations.

- Fixed: Chr() and Asc() for character codes 128-255 in unicode mode.
- Fixed: Unicode BOM was not being written in file append modes if the file was empty.
- Fixed: Error in Include\GuiCombo.au3 and Include\IE.au3.

3.2.4.0 (10th May, 2007) (Release)

Big Changes:

- AutoIt is now compiled for Unicode!  AutoIt3.exe is Unicode - AutoIt3A.exe is ANSI.
- Au3Info tool rewritten.
- Binary data functions completely rewritten - scripts using these functions will need to be changed.

3.2.3.14 (6th May, 2007) (Beta)

- Added: Support for virtually all file formats (UTF16 LE/BE, UTF8) in scripts and File functions.
- Fixed: Possible Aut2Exe crash with #cs/#ce blocks.

3.2.3.13 (4th May, 2007) (Beta)

- Removed: Struct keyword and dot notation for accessing.

3.2.3.12 (29th April, 2007) (Beta)

- Changed: Removed restrictions on the maximum number of #include directives.
- Changed: Removed restrictions on the maximum number of DllOpen() handles.
- Changed: Removed restrictions on the maximum number of open files.
- Changed: Removed restrictions on the maximum number of hotkeys.

3.2.3.11 (28th April, 2007) (Beta)

- Fixed: Binary() crashed when passed an array.

3.2.3.10 (27th April, 2007) (Beta)

- Added: New modes for FileOpen() to force Unicode and binary operations.

3.2.3.9 (26th April, 2007) (Beta)

- Changed: Performance improvements in StringStripWS().

- Fixed: Unicode regression in StringIsAlpha(), StringIsAlnum(), StringIsDigit(), StringIsXDigit(),
            StringIsLower(), StringIsUpper(), StringIsSpace(), StringIsASCII()

3.2.3.8 (25th April, 2007) (Beta)

- Fixed: Regression in StringInStr().
- Fixed: Possible crash when using StringStripWS(), flag 4 and empty strings.

3.2.3.7 (25th April, 2007) (Beta)

- Fixed: GuiCtrlSetTip() not always working correctly.
- Fixed: Regression in InetGetSize() that caused a crash.
- Fixed: GUICtrlSetLimit() for UpDown controls where min = max.

3.2.3.6 (17th April, 2007) (Beta)

- Fixed: Regression in #RequireAdmin and #NoTrayIcon in compiled scripts.
- Fixed: Aut2Exe crashed when using nodecompile option.
- Fixed: UDPSend() and UDPRecv() fixed for binary rewrite.

3.2.3.5 (15th April, 2007) (Beta)

- Fixed: Regression in ConsoleWrite()

3.2.3.4 (15th April, 2007) (Beta)

- Fixed: Regression in FileSetAttrib() and FileSetTime()

3.2.3.3 (15th April, 2007) (Beta)

AutoIt is now compiled for Unicode!  AutoIt3.exe is Unicode - AutoIt3A.exe is ANSI.

- Added: BinaryLen(), BinaryMid()

- Changed: Binary data in variants are now treated as a special type, separate from normal strings.
- Changed: BinaryString() renamed to Binary()
- Changed: IsBinaryString() renamed to IsBinary()

3.2.3.2 (29th March, 2007) (Beta)

- Changed: ControlClick() can now click a control at a certain position.
- Changed: ControlClick() can now properly simulate double-clicks.
- Changed: ControlClick() no longer forces the activation of the parent window (up to the user now).
- Changed: ControlClick() related coordinates added to Au3Info.

3.2.3.1 (27th March, 2007) (Beta)

- Changed: Au3Info recoded.
- Changed: Improved the searches that can be done for windows/controls/instances.

- Fixed: Slow GUI tab redrawing under Windows Vista fixed.

3.2.3.0 (9th March, 2007) (Beta)

- Added: Colored Button based on gafrost UDF.
- Added: DllStruct...() can reference elements by name.
- Added: Struct variables

- Changed: From DEFAULT_QUALITY to PROOF_QUALITY for Change/Set Font functions.
- Changed: pcre from 6.7 to 6.10.
- Changed: x^y compatible with C99 standard.

- Fixed: HotKeySet bad notification. (Thanls litlmike)
- Fixed: FileGetAttrib on pagefil.sys.
- Fixed: BitXOR doc.
- Fixed: invalid default parameter in GUICtrlSetData not detected.
- Fixed: Assign does return error on array element.
- Fixed: FileOpen("test.txt", 2+8) returning error.
- Fixed: Error detection in Enum statement.
- Fixed: Help file does not open examples.
- Fixed: _GUICtrlStatusBarSetIcon
- Fixed: Opt("WinTitleMatchMode").
- Fixed: _Degree in Math.au3
- Updated: refresh blocked during GUISetState(@SW_LOCK). (seems needed for Windows XP style)
- Fixed: Stack corruption resulting from improper use of DllCall() now gracefully aborts the script instead of hard crashing.
- Fixed: Crash when reading empty REG_MULTI_SZ.
- Fixed: Round() not returning an integer.
- Fixed: ControlSend() to empty "" ctrl fixed for inactive window. Also shift state behavior.
- Fixed : O^(-1).
- Fixed: non detection of illegal statement.
- Fixed: HotKeySet("^{PAUSE]",... notification.
- Fixed: {CTRLBREAK} ->{BREAK} as ctrl is user responsability.
- Fixed : _DateTimeSplit()
- Fixed: $var = Default passed as parameter to Com object.
- Fixed: Edit control would always have focus the first time the GUI was displayed even if it shouldn't.  This behavior also ignored $GUI_FOCUS.
- Fixed: range value for seed Number in SRandom().
- Fixed: AutoIt Info last window memorization.
- Fixed: Fileread crash if no count in raw mode.
- Fixed: _GUICtrlEditGetLine().
- Fixed: Opt("WinTitleMatchMode", <0) really matching case insensitive.
- Fixed: FileSetAttrib/FileSetTime wrong setting.
- Fixed: Execute/Call recursive overflow display error message.
- Fixed: Aut2exe warning message if icon not found.
- Fixed: _ReplaceStringInFile() to keep the original file attributes.
- Fixed; issue with au3check when include file name contains trailing spaces.(Update version to 1.54.7)
- Fixed: WinGetTitle() returns 1 on error.
- Fixed: memory leak on keyword variable deallocation.

3.2.2.0 (19th December, 2006) (RC1)

- Changed: @error set to WinAPI GetLastError() for Run().

- Fixed: List control not displayed when using GUISetFont.
- Fixed: MsgBox() timeout on Windows Vista.
- Fixed: Fatal error on opt('TrayMenuMode",...).
- Fixed: Installer SciTE bad link creation.
- Fixed: Uninstaller include file removal

3.2.1.14 (9th December, 2006) (Beta)
- Added: GuiCtrlSetState $GUI_DROPNOTACCEPTED.
- Added: $GUI_FOCUS, $GUINOFOCUS for listviewitem control.
- Added: IsDllStruct()
- Added: SRandom() to set seed for random number generation.
- Added: WinTitleMatchMode for case insensitive matching.

- Changed: Small tweak to Floor() to ensure it is not as susceptible to floating point precision errors.
- Changed: Small tweak to Ceiling() to ensure it is not as susceptible to floating point precision errors.

- Fixed: WorkingDir in ShellExecute(Wait).
- Fixed: DllCall() crashes when using uint, ushort.
- Fixed: PixelCheckSum() GDI leak.
- Fixed: Window titles with "regexp=REGEXP" return 0 and @error=1 on bad pattern.
- Fixed: GuiCtrlRead on listview control when sorted.
- Fixed: FileRecycleEmpty() regression.
- Fixed: @OSVERSION on Windows 9x.
- Fixed: GuiGetCursorInfo with Handle not retrieving mouse click info.

3.2.1.13 (18th November, 2006) (Beta)
- Added: Listview Alternate coloring with $GUI_BKCOLOR_LV_ALTERNATE.
- Fixed: Recent crash under Windows 98.
- Fixed: List control height when font size changes.
- Fixed: GUICtrlSetImage not testing icon on error.
- Fixed: @ScriptDir equal @WorkingDir for rootdir (x:\).
- Fixed: GUIGetCursorInfo (winhandle) when child not active.
- Fixed: AutoIt error not displaying error line number.
- Fixed: Yet another MsgBox() timeout regression fixed.
- Fixed: au3check only checks for a string to terminate on the same line to. (v1.54.5)
- Fixed: _StringAddComma().
- Fixed: drag & drop $GUI_EVENT_DROPPED notififation on edit control.

3.2.1.12 (5th November, 2006) (Beta)
- Fixed: Coherency of type parameter for DLLCall() and DLLSructCreate()
- Added: IconId can be reference by ordinal value if negative 1-based index is use.
- Added: Executable and help files for SQLite in Extras dir.
- Updated: Draw lines ontop during CtrlSetGraphic rendering.
- Fixed: GuiGetCursorInfo eating msg.
- Fixed: Invalid THEN did not produce a syntax error.
- Fixed: StringMid with start <=0.
- Fixed: syntax checking on unmatching DO, WEnd, ....
- Fixed: Default keyword didn't always work correctly with COM objects.
- Fixed: MsgBox() timeout regression.

3.2.1.11 (20th October, 2006) (Beta)
- Fixed: GUICtrlRead, GUICtrlSetState, GUICtrlSetData with listviewitem sorted.
- Fixed: StringSplit every char on BinaryString.
- Fixed: When #include failed was not including filename in the error message.

3.2.1.10 (15th October, 2006) (Beta)
- Fixed: GUICtrlCreateIcon, GUICtrlSetImage with IconID=-1.
- Fixed: regression with StringMid("",5,2).
- Fixed: Typo that broke Ping().

3.2.1.9 (13th October, 2006) (Beta)
- Fixed: COM property write fails when using arguments.
- Fixed: Send/ControlSend for US international keyboard
- Fixed: Send/ControlSend char>=chr(128) for english keyboards.
- Fixed: MsgBox() with task modal flag left GUI's disabled on timeout.
- Fixed: report reporting by messagebox even with /ErrorStdOut.
- Fixed: GUICtrlSetImage default icon value for Icon Ctrl.

3.2.1.8 (8th October, 2006) (Beta)
- Fixed: InetGet() regression.
- Fixed: StringRegExpReplace() wasn't returning number of replacements in @extended.

3.2.1.7 (6th October, 2006) (Beta)
- Added: StringRegExp() and StringRegExpReplace() regular expression support (Perl compatible)
- Added: Regular expression support for Window title matching
- Added: ShellExecute() and ShellExecuteWait() functions. (by Jon)
- Fixed: Mistake in IniWriteSection() documentation. (by Valik)
- Fixed: GuiSetFont, GuiCtrlSetFont bad parameter error return.
- Fixed: _GUITreeViewGetText doc typo. (gafrost)
- Fixed: GUIRegisterMSG destroy @error.
- Fixed: $LVS_SORTASCENDING with GUICtrlSetImage icon bad display.
- Fixed: Wrong default arguments for _ArrayToString().
- Fixed: GUIRegisterMSG destroyed @error.
- Fixed: $LVS_SORTASCENDING with GUICtrlSetImage icon gave bad display.
- Added: @extended error code on DriveMapAdd error.
- Fixed: bad "#" instruction inhibit whole script.

3.2.1.6 (6th October, 2006) (Beta)
Aborted upload due to last minute bugs.

3.2.1.5 (29th September, 2006) (Beta)
- Fixed: FtpSetProxy doc example.
- Added: 2 UDF's to GUIStatusBar.au3. (gafrost)
- Fixed: Several updates to GUIStatusBar.au3. (gafrost)
- Fixed: Several updates to Sound.au3.  (RazerM)
- Fixed: Crash Aut2exe using cmdline with shortnames.
- Changed: PixelChecksum() is now over 30x faster. (by Valik)
- Fixed: _GUICtrlListViewGetItemText in GUIListView.au3.
- Fixed: WinMove, StderrRead Doc typos.
- Added: GUICtrlCreateIcon and GUICtrlSetImage can select in multiple icon file by name.
- Added: #RequireAdmin for UAC/Windows Vista. (By Jon)
- Added: ToolTip() option to ensure the tooltip is always displaying on a monitor. (by Valik)
- Fixed: Tooltip state (Such as icon or title) was showing up on subsequent tooltips that didn't want those items.  This affected both ToolTip() and GUICtrlSetTip(). (by Valik)
- Added: IniWriteSection() function. (by Valik)
- Added: Windows vista help file entry.

3.2.1.4 (22nd September, 2006) (Beta)
- Fixed: ControlSend sending special characters.
- Added: Expanded GUICtrlSetTip() to allow creation of tooltips with titles, icons and using the balloon tip style. (by Valik)
- Added: Tooltip supports Default keyword. (by Valik)
- Changed: Modified _PathSplit() to be much faster.
- Added: Remark added to _PathSplit() mentioning that it does not accept command line strings, only paths.
- Changed: Rewrote _ArrayToString() removing a lot of unnecessary error checking.
- Fixed: crash in Au3exe with badly form input file in FileInstall.
- Fixed: wrong execution a compiled script containing fileInstall inside #CS-#CE.
- Fixed: FileInstall referencing a file without any path will refernce it from the ScriptDir to be coherent with the compiled script.

3.2.1.3 (15th September, 2006) (Beta)
- Fixed: "#include <Misc.au3>" in GuiIPAddress.au3  (gafrost)
- Fixed: StringInStr not converting to string search parameter.
- Added: Support >32x32 icon from .exe/.dll in GUICtrlCreateIcon or GUICtrlSetImage.
- Fixed: Syntax description for _DayValueToDate() showed _DateToDayValue() instead. (by Valik)
- Fixed: example in Language Reference->Conditional Statement doc page.
- Fixed: typo in GUICtrlCreateGraphic doc.
- Fixed: Int() of a binarystring.

3.2.1.2 (9th September, 2006) (Beta)
- Fixed: MouseMove in secondary screen.
- Fixed: _GUICtrlStatusBarCreate in GUICtrlStatusBar.au3.
- Fixed: str and wstr in DllCall doc (only up to 65536).
- Fixed: Send to italian keyboard.
- Added: @KBLayout to retrieve the current keyboard configuration.
- Fixed: GUICtrlSetState doc remarks about menu control.
- Fixed: refresh after a GUICtrlSetBkColor.
- Fixed: crash on line begining with ~  : "Unable to parse line".
- Fixed: IniReadSectionNames() returned bogus data in Windows 98 when the INI file was empty or did not exist.
- Added: CompiledScript string file info for compiled script.
- Updated: FileGetVersion extra parameter to retrieve string file info.
- Fixed: _GUICtrlStatusBarSetIcon doc typo and precision. (by gafrost)
- Fixed: _GUICtrlTreeViewSetText doc typo. (by gafrost)
- Fixed: Doc precision about GUICtrlCreateTab that can be used only one by window.
- Fixed: include reference in doc example.
- Fixed: .a3x green icon.
- Fixed:  _GUICtrlListViewGetHeader doc remarks. (by gafrost)
- Fixed: _GUICtrlTreeViewDeleteItem Help hyperlink error.
- Updated: @ScriptLineNumber doc description.
- Fixed: Installdir doc page.
- Fixed: @compiled when the script is compiled.
- Fixed: _INetSMTPMail doc precision.
- UDF's (27 August 2006)
   - Added 2 UDF's to GUIStatusBar.au3. (gafrost)
   - Added GuiIPAddress.au3 to Include directory. (gafrost)
   - Added Sound.au3 with several sound UDFs to Include directory. (RazerM)
   - Removed the version numbers from the include files.

3.2.1.1 (27th August, 2006) (Beta)

- Fixed: UDP... return code on error.
- Fixed: UDPRecv crashed on bad parameter.
- Fixed: COM was corrupting floating point values.
- Fixed: Aut2Exe was not finding includes correctly.

3.2.1.0 (26th August, 2006) (Beta)

- Changed: Performance improvement prototype (up to 100% on some scripts!).

- Fixed: Memory leak with prototype plugins.
- Fixed: Some Object Collections could not be parsed in one AutoIt statement .
- Fixed: Bad screen updating of already unchecked radiobuttons.
- Fixed: Tray icon tooltip not displaying the scriptname when compiled.

3.2.0.1 (13th August, 2006) (Release)

- Fixed: (AU3INFO) Buffer overrun in control code.
- Fixed: Exe2Aut.exe was missing its digital signature.

3.2.0 (12th August, 2006) (Release)

- Added: in GuiTreeview.au3, _GUICtrlTreeViewGetParentHandle() and _GUICtrlTreeViewGetParentID() - supports now optional item handle/ID (by holger)
- Added: Hotkeys for Always On Top, Highlight Controls and Magnify options.

- Fixed: twice same link in SplashTextOn doc.
- Fixed: not working FileGetAttrib doc example.
- Fixed: GuiTreeview doc examples. (by gafrost)
- Fixed: autoitx bugs.
- Fixed: bad repainting of updown reenabled control.

3.1.1.133 (6th August, 2006) (beta)

- Added: Test for COM object comparison using = and <>.

- Fixed: Bad multi Drop in a edit control.
- Fixed: Brain-dead developer broke ConsoleRead().
- Fixed: Documentation for IniDelete() was wrong.
- Fixed: Uppercase in udf doc.
- Fixed: GUICtrlRegisterListViewSort doc examples..
- Fixed: Typo in Send doc..
- Fixed: Menu conventions changed in Aut2Exe and Exe2Aut.
- Fixed: Some precision on text vertical centering in SplashTextOn documentation.
- Fixed: Treeview does not refresh on tab.

3.1.1.132 (23rd July, 2006) (beta)

- Added: AutoItX beta 3.1.1.1.
- Added: Au3Check so it can be used without the Full SciTe. (by JdeB)

- Updated: TrayIcon is no more displayed when using /AutoIt3ExecuteLine.
- Changed: Compilation done with VC8 instead of VC6. (by Jon)
- Updated: SciTe updated to 1.70, it can be start with the AutoIt V3 menu. (by JdeB, Jon)

- Fixed: FileInstall() deleting output dir without backslash at the end.
- Fixed: GUICtrlRead bad return on Treeviewitem.
- Fixed: Background color of listbox changes in tab.
- Fixed: Reading std streams would fail if the stream was not a pipe.(internal change by Valik)
- Fixed: Doc examples referring constant already define in GUIConstants.au3. (by Jon)

3.1.1.131 (19th July, 2006) (beta)

- Fixed: GUIRegisterMsg() crash in "GUIOnEventMode"
- Fixed: GUIRegisterMsg() unregister a message
- Changed: GUICtrlRead() in advanced mode - returns extended info as single value. This change will possible break scripts! (Valik/changed by Holger)
- Added: Binary support for COM functions. It works only with variables passed between COM functions (so you can't display, convert or do mathematical actions with these variables yet). (by SvenP)
- Changed: GUICtrlRead() in advanced mode for Tab control return the controlId of the select tabitem. The Opt("GuiEventOption",2) is suppressed. This change will break scripts!
- Updated: GUI Standard includes splitted for better small inclusion. GUIConstants.au3 still give the whole stuff perhaps a little more. (by Valik)
- Fixed: Problem with Util_DoesFileExist and pagefile.sys .
- Fixed: GUICtrlSetGraphic,GUISetOnEvent,GUICtrlSetResizing, AutoItSetOption, MouseClick,Finc...EndFunc, For...in...Next, _GUICtrlTreeViewDeleteItem doc brolken links.
- Changed: StdioRead now sets a unique @error code for each error. Also, @extended is set to GetLastError() in each case. These are helpful for diagnosing I/O problems. The errors or the values should not be documented, it is enough to know that an error occurred, it is not necessary for users to know specifically what internal error occurred. (by Valik)
- Fixed: Slight precision on $CmdLineRaw for compiled scripts.
- Fixed: Crash after AutoIt exit.
- Changed: _FilesListToArray(): Added @error 4 meaning no files found. (gafrost)
- Changed: Constants seperated out into seperate files. (Valik)
- Changed: GUIConstants.au3 is now a stub including pretty much everything (Use GUIConstantsEx.au3 and the other Constants.au3 files for more granularity). (Valik)
- Updated: several Helpfile pages for ie.au3. (Big_Daddy)
- Updated: several functions in visa.au3. (Angel)
- Fixed: _viPrintf and _viExecCommand would not work with certain GPIB cards (such as USB-GPIB cards).
- Changed: use of the VISA command "viWrite" method to be more generic.
- Added: Additional OPTIONAL parameter for _viPrintf and _viExecComand. Controls command send mode and terminator. Default value is "Use @LF terminator".
- Updated : _viPrintf and _ViExecCommand append an @LF to every VISA command by default. This can be changed by means of a new optional parameter.
- Updated : _viPrintf and _ViExecCommand do not "protect" for escape characters anymore by default. That causes problems with some GPIB cards. It is possible to go back to the original behaviour by setting the new optional parameter $s_mode to "str".

3.1.1.130 (12th July, 2006) (beta)

- Added:       Check to ensure that FileInstall() can override the target file.
- Added:       GUICtrlCreatePic doc precision when using overlayed tab control.
- Fixed:        Extra .SVN directories created during installation.
- Fixed:        FAQ#1 doc.
- Reverted:   Conversion from floating point to string now shows less precision to prevent displaying unexpected values. (by Valik) The conversion will be back as in the official release.

3.1.1.129 (11th July, 2006) (beta)

- Fixed:        Exit did not work in all situations where it should. (by Valik)
- Fixed:        StringSplit on binaryString when delimiter not found.
- Fixed:        GUICtrlCreatePic Doc typo.
- Fixed:        COM/Obj Distinction between Null and 0
- Updated:    v1.65 (6 July 2006)
- Added: IE.au3.
- Changed _InetSmtpMail(), change initial connection logic. (Neil)
- Fixed _TicksToTime() StringIsInt() problem. (JdeB)
- Fixed Bug in _GUICtrlListViewGetItemText on return if a subitem is empty. (gafrost)

3.1.1.128 (28th June, 2006) (beta)

- Fixed:        GUISwitch crash after GUIDelete on another window.
- Fixed:        Conversion from floating point to string now shows less precision to prevent displaying unexpected values. (by Valik)
- Fixed:        Random doc example.
- Fixed:        GUIRegisterMsg() - overlapping of same messages.
- Fixed:        ConsoleWrite(), ConsoleWriteError() - @LF was expanded to @CRLF automatically which could result in badly formatted data. Now no automatic expansion is performed; what is passed to these two functions is written. (by Valik)
- Added:      /nopack command line parameter added to Aut2Exe. This disables UPX packing from the command line. (by Valik)
- Fixed:        Crash AutoiT if Win... with bad regExp.
- Updated:    v1.64 (27 June 2006)
- Updated _GUICtrlListViewGetItemText: removed $v_ret variable to avoid au3check errors. (gafrost)
- Updated _GUIListView: Some bugfixes and Helpfile correction. (gafrost)
- Updated _GUIListView: Found a way I can live with the -1 being in the _GUICtrlListViewGetItemText
and _GUICtrlListViewGetItemTextArray for using selected index in the function calls. (gafrost)

3.1.1.127 (20th June, 2006) (beta)

- Fixed:        bad Combo bkcolor : grey.
- Added:      ClipGet return @error=1 on empty and @error=2 on nontext.
- Added:      ClipPut("") empty the clipboard.
- Fixed:        WinKill() referencing an explorer.exe window not closing.
- Updated:    Upx.exe 2.00 -> 2.01.
- Added:       FileGetLongName($relativefile, 1) and FileGetShortName($relativefile, 1) support relative path conventions.
- Fixed:        Small precision in FileFindFirstFile doc about matching 3-char extension.
- Fixed:        AutoIt Crash if too many includes in Opt(TrayIconDebug,1).
- Added:       GUI_MAXCOLOURS added to AutoIt limits appendix.
- Fixed:        GUISetOnEvent, GuiCtrlSetOnEvent, TrayItemSetOnEvent and TraySetOnEvent can be disabled.
- Fixed:        Wrong matching of While/Wend, Do/Until, If/Endif, ... .
- Fixed:        ObjEvent() doc example.
- Fixed:        ObjEvent() regression from .125.
- Updated:    ClipGet() doc remarks on multiselection.
- Fixed:        #include doc about lower case only removed.
- Fixed:        BitShift() doc. (by Valik)
- Fixed:        Remove MessageBox in Aut2exe.exe
- Updated:    v1.63 (19 June 2006)
- Updated _DateTimeFormat() to use a default template when registry entries are missing
Like in Win9x/WinME for SLongDate.
- GuiListView updated .This update will possible break scripts. (gafrost)
Replaced ControlListView calls (will no longer need window title/text in params).
Functions updated to reflect new params.
Examples updated for consistancy.
Templates updated as needed.
- _ArrayBinarySearch: (JdeB)
removed check for more than 1 entry to allow the use of this UDF on arrays with one entry.

3.1.1.126 (4th June, 2006) (beta)

- Fixed:        Slight update on language variable doc precision.
- Added:       Send("ASC 0x...}") to allow hex value.
- Fixed:        The Clear() method on a COM Error object would cause the COM Errorhandler to stop functioning.
- Fixed:        Bogus error messages on long lines when a COM Error handler is used
- Fixed:        A lot of typo and grammar in Doc.
- Fixed:        IniReadSection Invalid lines (Those without proper key=value pairs) would cause the returned data to be wrong. These lines are now stripped. (by Valik)
- Fixed:        IniReadSection comments were not stripped on Windows 95/98/ME.  (by Valik)
- Fixed:        Wrong PID type return by ProcessList.
- Added:       Some information in GUIGetMsg about control hovering.
- Added:        List Box can be colored with GUICtrlSetColor and GUICtrlSetBkColor.
- Added:        SplashTextOn return the handle of the splash window.
- Fixed:        TRayItemGetState memory leak.
- Fixed:        FileWrite of a binarystring return false.
- Fixed:        @AutoItVersion bad return when compiled file is resource hacked.
- Updated:    v1.62 (2 June 2006)
- Fixed _ClipPutFile() example include statement. (RazerM)
- Doc Fixes:
   _GUICtrlListViewEnsureVisible. (gafrost)
   _FileReadToArray. (CyberSlug)
   - Fixed _Now() which was returning "tt" at the end (JdeB)

3.1.1.125 (26th May, 2006) (beta)

- Fixed:        WinMove not handling Default keyword for W or H.
- Changed:    no more compaction of AutoIt3.exe, Au3Info.exe, AUT2Exe.exe and AutoIt3Help.exe files. Compiled script can still be compacted. (by Jon)
- Fixed:        Some doc precision about FileDelete and DirMove.
- Fixed:        RegRead, RegWrite and RegDelete coherent @error with other Reg functions.
- Fixed:        Crash AutoIt with invalid "With" .
- Fixed:        AutoIt limits doc typo.
- Removed: Exitcode 0x7ffff000-0x7fffffff are reserved for AutoIt. Exit of such code will produce a messagebox. (by Devs)
- Removed: ToolTip Centering go around. (by Valik)
- Fixed:        The documentation for ToolTip() clarifies how the center flag works and the requirements for getting an icon to display on the title row. (by Valik)
- Fixed:        GuiCtrlSetColor(), GUICtrlSetBkColor() doc can set ListViewItem and TreeViewItem. (Holger forget to update them in .72)
- Fixed:        some doc typos
- Fixed:        bad formated #include.
- Fixed:        TCPLIsten, TCPConnect, UDPSend, UDPBind not checking bad ipaddr or port.
- Fixed:        Invalid lines (Those without proper key=value pairs) would cause the returned data to be wrong. These lines are now stripped. (by Valik)
- Fixed:        Comments were not stripped on Windows 95/98/ME. (by Valik)
- Fixed:        Memory leak on GUIDelete if some pic control where used.
- Updated:    v1.61 (23 May 2006)
- Fixed _GuiCtrlListViewSort() avoiding insert/removal of spaces. (gafrost)
- Changed test in _DateIsValid() test from <1900 to <1000 to allow a startdate of 1600 used for UTC calculations. (JdeB)
- Fixed _GUICtrlListViewSort. (JPM,gafrost)
- Added _ClipPutFile() to misc.au3. (Piccaso)
- Updated _GUICtrlListViewSetItemSelState, added an optional focus state parameter. (gafrost)

3.1.1.124 (16th May, 2006) (beta)

- Fixed:        Memory leak on object invoking error.
- Fixed:        StringRegExp returning string instead of array  withy flag=1.
- Fixed:        AutoItSc.bin size.
- Fixed:        GUICtrlSetImage for 16x16 icon not repainting.
- Added:       Some doc precision about running under a Windows 64-bit Edition.
- Changed:    Exitcode 0x7ffff000-0x7fffffff are reserved for AutoIt. Exit of such code will produce a messagebox.
- Changed:    RegEnumKey and RegEnumVal return more precise @error to help diagnostic.
- Fixed:        Mouse... invalid button definition.
- Fixed:        Small precision in FileFindFirstFile doc about returning dir names too.
- Fixed:        Hyperlink in CLSID doc page.
- Fixed:        IniDelete() could create an empty file if the file did not exist.
- Fixed:        ToolTip Centering go around.
- Fixed:        $GUI_GR_RECT and $GUI_GR_ELLIPSE under win98.

3.1.1.123 (6th May, 2006) (beta)

- Changed:    Empty parameter not allowed in COM reference.
- Fixed:        GUIGetCursorInfo on listview header.
- Fixed:        Func OnAutoItExit doc typo.
- Fixed:        DllCall @error not equal 3 when function not found.
- Fixed:        exitcode 0 when AutoIt exit on fatal error should be different from 0.
- Fixed:        ubyte can be used as Array.
- Fixed:        TrayCreateItem doc precision.

3.1.1.122 (1st May, 2006) (beta)

- Fixed:        DirCreate not creating subdir on dir with read/hidden/system attributes.
- Changed:    "GUIEventCompatibilityMode" Opt removed definetly use "GUIEventOptions".
- Fixed:        FileSetAttrib, FileSetTime destroy @workingdir.
- Fixed:        Some doc typos in the "Function Notes" page. (fixed by Herewasplato)
- Updated:    Suppression of a validation of interface checking. (by SvenP)

3.1.1.121 (28th April, 2006) (beta)

- Fixed:        Some doc clarification in the "Function Notes" page. (fixed by Herewasplato)
- Changed:    doubleclick on titlebar trigger maximize/restore event.
- Fixed:        Filecopy not creating subdir under Netware shared.
- Changed:    Upx 1.25->2.00
- Updated:    v1.60 (28 April 2006)
- Updated _GuiCtrlStatusBarResize example. (gafrost)
- Added 2 variables to GuiStatusBar.au3. (gafrost)
- Fixed typo in _ArraySort. (Knight)

3.1.1.120 (21st April, 2006) (beta)

- Fixed:        FileSetAttrib doc example.
- Fixed:        WinGetProcess and ProcessExist return same pid precision.
- Fixed:        GUICreate WS_POPUP Centering.
- Fixed:        Bad Notification on end of drag when $GUI_DROPACCEPTED not set on a control.
- Fixed:        InetGet("abort") and exiting AutoIt with a download in progres now correctly stop the download immediately. (by Valik)
- Fixed:        @InetGetBytesRead Byte count could be wrong due to a race condition.
- Updated:    v1.59 (20 April 2006)
- Updated _ProcessGetPriority to use 0x0400. (Valik)
- Added _GUICtrlEditSetRECT to GuiEdit.au3. (gafrost)
- Updated Email addresses in UDF's to avoid retrieval by search engines. (JPM)

3.1.1.119 (14th April, 2006) (beta)

- Updated:    FAQ page. (by JdeB)
- Fixed:        open script in Gui concept page.
- Fixed:        FileSetAttrib return 1 on non existing file.
- Fixed:        InetGet() could block the foreground execution even when run in background mode.
- Fixed:        GUISetBKColor freezing the display.
- Updated:    Allow array to be initialized with another array in an element (see Dim doc). (by Nutster)
- Fixed:        FileOpen doc.

3.1.1.118 (6th April, 2006) (beta)

- Changed:    Example and Include files are readonly.
- Updated:    GUICtrlCreateRadio doc example. (by Smoke_N)
- Added:       An extra parameter in ControlSetText to force redraw.
- Changed:    Opt("GUIEventCompatibilityMode", ) renamed in Opt("GUIEventOptions. both OK for this beta but will dropped in .122. (by Jon)
- Fixed:        empty parameter in $cmdline.
- Updated:    v1.58 (6 April 2006)
- updated _ProcessGetPriority() to accept either a name or PID argument. (valik)
- Fixed bug in _FileWriteLine() insert mode not inserting new line. (sasdad)

3.1.1.117 (31st March, 2006) (beta)

- Added:       Value to TrayMenuMode (Option) to turn off auto radio menuitem checking
- Fixed:        GUICtrlSetState $GUI_SHOW on tab with $TCS_BUTTON style.
- Fixed:        GUICtrlCreateMonthCal positioning.
- Fixed:        ProcessWait, ProcessWaitClose, TrayTip timeout unit doc precision.
- Fixed:        CmdLine[] limited to 63 parameters.
- Updated:    "Check for Updates" (AutoUpdateIt) display the current install beta.(by strik3r0475)
- Updated:    TCPSend/TCPRecv Doc Examples. (by Larry)
- Fixed:        Bad tabitem creation when no tab defined.
- Fixed:        Bad combo disable 16-bit color under W2K.

3.1.1.116 (26th March, 2006) (beta)

- Added:        StringRegExp Tutorial (by neogia)
- Added:        DllCall :cdecl or :stdcall
- Updated:    v1.57 (19 March 2006)
- Updated : GUICtrlTreeView
- Changed _GUICtrlTreeViewExpand (Parent GUI handle no longer needed) (Holger)
- Renamed _GUICtrlTreeViewItemGetTree to _GUICtrlTreeViewGetTree !!! (Holger)
- Added: _GUICtrlTreeViewGetState (Holger)
- Added: _GUICtrlTreeViewGetText (Holger)
- Added: _GUICtrlTreeViewInsertItem (Holger)
- Added: _GUICtrlTreeViewSetIcon (Holger)
- Added: _GUICtrlTreeViewSetState (Holger)
- Added: _GUICtrlTreeViewSetText (Holger)

3.1.1.115 (23rd March, 2006)(beta)

- Fixed:        For Next with boundary,stepping being a string (no conversion to  Float).
- Fixed:        AutoIt3.exe high density icon. (by Jon)
- Fixed:        GUICtrlRegisterListViewSort() and some issues while script pausing. (by holger)
- Changed:    GUICtrlRegisterListViewSort() parameters maximum are 4 - less are OK. (by holger)
- Fixed:        ControlSetText() (backchange to normal behaviour before beta 3.1.1.73) (by holger)
- Fixed:        GUISetState(@SW_UNLOCK) force repainting.
- Fixed:        Internal cleaning of Send/ControlSend(), SendKeyDownDelay =5 by default. (by Jon)

3.1.1.114 (17th March, 2006)(beta)

- Fixed:        StdxxxYyy PID reuse.
- Fixed:        RegRead MULTI_REG_SZ malformed key.
- Fixed:        Not updating anymore the official include dir. Use RemoveIcludeBeta.bat in beta\include\3.1.1 if you want to clean the official include folder.
- Fixed:        RegWrite Doc clarification.
- Fixed:        examples referring GUICtrlCreateCombo  with wrong size for Win2K SP4.
- Changed:    the default setting on Au3info so that it doesn't highlight controls. (by Jon)
- Fixed:        Some doc cleaning about cursor/arrow.
- Fixed:        StringLeft,StringRight doc typos.
- Fixed:        For Next with boundary,stepping being a string (no conversion to integer).
- Updated:    v1.56 (15 March 2006)
- Updated _GUICtrlListViewSort Helpfile example. (gafrost)
- Updated _GUICtrlCombo examples updated to proper height. (gafrost)
- Updated GUIComboau3. Added #include <GUIConstants.au3>. (andyswarbs)

3.1.1.113 (10th March, 2006) (beta)

- Fixed:    Aut2exe, Exe2Aut in .ZIP

3.1.1.112 (10th March, 2006) (beta)

- Fixed:        ObjEvent help example.
- Updated:    Aut2Exe, Exe2Aut new compression algorithm. (by Jon)
- Fixed:        FileFindFirst doc precision about wilcards.
- Fixed:        DriveMapDel /DriveMapAdd interaction.
- Fixed:        Doc optional parameter setting.
- Fixed:        GUICtrlDelete Doc remarks.

3.1.1.111 (3rd March, 2006) (beta)

- Fixed:        #include recursion depth enforced. (by Valik)
- Changed:   #include search algorithm updated to be more consistent. (by Valik)
- Added:       Documented #include search order. (by Valik)
- Updated:    Some doc precision about IsDeclared(), Assign(), Eval(). (by Valik)
- Fixed:        GuiCtrlCreatePic w=h=0.
- Fixed:        @OSVERSION for WIN_XP running under X64 edition. I hope.
- Fixed:        Hidden input control  previously associated with updown control badly displayed during reshowing.
- Fixed:        comparison case insensitive accentuated upper case.
- Fixed:        GUICreate $WS_CHILD+$WS_VISIBLE w=0 or h=0 lead to crash AutoIt.
- Updated:    v1.54 (23 February 2006)
- Added _GuiCtrlEditFind to GUIEDIT.AU3: - Find/Replace text in an Edit control. (gafrost)
- Added _FileWriteToLine to FILE.AU3: Writes text to a specific line in a file. (cdkid)
- Updated:    v1.55 (2 March 2006)
- Updated INetSmtpMail(),allow the "EHLO" to be send. (JPM)
- Added Attribute to _GUICtrlComboAddDir, _GUICtrlListAddDir. (gafrost)
- Added _GUICtrlListViewSetColumnHeaderText() to GuiListView. (gafrost)

Due to new #include search algorithm some problems can occurs with AU3Check.

3.1.1.110 (21st February, 2006) (beta)

- Fixed:        Hidden Updown control badly displayed during resizing.
- Fixed:        Extras\Check for Update (Extras\AutoUpdateIt\AutoUpdateIt.au3).
- Fixed:        Labels were not painted correctly on tab controls.

3.1.1.109 (17th February, 2006) (beta)

- Fixed:        GUICtrlSetData on listview/listviewItem bad erasing.
- Fixed:        GUICtrlCreateInput help typo.
- Fixed:        SplashTextOn centered vertically with embeded empty lines.
- Fixed:        SplashTextOn Memory Leak.
- Fixed:        GUICtrlRead menuitem checked.
- Updated:    v1.53 (16 February 2006)
- Fixed _GuiCtrlListViewDeleteItem: Listview items can't be deleted after sorting. (gafrost)

3.1.1.108 (14th February, 2006) (beta)

- Updated:    v1.52 (8 February 2006)
- Fixed typo in _ArraySearch Helpfile. (theguy0000)
- Fixed _GuiCtrlListViewDeleteItem: Listview items can't be deleted after sorting. (gafrost)
- Fixed _ArraySort Local $t decleration. (gafrost)
- Fixed _GUICtrlComboAutoComplete() move Variable definitions to the stat of the function. (gafrost)
- Fixed _GuiCtrlStatusBarCreate : corrected variable declarations in the function. (gafrost)
- Added:       Setting error and extended in InetGet for debugging. purpose. Will be documented is suitable or removed in a following beta. Just post script,error and extended you will get the explanation if any.
- Fixed:        Graphic controls should always have a transparent background.

3.1.1.107 (4th February, 2006) (beta)

- Fixed:        PixelCheckSum Doc related link.
- Fixed:        Under certain conditions, GUICtrlSetPos() could cause a label to appear as if it had been painted multiple times. (Fixed by Valik)
- Changed:    GUICtrlSetBkColor(). (by Valik)
- Updated:    v1.51 (3 February 2006)
- Changed _InetGetSource to return "" when error occurs. (erebus)
- Changed Dim to Local in GuiStatusBar.au3. (Jdeb)
- Change _GuiCtrlStatusBarSetIcon that will allow removing the icon from normal status bar. (gafrost)
- Added version at the top of each UDF file.

3.1.1.106 (30th January, 2006) (beta)

- Fixed:        Some hangups and undefined closes by using GUIRegisterMsg(). (Fixed by holger)
- Changed:   No more proceeding of Autoit's internal message procedures by default, see GUIRegisterMsg() for more infos. (by holger)
- Changed:   GUI's internal system timer, so only userdefined Timers can be 'monitored'; fixes also interacting problem between WM_TIMER-monitoring and TrayIcon-handling. (by holger)
- Changed:   GUIRegisterMsg() paramters maximum are 4 - less are OK. (by holger)

3.1.1.105 (28th January, 2006) (beta)

- Fixed:        Event functions without a method name were not called.
- Fixed:        Event function with too many declared parameters could crash script. (Fixed by SvenP)
- Added:      Event Object .Stop() method to stop receiving events (see help). (by SvenP)
- Fixed:       Typos and grammatical issues in the COM documentation.
- Updated:   Different example script in COM documentation about handling Events. (by SvenP)
- Fixed:       GUICtrlCreateObj: Keystrokes were not passed to controls that has embedded controls

3.1.1.104 (25th January, 2006) (beta)

- Fixed:        Some keystrokes are not accepted by ActiveX controls (thanx SlimShady, Svenny, fixed by SvenP)
- Added:       More Object information can now be retrieved with ObjName (see helpfile). (by SvenP)
- Fixed:        ACos() bad result.
- Fixed:        Doc typo.

3.1.1.103 ( 20th January, 2006) (beta)

- Fixed:        Call with parameters doc. (Fixed by Valik)
- Fixed:        DllStructGetPtr($struct,$i) wrong ptr returned.
- Fixed:        DllCall doc for ordinals. (Fixed by holger)
- Fixed:        GUICtrlRegisterListViewSort doc typo. (Fixed by holger)
- Fixed:        "Windows Message Codes" in appendix doc tree. (Fixed by holger)
- Updated:    v1.50 (19 January 2006)
- Added _GUIStatusBar.au3 UDF's. (gafrost, rysiora, JdeB, tonedef, eltorro)
- Added _GUICtrlComboGetList to GUICombo.au3 which retrieves all items in a combobox (Valik)
- Fixed _INetSmtpMail() parameter variable name.
- Added:       A specially formatted array can be passed to Call() and each argument in they  array will be treated as an argument to the function. See help-file for demonstration. (by Valik)
- Reverted fix in GUICtrlCreateObj to prevent crash with certain controls.
(Open bug: http://www.autoitscript.com/forum/index.php?showtopic=20530)

3.1.1.102 (18th January, 2006) (beta)

- Fixed:        @COM_EventObj doc typo. (Fixed by Valik)
- Fixed:        _INetSmtpMail() error doc.
- Fixed:        GUICtrlSetState(tabitem,@SW_SHOW) under creation bad tabitem display.
- Fixed:         Additional error number in DllCall() if "function" can not be found in the DLL. + doc. (Fixed by Holger)
- Fixed:        _INetSmtpMail() again and I hope last.
- Fixed:        Some docs.
- Updated:    v1.49 (17 January 2006)
- Fixed bug in _ArrayPush() when Direction 1 is specified. (AnnA)
- Helpfile _ArraySearch example corrected. (Valuater)
- Removed obsolete parameters from _GUICtrlTreeViewSelectItem(), Scripts need updating! (JdeB)
- Fixed : _INetSmtpMail() (by JPM).
- Updated all UDFs to get rid of any Errors from Au3Check v 1.50 will All checks enabled.
- Updated _ArrayDisplay() added Const to Byref of the first parameter. (Valik)
- Fixed bug in _PathFull when using root of a drive. (Valik)
- Fixed:        A for..in loop could fail undeserved on certain type of collections. (Fixed by SvenP)
- Fixed:        Controls created by GUICtrlCreateObj have now default window style WS_VISIBLE, so they can be seen on tabs. (Fixed by SvenP)
- Fixed:        Permanent fix of old bug 2005-10-18, related to deletion of a RichText control. (Fixed by SvenP)
- Added:       GUICtrlCreateObj now supports multiple GUIs. (by SvenP)
- Fixed:        Memory leak when GUICtrlCreateObj failed in some situations. (Fixed by SvenP)
- Fixed:        $DLG_TEXTVCENTER added to Constants.au3.
- Fixed:        SetError(), SetExtended() can return a value. (Fixed by Valik)
- Added:      GUIRegisterMsg() to modify GUI WM_Message-routines at runtime. (by holger)
- Added:      GUICtrlListViewSortRegister() to create a real sorting routine for GUI ListView's. (by holger)
- Added:      TrayItemGetHandle() to get the internal handle of tray menu items. (by holger)
- Fixed:        TraySetClick doc.
- Fixed:        cmdline /ErrorStdOut with /AutoIt3ExecuteLine. (Fixed by Valik)
- Added:       Call with parameters (Doc missing but just add parameters as needed). (by Valik)

3.1.1.101 (10th January, 2006) (beta)

- Fixed:        _INetSmtpMail().
- Added:       @COM_EVENTOBJ. (by Valik)
- Fixed:        AutoIt crash when using embedded OBJ on 2 child GUI.
- Added:       DLLCall with ordinal entry point (waiting Doc). (by Holger)
- Fixed:        Support for the COM Currency (VT_CY) datatype.

3.1.1.100 (7th January, 2006) (beta)

- Fixed:        SplashTexton Doc for opt=32.
- Fixed:        ElseIf ... Then statement not detected.
- Fixed:        TCPRecv Doc.
- Fixed:        Crash when using @IPADDRESSn and no network.
- Fixed:        Illegal #include with no error message.
- Updated:    v1.48 (7 January 2006)
- Fixed : _PathFull() 2 bugs. (by Valik)
- Fixed : _INetSmtpMail() @error 5 (by JPM).
- Fixed : _StringEncrypt error return.
- Removed:  /c command line, only /AutoIt3ExecuteLine  working.

3.1.1.99 (30th December, 2005) (beta)

- Added:      SplashTextOn opt=32 to center vertically.
- Fixed:       RegRead return right number of fields on REG_MULTI_SZ type.
- Fixed:       DLLStructSetData element overflow. (Fixed by Larry)
- Added:      DLLStruct...Data BinaryString support. (by Larry)
- Fixed:       GUICtrlSetImage on a GUI defined with $WS_VISIBLE.
- Fixed:       Fatal error $Object.ImageList.Images.Add($Array[0] & 'b').
- Fixed:       GuiCtrlSetState( ,$GUI_FOCUS) changing tab ordering. Need to create a new state $GUI_ONTOP for solving livewire problem (.93).
- Fixed:       Extra notification on first/default control after GUISetState().
- Fixed:       Allow Dragfile to any control. @GUI_DRAGFILE contain the filename to be used in the $GUI_EVENT_DROPPED.
- Fixed:       COM ref warning about doc examples.
- Fixed:       FileRead($handle).
- Fixed:       Event notification on {enter} on an edit control.
- Updated:   UDF v1.47 (30 December 2005)
- Fixed _DateTimeFormat() to return LongTime notation for $sType=0 as specified in the Helpfile. (JdeB)
- Made Subject and Body optional in _InetSmtpMail(). (PartyPooper)

BUMP you have to change script which spawn other with the /c switch. Until beta 3.1.1.99 you will get a popup telling that the /c will soon be removed for ever.  Will be removed in 3.1.1.100.

3.1.1.98 (23rd December, 2005) (beta)

- Fixed:        HotKeySet("",... return 0 + doc typo.
- Fixed:        GuiCtrlSetState( ,$GUI_FOCUS) on button repainting.
- Fixed:        _InetGetSource().
- Fixed:        ExpandVarStrings $$, ExpandEnvStrings %%.
- Fixed:        GuiSetCursor(16),GuiCtrlSetCursor(16) hide the cursor.
- Fixed:        FileInstall in a compiled GUI whose name is not .exe or .a3x.
- Fixed:        $GUI_EVENT_MOUSE firing without any mouse movement.
- Fixed:        Typo in ASCII appendix.
- Fixed:        WinWaitClose return doc.
- Updated:    UDF v1.46 (21 December 2005)
- Fixed doc for _FileReadToArray(). (LxP)
- Fixed doc and Example for _ArraySearch. (Knight)
- Fixed _ArraySearch return value in case not found to -1. (SolidSnake)
- Added _InetSmtpMail to Inet.au3. (Walkabout)

3.1.1.97 (15th December, 2005)(beta)

- Fixed:        PixelSearch for 25% regression. (Fixed by Larry)
- Fixed:        $GUI_EVENT_DROPPED @GUI_DRAGID,@GUI_DROPID.

3.1.1.96 (14th December, 2005) (beta)

- Fixed:        #include-once in main script.
- Fixed:        Drag&Drop of listviewitem onto another listview. $GUI_ACCEPTFILES has been renamed in $GUI_DROPACCEPTED.
- Fixed:        PixelSearch performance. (Fixed by Larry)
- Fixed:        Send doc about minimum key repetition= 1.

3.1.1.95 (12th December, 2005) (beta)

- Fixed:        InetGet regression from .94.

3.1.1.94 (11th December, 2005) (beta)

- Fixed:        FileRead in raw mode on error skip read block.
- Updated:    onAutoItStart and onAutoItExit in the help index.
- Fixed:        INetGetSize, INetGet @error return.
- Fixed:        Docs typo.
- Fixed:        DLLStruct... return 1 on bad array passed.
- Fixed:        GUICtrlSetPos with a Child window.
- Updated:    Windows Titles and Texts (Advanced) for "regexp=".
- Cleaned :    Old handle= in title definition. This parameter was not in the doc anymore since official release 3.1.1.
- Fixed:        Run("a.tmp") a.tmp being a compiled script.
- Fixed:        TabStop order.
- Fixed:        StringSplit("a : b + "," : ").

Update your old script 3.1.0 for handle=. In a lot case the "handle=" & $gui was not working since 3.1.1.66 due to HWnd type.

3.1.1.93 (7th December, 2005) (beta)

- Updated:   Include beta files are also stored in separate folders to anticipate no destruction of released includes as today.
- Added:      GUICtrlGetHandle(). (by Holger)
- Fixed:        DLLStruct... return 1 on error.
- Removed:  DLLStructDelete($Struct) use $Struct=0 even nothing if it is local.
- Updated:    Fatal error message if DLLCall cannot be executed.
- Fixed:        FileRead in raw mode return error.
- Updated:    DLLStructCreate can contain space.
- Fixed:        FileRead no count non empty file.
- Fixed:        Background label bad firing when overlayed by an edit control.
- Fixed:        FileOpen() doc typo.
- Fixed:        TraySetToolTip can be up to 128 with 2000/XP/2003. (Fixed by Holger)
- Fixed:        GUI updown control notification if change with keyboard.
- Updated:    Window title doc precision (not perfect).

You have to update your script using DLLStructDelete.

3.1.1.92 (2nd December, 2005) (beta)

- Fixed:        AutoIt hard crash with /AutoItExecuteScript with no file.
- Fixed:        TCPListen not registering.
- Updated:    Some precision in Hello tutorial.
- Updated:    UDF v1.45 (2 December 2005)
- Fixed _PathSplit(). Changed Dim $array[5] to Local $array[5]. (LxP)
- Updated _InetGetSource(), Remove stripping last character in return string. (w0uter)
- Fixed return value in _GUICtrlTreeViewDeleteItem when item id passed in. (gafrost)
- Updated GUI UDFs: Update Includes and Templates for use with external controls
Meaning controlID for autoit control, control hWnd for external control
Also replace all Dim statements with Local. (gafrost)

3.1.1.91 (27th November, 2005) (beta)

- Changed:    /c command line switch change to /AutoIt3ExecuteLine to allow /c to be use by the scripter in compiled scripts.
- Updated:    /AutoIt3ExecuteScript scriptfilename allow compiled script to execute script already install or just install by fileinstall.
- Fixed:        FileRead returning @error=-1 on empty file.

YOU have to change script which spawn other with the /c switch. for beta 3.1.1.99 you will get a popup telling that the /c will soon be removed for ever.

3.1.1.90 (25th November, 2005) (beta)

- Fixed:        GUICreate with WS_VISIBLE do an implicit GUISetState().
- Fixed:        ObjEvent error when function does not exist.
- Added:       FileCreateNTFSLink(). (by jpm)
- Updated:    FileRead() count optional to read the entire file. (by LxP)
- Updated:    Some doc clarification about command line switches.
- Fixed:        RunWait related link in doc.
- Fixed:        Crash Autoit Ending after not closing file open in raw mode.
- Fixed:        StdoutRead with null StdIn, Stdout, Stderr applications.
- Updated:    Some doc precision in For...Next and For...In...Next. (by JdeB)
- Updated:    UDF v1.44 (25 November 2005)
- Fixed _ReplaceStringInFile to avoid adding CRLF when missing at the EOF. (JdeB)
- Added _ProcessGetName to Process.au3. (Erifash)

3.1.1.89 (21st November, 2005) (beta)

- Fixed:        Compilation of include with #cs.

3.1.1.88 (19th November, 2005) (beta)

- Fixed:        Refreshing of dispayed tabitem after a tabitem delete.
- Fixed:        StringSplit($a," - ",1) string delimiter.
- Updated:    Some checking in uninstaller waiting JON not agressive Uninstaller. Non AutoIt include are preserved.
- Fixed:        Some doc typos.
- Fixed:        Return code from delayed function as WinWait destroyed by Adlib execution.
- Fixed:        MouseGetCursor doc example.
- Fixed:        Invalid line continuation not detected.
- Fixed:        FileInstall on same dir.
- Fixed:        GuiCtrlRead on ListViewItem doc precision.
- Fixed:        Func definition with Byref and default value.
- Fixed:        missing #ce in #include. Still Aut2Exe to be corrected too.
- Updated:    UDF v1.43 (18 November 2005)
- Fixed _DateAdd() Typo's in helpfile. (Gene)
- Updated _INetMail() with new logic to support environment variables. (JPM)
- Updated _GUICtrlListViewDeleteItemsSelected() with Test for Array. (CatchFish)
- Added a Constant to GUIList.au3 and changed all examples. (gafrost)

3.1.1.87 (7th November, 2005) (beta)

- Fixed:        @DesktopHeight/Width doc typo.
- Added:       VC8 compilation support. (by Valik)
- Fixed:        Float to Integer precision.
- Fixed:        Bad FatalError after Exit in UDF. Only the first FatalError will be displayed if any before Exit
- Updated:    Internal change in Handle value.
- Fixed:        Integer to string conversion.
- Fixed:        Crash if ObjEvent refer to a function having byRef parameter.
- Fixed:        GuiCtrlSetData can delete a specific column.
- Fixed:        memory leak on GuiDelete($tabitem with icon). (Fixed by Holger, jpm)
- Fixed:        StringMid($a,3).
- Fixed:        StringSplit($a,"").

3.1.1.86 (3rd November, 2005) (beta)

- Fixed:        String... on nonstring parameters.
- Changed:    FileClose,File... suppression of AutoIt runtime error. (Valik suggestion)

3.1.1.85 (3rd November, 2005) (beta)

- Updated:    GuiCtrlCreateGraphic default size.
- Updated:    AutoIt3Help.exe (no KeyHH.exe need)
- Fixed:        ObjEvent() doc typo.
- Updated:    Several tabular display in Doc.
- Removed:   Binary(), IsBinary() to BinaryString(), IsBinaryString().
- Updated:    String... support BinaryString variables.
- Updated:    @OSVersion = WIN_6.0(Vista?), WIN_6.1(LongHorn?).
- Fixed:        Crash on Exit Autoit after using GUICtrlCreateObj and GuiCtrlDelete on another control.
- Fixed:        Console... doc related links.
- Fixed:        Empty command line parameter (""). (Fixed by Tylo, jpm)
- Updated:    ControlSend Doc to make clearer ref to control/window.
- Fixed:        @ScriptLineNumber not significant in compiled script.
- Fixed:        FileCopy when creating subdir.
- Fixed:        ControlClick doc precision.
- Fixed:        Language->comments example.
- Fixed:        IniReadSection doc.
- Fixed:        bad var definition.
- Fixed:        Crash after GUICtrldelete of a control having the focus.
- Updated:    UDF v1.42 (2 November 2005)
- Updated _ArrayToString documentation, changed parameter order. (Josbe)
- Updated _FileList2Array: removed checking for "." and ".." from the return from FileFindNextFile(). (SolidSnake)
- Added _SetDate and _SetTime to Date.au3. (/dev/null)
- Added _StringInsert to String.au3. (Celeri)
- Fixed bug in the _GUICtrlListViewDeleteItem. (gafrost)

3.1.1.84 (18th October, 2005) (beta)

- Updated:    GUICtrlCreatePic("",... create an empty pic no more returning error. (Thank Larry, ...)
- Fixed:        Default keyword = -1 in arithmetic computation.
- Fixed:        False and False = False.
- Fixed:        Grey coloring of input/edit control when disabled.
- Updated:    Binary doc example.
- Fixed:        Crash on AutoIt exit when GUiCtrlCreateObj used with some .OCX. Temporary go around waiting SvenP correction.
- Updated:    GUICtrlCreateEdit doc to include an example to how to have a richedit control using GUICtrlCreateObj. (Fixed by kjactive)
- Fixed:        FileClose,FileFindNextFile, FileRead, FileReadLine, FileWrite, FileWriteLine, PluginClose, DllClose return 0 on bad handle.
- Fixed:        Bad index when opening help thru Scite editor.

3.1.1.83 (11th October, 2005) (beta)

- Removed:   MsgBox, SplashTextOn and TrayTip text convert binary string to hex for display. (Valik disagree)
- Updated:    UDF v1.41 (10 October 2005)
- Fixed BUG in _ReplaceStringInFile() always replacing multiple occurences on a single line. (Wooltown/LxP)
- Added _GUICtrlListSelectIndex to GuiList.au3 for single select listbox's. (gafrost)

3.1.1.82 (10th October, 2005) (beta)

- Fixed:        FileCopy, FileInstall, DirCopy, FileMove replacing the same file.
- Fixed:        DllStructCreate no more case sensitive but still space sensitive.
- Fixed:        AutoIt Crash when creating a control on a minimized window.
- Added:       MsgBox, SplashTextOn and TrayTip text convert binary string to hex for display.
- Fixed:        TCPSend, UDPSend really send Binary strings (I hope). (Sorry VicTT)
- Fixed:        GUICtrlSetImage icon.
- Updated:    UDF v1.41- (10 October 2005)
- Added _GUICtrlListSelectIndex to GUIList.au3. (gafrost)

3.1.1.81 (7th October, 2005) (beta)

- Fixed:        Some doc typos.
- Fixed:        Reg... functions on IA64/X64.
- Fixed:        FileFindFirstFile() leak handles.
- Fixed:        @IpAddress when not network installed.
- Added:       TCPSend, UDPSend can send Binary strings.
- Updated:    UDF v1.40 (5 October 2005)
- Fixed error in _ArrayToString example. (/dev/null)
- Changed _WeekNumberISO() to return the proper ISO weeknr.
Also removed startday parameter because ISO weeks always starts on Monday.
- Added _DateToDayOfWeekISO which returns the ISO day number. 0=Monday - 6= Sunday
- Updated:    UDF v1.39 (27 September 2005)
- Updated _InetGetSource. (w0uter)
- Fixed:        AutoIt crash on GuiCtrlCreateObj with bad object.
- Fixed:        ObjEvent returns "" on error.
- Fixed:        _GUICtrlListViewDeleteAllItems (Fixed by gafrost)
- Restriction : ControlListview cannot reference a 64-bit process as Explorer.

3.1.1.80 (29th September, 2005) (beta)

- Fixed:        Bad autoit-v3.1.1.79-beta-Setup.exe due to MS spyware which destroy the NSIS.

3.1.1.79 (28th September, 2005) (beta)

- Fixed:        Reference to AutoIt functions in UDF doc.
- Fixed:        UDPRecv regression.
- Fixed:        Tabitem icons.
- Fixed:        Listview sorting with using styles: $LVS_SORTASCENDING and $LVS_SORTDESCENDING.
- Fixed:        @ProcessorArch on 64-bit Windows.
- Fixed:        StringLen(integer) returning 0.

3.1.1.78 (27th September, 2005) (beta)

- Fixed:        Real merging of Holger .77 submission. I just update the history!!! (Sorry Holger)

3.1.1.77 (26th September, 2005) (beta)

- Fixed:        Binary, Isbinary in tree doc.
- Fixed:        Binary on nonstring variable.
- Added:       Hex() support binary.
- Updated:    DriveGetDrive, DriveGetType, DriveSpaceFree, FileGetTime, WinGetClassList, WinGetClientSize, WinGetPos does not return 1 on error but 0 or "".
- Fixed:        TCPRecv regression.
- Fixed:        StringRegExpReplace regression.
- Fixed:        Memory overflow in customdraw operations in GUI while scrolling. (Fixed by Holger)
- Added:       icons for tab items. (by Holger)
- Added:       set bold font/painting for treeview items. (by Holger)
- Updated:    UDF v1.38 (26 September 2005)
- Fixed GUICtrlTreeViewDeleteItem() selection logic. (gafrost)
- Fixed GUICtrlTreeViewSelectItem() but removed Helpfile info because function is obsolete. (gafrost)

3.1.1.76 (23rd September, 2005) (beta)

- Fixed:        Toggle AU3 Beta underscore.
- Fixed:        FileOpen,FileMove Doc typos.
- Updated:    GUI... optimisations. (By gafrost)
- Fixed:        bkcolor label on tab if ListViewItem.
- Changed:   No more minimum size with GUICreate.
- Fixed:        $SS_CENTERIMAGE on pic control.
- Removed:   Added 1 to the result of \# to compensate for the fact that c-strings are 0-based and AutoIt strings are 1-based. (by Nutster)
- Fixed:        bug in line continuation inside strings. Line continuation now disabled inside strings. Use string concatenation instead. (Fixed by Nutster)
- Updated:    Optimize internal  trailing and leading (by Nutster)
- Changed:   Now strips all whitespace if a line is made entirely of whitespace, instead of aborting the function. (by Nutster)
- Updated:    GUISwitch doc precision.
- Updated:    Internal split of AutoIt and UDF helps.
- Fixed:         FileReadLine with line=0.
- Added:       Binary, isBinary Functions.
- Updated:    FileRead, FileWrite binary files, just read and write
- Changed:   TCPRecv, UDPRecv  removed Flag as a Binary string will be generated if needed.
- Updated:    UDF v1.37 (20 September 2005)
- Added _FileWriteFromArray() to file.au3. (jdeb)
- Updated _InetGetSource. (w0uter)
- Updated _TempFile with optional parameters. (hansh)
- Fixed documentation for _FileListToArray. (mlazovjp/Dickb)
- Some code optimization changes: GuiList, GuiTreeView, GuiEdit (gafrost)
- Fixed logic issue with _GUICtrlListViewSetColumnOrder and _GUICtrlComboGetEditSel. (jdeb)
- Fixed a few minor documentation issues.

Outstanding bugs: Regular Expression: "(?i)<(.+?)>(.*?)</\1>" not matching properly.

3.1.1.75 (9th September, 2005) (beta)

- Fixed:        StringRegExp doc (Sorry Nutster I miss it)
- Fixed:        SendKeyDelay, SendKeyDownDelay when  no shift required.
- Fixed:        @HotKeyPressed added to macro doc.
- Added:       Fileopen, FileCopy, FileMove additional flag to create non existent subfolder. (by Holger)
- Fixed:        Bad GuiCtrlSetResizing when not first show has occured.

3.1.1.74 (7th September, 2005) (beta)

- Added:        TCPRecv,UPDRecv optional parameter to convert received data in Hex.
- Fixed:         _StringToHex, _HexToString return error. (Fixed by jpm)
- Updated:     RegRead doc.
- Fixed:         Plugins for AU3_SetString. (/dev/null/Jon)
- Added:       ContinueCase to keywords allowed after IF. (by Nutster)
- Changed:    Set _ to be a continuation character only after whitespace. It does not matter if a comment follows the continuation character or not. \ is not a continuation character. (by Nutster)
- Added:       Switch, EndSwitch, ContinueCase, Default to list of keywords in documentation file. (by Nutster)
* Update :      regular expression classes to match those in use by other regular expression engines. Added blank, graph, print, cntrl classes. (by Nutster) (MISSING DOC)
- Fixed:        bug in zero-count predictor that prevented characters from matching properly if skipped. (by Nutster)
- Changed:   Added 1 to the result of \# to compensate for the fact that c-strings are 0-based and AutoIt strings are 1-based. (by Nutster)
- Fixed:        bug that prevented pattern "^$" from matching an empty string. (by Nutster)
- Fixed:        listview repainting on tab.
- Updated:    UDF v1.36 (5 September 2005)
- Updated _DateTimeFormat: Added option 5 which returns time in 24 hour HH:MM:SS format. (jdeb)
- Updated _NowTime: Added optional parameter to select the return format. (jdeb)
- Fixed Documentation _MouseTrap() (JPM)
- Fixed _GUICtrlTreeViewDeleteItem bug in delete of item after adding child items. (gafrost)
- Updated _StringToHex() and _HexToString() error testing. (JPM)
- Updated Doc return Value formating. (JPM)

3.1.1.73 (2nd September, 2005) (beta)

- Fixed:        For...In...Next doc example.
- Fixed:        @SW_TRAY... doc removal.
- Fixed:        GuiCtrlCreateIcon icon size in multiple icon .ico file
- Fixed:        Send("{SHIFTDOWN}") , ... before Jon reanalysis.
- Fixed:        ControlSetText not refreshing group control.
- Updated:    Slight doc precision.
- Updated:    RegEnum... doc examples.
- Fixed:        Pic control size inside a group control.
- Updated:    UDF v1.35 (31 August 2005)
- Fixed _IsPressed Example. (gafrost)

3.1.1.72 (30th August, 2005) (beta)

- Added:       separate colors for listview/treeview items. (by Holger)
- Updated:    Gets more exactly position for contextmenu for listview/treeview items. (by Holger)
- Fixed:         a small flickering bug in CtrlSetImage() for treeview items. (Fixed by Holger)
- Changed:    TraySetState() optional parameter values. (by Holger)
!!! Breaks current beta scripts if used TraySetState(x) with optional parameter !!!
- Fixed:        GuiCtrlSetPos, GuiCtrlSetResizing use visible window.
- Fixed:        Crash on rightclick on treeview or listview. (Fixed by Holger)
- Removed:   @UserFuncName to much overhead for simple script constraint. (By Jon)
- Added:       PluginOpen, PluginsClose. (By Jon)
- Updated:    UDF v1.34 (30 August 2005)
- Fixed _ArraySearch example to point to Array.au3.
- Updated _IsPressed Added optional param to function for those that will use
the function heavily they can pass a handle to the function for the dll. (gafrost/w0uter)

3.1.1.71 (28th August, 2005) (beta)

- Fixed:        GuiGetMsg returning on Input control change.
- Fixed:        GUICtrlCreateInput/Edit forcing WS_TABSTOP when ES_READONLY.
- Fixed:        Exit inside UDF.
- Fixed:        Resizing of controls dynamically created.
- Updated:    Some clarification on return value = none.
- Added:      @UserFuncName useful for debugging. (by Kurt aka /dev/null)
- Updated:    UDF v1.32 (28 August 2005)
- Added _IsPressed (Ezzetabi/Jon)
- Updated Corrected return value for _MouseTrap if no params passed. (gafrost)
- Added _GUICtrlComboAutoComplete (gafrost)
- Restored correct example for _GUICtrlListViewGetItemText (jdeb)
- Added _ArrayPush to Array.au3 (hgeras)
- Added _ArraySearch to Array.au3 (SolidSnake)
- Added _ReplaceStringInFile to File.au3 (\dev\null)
- Updated:    UDF v1.33 (28 August 2005)
- Updated _ProcessGetPriority script logic and fixed example. (MSLx Fanboy)

3.1.1.70 (26th August, 2005) (beta)

- Fixed:         GUI click return position(bad correction). (sorry Holger)

3.1.1.69 (26th August, 2005) (beta)

- Updated:    GuiCtrlSetImage doc for Treeview/Listview. (by Holger)
- Updated:    Doc typos BitRotate doc.
- Fixed:        GuiCtrlCreateCombo and $CBS_DROPDOWNLIST color.
- Fixed:        GuiCtrlCreateDate and $DTS_UPDOWN.
- Fixed:        GUI click return position. (Fixed by Holger)
- Updated:    Internal code mainly keyword. (by Jon)
- Fixed:        HWND string concatanation. (Fixed by Valik)
- Fixed:        Au3Info dispalying styles (Bad update at icon change)
- Fixed:        GuiCtrlCreateTreeView doc example.
- Updated:    UDF v1.31 (13 August 2005)
- Updated _MouseTrap (gafrost)
- Updated _GUICtrlEditScroll: Added $SB_SCROLLCARET - Scrolls the caret into view. (gafrost)
- Added _ProcessGetPriority to Process.au3 (MSLx Fanboy)
- Added _FilePrint to File.au3 (Erifash)

3.1.1.68 (12th August, 2005) (beta)

- Fixed:        FuncOnAutoItExit typo.
- Updated:    UDF v1.30
- Fixed _DayValueToDate() to return Day and Month in the proper format.
- Fixed _DateTimeFormat() to return HH:MM in proper 24 hour notation for $sType=0.
- Added:       BitRotate function. (By Nutster)
- Fixed:        direction in BitShift documentation. (By Nutster)
- Updated:    Made regular expression patterns \n and \r distinct in StringRegExp and StringRegExpReplace. Old \n became \N.
- Updated:    Internal code. (by Nutster)
- backup :     Aut2Exe allowing .a3x  with old logo.

3.1.1.67 (11th August, 2005) (beta)

- Fixed:        _ArrayReverse example typo. (Fixed by gafrost)
- Fixed:        StringSplit doc clarification.
- Fixed:        lexer cache. (by Nutster)
- Fixed:        Fixed bug (again) in AutoItSetOption to the definition of MouseClickDragDelay. (Fixed by Nutster)
- Updated:   Internal code. (by Nutster)
- Removed:  Check to InitScript to scan all variables in the script and make sure they are well-formed, not beginning with digits. (by Jon)
- Fixed:        InputBox left,top values when not defined.
- Fixed:        Crash when deleting an input control.
- Fixed:        BitShift, Break, BlockInput doc.
- Fixed:        FileFindNextFile return error.
- Added:      @ScriptLineNumber, @ProcessorArch
- Fixed:        MouseClick, WinFlash doc typo.

3.1.1.66 (5th August, 2005) (beta)

- Fixed:        MouseClickDelay option. (Fixed by Nutster)
- Added:      Check to InitScript to scan all variables in the script and make sure they are well-formed, not beginning with digits. (by Nutstser)
- Updated:    Documentation for StringRegExp. (by Nutster)
- Changed:    Simplify StackStructure(internal). (by Nutster)
- Fixed:         GuiGetCursorInfo primary/secondary under nonXP. (Fixed by Holger)
- Fixed:         GuiCtrlSendMsg, TraySetState doc link.
- Fixed:         Obj returning handle. (Fixed by SvenP)
- Added:       $GUI_WS_EX_PARENTDRAG Allow the label or pic control to be used as the title bar to drag the whole the parent window.
- Updated:    ComRef doc.(by SvenP)
- Fixed:        Redim of array byRef parameter.
- Fixed:        GuiCtrlSetState($tabitem,$GUI_SHOW) on visible GUI.
- Fixed:        FileFindFirstFile doc.
- Updated:   New AutoIt Logo/icon. (by Jon)
- Added:      _MouseTrap() to Misc.au3. (by gafrost)
- Updated:   Internal ContinueCase perf optimisation. (by Nutster)
- Added:      _Singleton to Misc.au3. (Valik code+)
- Fixed:        ContinueCase type doc.
- Fixed:       _GUICtrlListViewSort if no items in listview.
- Added:     HWnd and IsHWnd functions. (By Valik)

3.1.1.65 (28th July, 2005) (beta)

- Added:    Silent beta install no messagebox warning.
- Fixed:      Decompiler (beta) link.
- Added:    FileSaveDialog, FileOPenDialog with multiple filter groups. (by Holger)
- Fixed:      Weird behavior when resizing column of listview on a tab.
- Fixed:      _ArrayReverse_ doc.
- Added:    Extra page in the uninstaller to clean all AutoIt installations. (for Valik)
- Fixed:      Default keyword check for third parameter of MsgBox. (Fixed by Nutster)
- Added:    Switch, EndSwitch structure. (by Nutster)
- Added:    ContinueCase keyword to have a case in Select or Switch continue executing in the next case. (by Nutster)

3.1.1.64 (25th July, 2005) (beta)

- Updated:    FileInstall doc precision.
- Fixed:        GuiGetCursorInfo() doc.
- Fixed:        Run 4th parameter validity. (By DaveF)
- Added:      GUISetState(@SW_LOCK/@SW_UNLOCK)  to manage repainting.
- Fixed:        Crash in ObjEvent() if Event Interface could not be found.
- Fixed:        Crash in ObjName() if description could not be found. (Fixed by SvenP)
- Added:      _GUICtrlListViewCopyItems to GUIListView.au3. (gafrost)
- Fixed:        _INetGetSource source/doc.
- Updated:    Exe2Aut.exe works for any version .exe or .a3x. (By Jon)
- Added:      Icon-View in GUI-ListView. (By Holger)
- Fixed:        GuiCtrlSetData flickering.

3.1.1.63 (22nd July, 2005) (beta)

- Removed:    Assign respect Opt("MustDeclareVars",1).
- Fixed:          IsBool() doc.
- Fixed:          GuiCtrlSetPos lead to a bad resizing.
- Added:        ObjName() function. Returns the name or the interface description for the given Object variable. (By SvenP)
- Fixed:          Object reference leaks in ObjEvent(). (By SvenP)
- Fixed:          _GUICtrlListViewGetCurSel() returns.
- Fixed:         Creation of item on non selected GUI.

3.1.1.62 (20th July, 2005) (beta)

- Fixed:        _GUICtrlListViewDeleteItemsSelected()
- Fixed:        ObjCreate bad link in doc.
- Fixed:        @NumParams destroyed after UDF call.
- Fixed:        Control Creation on an active tab (GUISwitch).
- Fixed:        StringRegExp's group parentheses identification routine. A \( immediately followed by \) (or vice-versa) inside a group would cause problems. (Fixed by Nutster)
- Added:       class identification to StringRegExp. See documentation file for details. (By Nutster)
- Fixed:        InputBox width not working.
- Fixed:        GuiSetCoord typo
- Fixed:        Obj/COM Error Handling example
- Added:      IsBool() functions. (By Nutster)
- Updated:    UDF v1.28
- Fixed _INetGetSource.au3 example (W0uter)
- Fixed _FileReadToArray(): added StringStripCR to avoid @CR characters in the Array values. (jdeb)
- Fixed _GUICtrlListViewDeleteItemsSelected was not working correctly (gafrost)

3.1.1.61 (17th July, 2005) (beta)

- Updated:    String...() examples. (By Nutster)
- Fixed:        Doc related links.
- Fixed:        GuiCtrlSetImage repainting.
- Fixed:        InputBox, MsgBox default parameter. (Sorry Nutster for the bad modif I did to your code)
- Added:      ConsoleWriteError(). (By Valik)
- Added:      UDFs v1.27 (By JdeB/gafrost)
- Added _Radian() and _Degree() to Math.au3 (Erifash)
- Added _FileList2Array.au3 to File.au3 (Solid)
- Added _INetGetSource.au3 to Inet.au3 (W0uter)
- Fixed documentation for _ArraySort() (jdeb)

3.1.1.60 (16th July, 2005) (beta)

- Fixed:        GUICtrlSetData with float value.
- Changed:   Opt, InputBox, MsgBox can use default keyword (By Nutster)
- Added:      Aut2Exe small compile file .A3X. (by JON, yes sometime he writes code, in fact very good one)
- Added:      @AUTOITPID macro. (By Valik)
- Added:      ConsoleRead(). (By Dave)
- Fixed:        GUIGetCursorInfo() doc typo.
- Added:      COM properties or methods can now also be used immediately to array elements containing objects. (By SvenP)
- Added:      Usage of 'Default' keyword instead of empty arguments to COM functions (only valid if COM function supports it). (By SvenP)
- Added:      UDFs v1.25/26 (By JdeB/gafrost)
- Fixed _GUICtrlListViewGetNextItem. (gafrost)
- Fixed _GUICtrlListViewDeleteAllItems and _GUICtrlListViewDeleteItem when _GUICtrlListViewInsertItem used to populate the ListView. (gafrost)

3.1.1.59 (14th July, 2005) (beta)

- Added:     Default keyword can be used to replace -1 in AutoIt Functions call.
- Fixed:       DllStructCreate doc typo.
- Fixed:       Com ref doc typo.
- Added:      UDFs v1.24 (By JdeB/gafrost)
- Fixed _GUICtrlListViewGetNextItem.au3 example (gafrost)
- Fixed _DateIsValid Documentation and Example.

3.1.1.58 (13th July, 2005) (beta)

- Fixed:        Repainting label modify by GuiCtrlSetData.
- Fixed:        if $a = default
- Fixed:        $a=30e-006.
- Fixed:        RegEnumVal return type in @error instead os @extended.

3.1.1.57 (12th July, 2005) (beta)

- Updated:    RegEnumVal return the type of the value in @Extended (by Holger)
- Fixed:        StringReplace("abc","","") returns 1 instead of "".
- Fixed:        Execute() doc.
- Added:      WinMove with x,y =default will not move just resize.
- Added:      IsKeyword(), default keyword can be used as parameter in a function call.
- Fixed:        GUITreeViewItem notifies wrong on first setting focus on a GUITreeView..
- Fixed:        WinSetTrans return error.
- Added:      False and Bool keywords doc.
- Fixed:        Assign not creating/assigning macro variable.
- Fixed:        Assign respect Opt("MustDeclareVars",1).
- Fixed:        GUICtrlCreateObj() no longer closes the object after the control (or GUI) has been deleted. (Fixed by SvenP)
- Updated:   GuiCtrlRead with Checbox, Radio, doc precision.
- Fixed:        Redeclare of local variable.
- Fixed:        Prevent Assign from assigning to a constant. (Fixed by Nutster)
- Fixed:        Crash Autoit in FileFindFirstFile on empty dir.
- Fixed:        Array initialised as empty.
- Added:      UDFs v1.23 (By JdeB/gafrost)
- Updated _TimetoTicks: Make parameters optional defaulting to current time (slimshady)
- Corrected Example for _GUICtrlTreeViewGetParentHandle (gafrost)
- Fixed _StringEncrypt parameter redeclaration
- Added _GUICtrlTreeViewGetParentID to GuiTreeView (gafrost)

3.1.1.56 (5th July, 2005) (beta)

- Updated:    GuiGetCursorInfo doc.
- Updated:    SplashImageOn, SplashTextOn doc.
- Fixed:         Ping better return results. (Fixed by Holger)
- Updated:    Authors contributions.
- Updated:    UDPOpen, UDPBind return an array. UDPSend, UDPRecv use it instead of the socket/ip/port. (by /dev/null)
- Updated:    RegRead return the type of the value in @Extended
- Fixed:        Window Titles and Text (Advanced) links doc
- Fixed:        Mouse... returns.
- Fixed:        MouseClick, MouseUp bad behavior.
- Changed:   Split Eval()->Execute()
- Fixed:        FileFindFirstFile does not return anymore "." or "..".
- Fixed:        _GuiCtrlTreeView examples. (Fixed by gafrost)
- Added:      _GUICtrlTreeViewGetParentHandle(). (by gafrost)
- Fixed:        variables already declared in string.au3 (Fixed by jdeb)
- Fixed:        Crash in tray functions

3.1.1.55 (27th June, 2005) (beta)

- Fixed:       ControlCommand  "GetCurrentSelection".
- Added:     SetError setting optionally extended code.(by Valik)
- Fixed:       GUICtrlCreateObj doc (Sorry SvenP I miss it)
- Fixed:      bug in ByRef/Const keyword use in UDF's. (Fixed by Nutster)
- Fixed:      bug in UDF calling which allowed a trailing comma.  (Fixed by Nutster)
- Fixed:      Prevent constants from being used to initialize themselves in CONST keyword.  (Fixed by Nutster)
- Fixed:      bug in Const init.  (Fixed by Nutster)
- Fixed:      bug in Const array init.  (Fixed by Nutster)

3.1.1.54 (26th June, 2005) (beta)

- Fixed:      Send("+{end}").
- Fixed:      Issues in GUICtrlCreateObj() concerning 'document objects'. Document objects are now working in a GUI, however not all functions have been implemented yet. (Fixed by SvenP)
- Fixed:      Some more issues when assigning object references to other object's properties. (Fixed by SvenP)

3.1.1.53 (25th June, 2005) (beta)

- Fixed:      Several issues in GUICtrlCreateObj(). (Fixed by SvenP)
- Fixed:      TCPRecv returning error(2) (Fixed by Larry)
- Added:    Assigning Object variables to other Objects properties ('propputref') (By SvenP)
- Fixed:      Object reference count bug in ObjCreate() since version 3.1.1.33. Objects would stay open after releasing their variable (Fixed by SvenP)
- Removed: bug in Const keyword to UDF parameters. (Waiting Nutster correction)
- Updated:  UDP functions now UDPSend need the ip:port. Doc examples (By /dev/null)

3.1.1.52 (24th June, 2005) (beta)

- Fixed:      UDPBind, UDPOpen return socket
- Added:    UDPStartup, UDPShutdown
- Fixed:      GUIListView GUITab Const
- Fixed:      File...Dialog browse through links
- Fixed:      Send("{SHIFTDOWN}") no permanent
- Fixed:      TCPRecv() returning more error (Fixed by Larry)

3.1.1.51 (23rd June, 2005) (beta)

- Updated:    TCPSend, TCPRecv examples (erifash/Larry)
- Added:       Const keyword to UDF parameters.
- Fixed:         Treeview painting under OS <XP (Fixed by holger)
- Fixed:         Listview extend style in GuiConstant.au3 and in Doc.
- Updated:    UDFs 1.21 (By JdeB/gafrost)
- Fixed Dim for $h_Tree in _GUICtrlTreeViewItemGetTree. (gafrost)
- Added variable passed in to _GUICtrlTreeViewItemGetTree and changed example to reflect this change for separator char. (gafrost)

3.1.1.50 (20th June, 2005) (beta)

- Updated:     UDFs 1.20 (By JdeB/gafrost)
- Removed the following functions from GuiListView.au3: (gafrost) _GUICtrlListViewSetBkColor _GUICtrlListViewSetTextBkColor _GUICtrlListViewSetTextColor
- Fixed _GUICtrlTreeViewDeleteItem() to deleted more than 2 levels deep. (gafrost)
- GUICtrlTreeView.au3 UDF's (gafrost)

3.1.1.49 (20th June, 2005) (beta)

- Added:        $COLOR_... in <Constants.au3>
- Updated:     GuiSwitch tabitemID optional parameter to allow dynamic control creation on a tabitem.
- Fixed:         TraySetOnEvent, DLLStructCreate, DllCall, UDP...doc.
- Fixed:         Make sure that declaring a UDF parameter in a Local or Global statement will raise an error.
- Fixed:         Bug with accelerator keys (Alt+...) and tabs.

3.1.1.48 (15th June, 2005) (beta)

- Fixed:         GuiGetCursorInfo with nonactive GUI
- Removed:   Bad refresh on double GUICtrlSetPos : AutoBuilder cannot resize control. Cannot work around a Windows bug.
- Added:       Support for Type Libraries that don't register themselves using version 1.0 (like Crystal Report version 8.0) (By SvenP)

3.1.1.47 (14th June, 2005) (beta)

- Fixed:         GuiCtrlSetState disable on hidden control tab
- Fixed:         Send("+{END}t)
- Added:       GuiCtrlSetImage for GuiListViewItem control (By Holger)
- Updated:    Internal optimisation in AutoItSetOption() (By Nutster)
- Fixed:        TrayItemGetText return
- Updated:    GuiCtrlSetColor, GuiCtrlSetBkColor, GuiCtrlSetImage for ListviewItem control. (by Holger)
- Added:       Option to ObjEvent to retrieve the name of the current Error Handler function (By SvenP)
- Added:       Preliminary GUICtrlCreateObj() support (bugware !). (By SvenP)

3.1.1.46 (10th June, 2005) (beta)

- Changed:    Opt() with just the "option" return the current value.
- Fixed:         Opt("GUIDataSeparatorChar",...) can be used in listview and listviewitem.
- Fixed:         ContextMenu position
- Updated:    UDFs 1.19 (By JdeB/gafrost)
- Fixed some merge issues.

3.1.1.45 (9th June, 2005) (beta)

- Fixed:    Internal change in array updating  bad merge (Sorry Tylo)
- Fixed:    GuiCtrlSetState on control tab
- Fixed:    Tray/contextmenu treeview ... (Fixed by Holger)
- Updated:    UDFs 1.18 (By JdeB/gafrost)
- Fixed descending sort issue in multi dimension arrays.
- Fixed _GUICtrlListViewSort() top handle numeric values correctly. (gafrost)
- Renamed _GUICtrlListViewGetColumnOrderArray to _GUICtrlListViewGetColumnOrder
Also corrected documentation for _GUICtrlListViewGetColumnOrder.
Returns a "|" delimited string instead of an array, now matches
the _GUICtrlListViewSetColumnOrder in the data type. (gafrost)

3.1.1.44 (7th June, 2005) (beta)

- Fixed:    Crash using ContextMenuItem under NT4.
- Added:   requested Regular Expression features: (by Nutster)
a) Add \-, \], and \^ to available escaped characters in sets.
b) Add \b for backspace to sets and to regular escaped characters.
c) Add \D, \S, and \W to be compliments of \d, \s and \w.
d) Add \e to match escape character.
e) Add (?: ... ) to be a non-capturing group. That is the group does not get stored in the array.
f) Add (?i) option to make case-INsensitive match
g) Add (?-i) option to use case-sensitive matching (default)
h) Add (?i: ... ) to be a non-capturing, case-insensitive group
i) Add (?-i: ... ) to be a non-capturing, case-sensitive group
- Added:    Floor and Ceiling function (by Nutster)
- Updated:  UDFs 1.17 (By JdeB/gafrost)
- Added _GUICtrlSliderGetPos functions in GUISlider.au3 (gafrost)
- Fixed _ArraySort lockup Bug.

3.1.1.43 (5th June, 2005) (beta)

- Fixed:    uninstaller deleting AutoIt Window info link.
- Fixed:    Crash when using Obj

3.1.1.42 (3rd June, 2005) (beta)

- Fixed:    GuiCtrlSetData on inactive tabitem not refreshing active item.
- Fixed:    ControlSend (...,"{CTRLDOWN}b{CTRLUP})
- Fixed:    _ArraySort (by JdeB)
- Fixed:    ControlSend doc on "Windows control command"/game
- Fixed:    Internal change in Array updating (Fixed by Tylo)
- Updated:    UDFs 1.16 (By JdeB/gafrost)
- Fixed _ArraySort to cope with Mixed values and string entries.
- Added _GUISlider??? functions in GUISlider.au3 (gafrost)

- Added _GUICtrlListViewInsertColumn, _GUICtrlListViewInsertItem, _GUICtrlListViewJustifyColumn,

_GUICtrlListViewSetColumnOrder, _GuiCtrlListViewSetItemCount, _GUICtrlListViewSort (gafrost)

3.1.1.41 (27th May, 2005) (beta)

- Fixed:    Doc on  @EXITMETHOD in  Func OnAutoItExit().
- Fixed:    Prevent StringRegExpReplace from replacing on a zero-character match.

3.1.1.40 (26th May, 2005) (beta)

- Added:        "OnAutoItExit" called on system shutdown or user logoff.
- Fixed:          Doc on Func OnAutoItStart(), Func OnAutoItExit(), @EXITMETHOD, @EXITCODE
- Fixed:          OnAutoItExit() call on Fatal error.
- Fixed:          Opt("GUIDataSeparatorChar", "\")
- Fixed:          TreevieItem notify when clicking a second time on the same item.

3.1.1.39 (23rd May, 2005) (beta)

- Fixed:        GuiCtrlSetState on non active tab.
- Updated:    UDFs 1.15 (By JdeB/gafrost)
- Added 2 Functions to GuiListView.au3: _GUICtrlListViewSetItemSelState and _GUICtrlListViewSetItemText (gafrost)
- fixed type in _GUICtrlListViewGetExtendedListViewStyle helppage.
- fixed typo in _ViClose helppage.

3.1.1.38 (22nd May, 2005) (beta)

- Updated:    UDFs 1.14 (By JdeB/gafrost)
- Fixed _GUICtrlListGetSelItems: returned array, was an array of string numbers now an array of numbers. (gafrost)
- Fixed _GUICtrlListViewGetSelectedIndices returned array, was an array of string numbers now an array of numbers. (gafrost)
- Updated _GUICtrlListSetHorizontalExtent documentation. (gafrost)
- Fixed:        Some flickering in GUICtrlSetImage.

3.1.1.37 (21st May, 2005) (beta)

- Fixed:    Creating an Object on a remote computer failed under alternate credentials. Fixed. The username/password arguments are now available to ObjCreate(). (Fixed by SvenP)
- Fixed:      GUIListView.au3 defining _GUICtrlListViewColumnOrderArray (Fixed by JdeB/gafrost)

3.1.1.36 (19th May, 2005) (beta)

- Fixed:         DllStructGetSize badly reinserted.
- Fixed:         StringRegExp doc (Fixed by Nutster)
- Updated:    UDFs 1.13 (By JdeB/gafrost)
- Added _GUICtrlListViewSetCheckState (gafrost)
- Fixed _GUICtrlListViewGetCurSel: If more than 1 item in listview had same data was returning
the index of the 1st instance, now correctly returns the index of item selected. (gafrost)
- Added _GUICtrlMonthCal???? function located in GuiMonthCal.au3 (gafrost)

3.1.1.35 (19th May, 2005) (beta)

- Fixed:     DllStructGetSize badly remove.
- Fixed:    Some doc Typo.

3.1.1.34 (19th May, 2005) (beta)

- Changed:     Eval ("expression") implying hazardeous functions will be rejected.
- Fixed:          When an Object variable was placed in a return statement in a UDF, it would not be released on function exit.
- Added:        Array initialization (By Nutster).

3.1.1.33 (18th May, 2005) (beta)

- Added:        Suppression of message box on Eval with expression errors

3.1.1.32 (17th May, 2005) (beta)

- Added:    Appendix defining AutoIt3 limits.
- Fixed:      GuiCtrlSetGraphic doc typo.
- Added:    Eval("expression").
- Added:    Ability to use empty parameters in COM functions (like $Object.Method(, , ,"value"). Note that parameters ending with a comma (like $Object.Method("value", ) are not allowed!
- Added:    UDP... functions (not sure they work as I never be able to have sample true Fur!!!)
- Added:    Beep() and WinFlash() functions (By Layer)

3.1.1.31 (15th May, 2005) (beta)

- Fixed:     FOR..IN loops previously terminated a script when the given object could not be enumerated. Now, the loop will be skipped silently by default. An error can however still be caught using the AutoIt COM Errorhandler. (Fixed by SvenP)
- Added:    Ability to use a default COM Event function, in case the event names of an object are unknown (see documentation). (By SvenP)
- Fixed:    Some objects could not be created with ObjCreate() using the Dispatch interface. (Fixed by SvenP)
- Fixed:    When a COM Error Handler was created and deleted afterwards (by unassigning it's variable), AutoIt could crash when a COM Error occurs. (Fixed by SvenP)
- Fixed:    When an AutoIt script error occured within a FOR..IN loop and no COM Error handler was installed, it could crash AutoIt on exit. (Fixed by SvenP)
- Fixed:    Using an Array in COM IADS-filter methods did not work. (Fixed by SvenP)
- Removed: Ability to initialize arrays in DIM and CONST keywords.(seems to introduce regression)

3.1.1.30 (13th May, 2005) (beta)

- Fixed:        GuiGetCursorInfo on tab
- Updated:   UDFs  1.0.12 (by gafrost/JdeB)
- Added _GUICtrlListViewGetCheckedState to GuiListView. (gafrost)
- Update several Helpfile pages for the _GUI?? functions. (gafrost)
- Update _ChooseColor. (gafrost)
- Updated _Now(),_NowDate(), _NowTime that it defauts to mm/dd/yyyy and hh:mm:ss when the pc's format isn't found in the registry (Win9X).
- Fixed:        Const definition (Fixed by Nuster).
- Fixed:        GuiCtrlCreateIcon default size 32,32

3.1.1.29 (12th May, 2005) (beta)

- Fixed:        GuiCtrlSetPos on Icon control
- Fixed:        FileOpenDialog, FileSaveDialog doc on update @workingDir.

3.1.1.28 (11th May, 2005) (beta)

- Fixed:        Bad refresh on double GUICtrlSetPos
- Fixed:        extra GUI_EVENT_RESIZED at first click
- Fixed:        COM StorageGroups

3.1.1.27 (10th May, 2005) (beta)

- Fixed:        RegRead under Windows 2000
- Fixed:        Dim example

3.1.1.26 (10th May, 2005) (beta)

- Fixed:        AutoIt Info focus with magnify option
- Fixed:        DLLCall set @error on bad parameter.
- Fixed:        Windows centering of GUICreate
- Fixed:        Cmd line option cohabitation /c and /errorstdout (Fixed by SvenP)
- Fixed:        String "0" is false in boolean comparison (Fixed by SvenP)
- Fixed:        RegExp : Indicate the pattern is invalid if a closing round bracket is not found for a group.
- Fixed:        RegExp: excessive group clearing from regular expression predictor
- Added:      Ability to initialize arrays in DIM and CONST keywords.
- Updated:    docs for DIM .

3.1.1.25 (8th May, 2005) (beta)

- Updated:   UDFs  1.11 (by gafrost/JdeB)

- Added GuiEdit.au3 which has a number of _GUIEdit??? functions for Edit controls. (gafrost)
- Updated _ChooseColor, _ChooseFont and _GUI??? function due to DllStruct renaming. (gafrost)
- Corrected wParam to variable name in _GUICtrlEditLineIndex.txt   (gafrost)
- Fixed example and include for $CB_GETDROPPEDCONTROLRECT   (gafrost)
- Typo in Example: _GUICtrlComboGetEditSel.au3    (gafrost)

- Fixed:        Crash when compiling with a specified icon

3.1.1.24 (7th May, 2005) (beta)

- Removed:   DLLStruct ... functions (by Jpm)
- Merged :     DLLStructElementPtr in DLLStructGetPtr (by Jpm)

3.1.1.23 (7th May, 2005) (beta)

- Fixed:         Opt("GUICoorMode",2) doc
- Fixed:         DLLStructCreate  return error (Fixed by Ejoc)

3.1.1.22 (5th May, 2005) (beta)

- Fixed:         ChooseColor and _ChooseFont doc (Sorry JdeB : bad merging).
- Fixed:         FileOpenDialog, FileSaveDialog,  HotKeySet doc
- Fixed:         StringInStr return 0 when searching for ""
- Changed:    GUICtrlSetGraphic default colors(black, transparent)
- Added:       GUICtrlSetGraphic bkColor : $GUI_GR_NOCOLOR
- Added:       DLLStructElementPtr (By Ejoc)
- Fixed:         duplicate formal parameters in UDF's.

3.1.1.21 (3rd May, 2005) (beta)

- Fixed:    GUICtrlRead doc  in advanced mode (Fixed by Holger).
- Fixed:    GUICtrlRead return on expanded TreeviewItem (Fixed by Holger)
- Added:  AutoIt Info Style and exStyle for the control under the mouse.
- Fixed:    MemGetStats >2Gb (Fixed by Valik).
- Fixed:    _GUICtrlComboSetHorizontalExtent.txt (gafrost)
- Added:  _ChooseColor and _ChooseFont to Misc.au3 (gafrost)

3.1.1.20 (2nd May, 2005) (beta)

- Added:      _GUITab Functions located in GuiTab.au3. (gafrost)
- Fixed:        Doc about Expand...Strings.
- Added:      Opt("GuiDataSeparatorChar",...)
- Fixed:       Return value of StringRegExp when a group is used and the user does not want the array.
- Fixed:       bug that allowed run-away recursion in CRegExp::compare_group() when a group can map to no characters. This caused a stack overflow that killed the program.
- Fixed:       Com crash

3.1.1.19 (1st May, 2005) (beta) com27/28

- Fixed:       Rewrote AutoIt3-Array to COM-Array conversion. Can now handle the total number of Array dimensions that are allowed in AutoIt3. (Fixed by SvenP).
- Fixed:       Std... doc (Fixed by DaveF).
- Fixed:       "Check for update" to reference new beta download area.
- Fixed:      GUISetFont and Input Control not displayed.
- Fixed:      Typo on GUICtrlSetFont.
- Fixed:      GUI_GR_COLOR default backcolor.
- Fixed:      GUICtrlCreateListViewItem with more field than column..
- Fixed:      GUICtrlDelete of a Listview control lead to crash after recreation with more columns.
- Added:    Unary NOT operations on strings are now allowed. A NOT operation on a non-empty string will result in FALSE.
- Changed:  Rewrote some COM documentation.

3.1.1.18 (28th April, 2005) (beta)

- Fixed:       TrayItemSetOnEvent,  TrayItemDelete doc.
- Added:     DLLStruct....
- Fixed:       GUICtrlSetState for Menu/menuitem, TrayItemSetstate (Fixed by Holger).
- Fixed:       GUICtrlSetData for list or combo not inserting.
- Fixed:       sizing/resizing of list control : not too good but window does strange think with height size.
- Fixed:       _ArrayTrim  (merge Udf 1.08).
- Fixed:       WinSetTrans doc

3.1.1.17 (28th April, 2005) (beta)

- Fixed:       Bad merge of @HOTKEYPRESSED (Sorry Holger)
- Fixed:       Date.au3
- Changed:  boolean-to-string conversion.  To stay compatible with existing expressions, a boolean false will be converted into a "0" and a boolean true into a "1".

3.1.1.16 (26th April, 2005) (beta)

- Fixed:        some doc typo
- Changed:   $GUI_EVENT_RESIZE ->  $GUI_EVENT_RESIZED no Opt.
- Fixed:        UDF udapted
- Fixed:        Boolean comparisation with integer values as rightpart argument did always return 'false'. Now it is 0->false, anything <> 0 -> true

3.1.1.15 (25th April, 2005) (beta)

- Fixed:      TCPListen min/max number of parameters (was not fixed)
- Added:    $GUI_EVENT_RESIZE with Opt("GUIEventCompatibilityMode",1).
- Fixed:      Doc on resizing
- Fixed:      Resizing of Combo control
- Changed: GUICtrlCreateList forced style LBS_NOTIFY.
- Fixed:      $GUI_NOTODAY... constants values..
- Fixed:      Run use of 3rd param when 4th par is defined.
- Fixed:      Tray/HotKeySet Doc.

3.1.1.14 (25th April, 2005) (beta) COM26 merge

- Fixed:      TCPRecv doc.
- Fixed:      TCPListen min/max number of parameters
- Added:    GUICtrlCreateMonthCal
- Fixed:      Optimized For..In loop for Arrays. It should run a bit faster now.
- Added:    Usage of COM 'default properties' is now supported.
- Fixed:      Some minor documentation changes.
- Fixed:     GUICtrlCreateTab disapearing.

3.1.1.13 (24th April, 2005) (beta)

- Changed:    UDF and UDF docs.
- Changed:    STD I/O controlled by fourth, bit-flag parameter to Run() with $STDxxx_CHILD constants.
- Updated:    doc files for Run, AutoItSetOption, StderrRead, StdinWrite, StdoutRead, macros, TOC.
- Moved :      Stdxxxyyy functions to Process Management section of docs
- Removed:   Options ProvideRunStderr, ProvideRunStdin, ProvideRunStdout.
- Changed:    Tray... to TrayItem... renaming.
- Added:      @HotKeyPressed macro.
- Fixed:        Some fixes in Tray functions.
- Fixed:        GUICtrlSetStyle(..., $GUI_SS_DEFAULT_INPUT/EDIT) (to have all forced values).
- Fixed:        GUICtrlSetStyle refresh now the window.
- Added:      TCP functions from Au3Xtra.

3.1.1.12 (21st April, 2005) (beta) COM25 merge

- Fixed:    more than 15 GUI creation
- Fixed:    Reference count problem when passing an Object variable as COM-function argument.
- Fixed:    Memory leak in COM-Array conversions.

3.1.1.11 (20th April, 2005) (beta) COM23/24 merge

- Fixed:    VC7 warnings (Fixed by  SvenP).
- Fixed:    An Object reference leak in DLLCall().
- Added:   Support for Arrays returned from COM functions.
- Fixed:     A FOR..IN loop would still start when an Array contained no elements.
- Changed: Return,@error, @extended have to be explicit to be return by an UDF

3.1.1.10 (19th April, 2005) (beta) COM22 merge

- Fixed:    When a COM method fails on variable assignment, it would silently discard the variable assigment. Changed that, so it will now produce a fatal COM-Error, unless the user has installed it's own errorhandler.
- Fixed:     Two Object reference leaks in DLLCall().
- Fixed:     Minor memory leak in line tokens of type Object.
- Fixed:     A boolean value as default value in a function declaration was not allowed.
- Fixed:     Minor memory release bug in ObjEvent().

3.1.1.9 (18th April, 2005) (beta) dev only

- Fixed:    doc @error setting, waiting Valik fixes on return @error/@extended

3.1.1.8 (17th Apr, 2005) (beta)

- Fixed:    GuiCtrlSetStyle ES_READONLY on input/edit control
- Fixed:    Arguments in COM Methods did not accept expressions or other COM Objects.

3.1.1.7 (15th April, 2005) (beta) COM20 merge

- Added:    +=, -=, *=, /= operators
- Added:    Keywords 'false' and 'true'. Currently only supported in function arguments. In other assignments they will be converted to integers.
- Added:    Full boolean support.

3.1.1.6 (14th April, 2005) (beta) COM19 merge

- Fixed:    Reference leaks in Object Enumerator.
- Fixed:    Object reference not released in ObjGet().
- Fixed:    Object references not being released in FOR..IN loops.

3.1.1.5 (12th April, 2005) (beta)

- Fixed:      Doc for "GUIEventCompatibilityMode"

3.1.1.4 (11th April, 2005) (beta)

- Changed:     Opt("GUISpecialEventMode',1) by  Opt("GUIEventCompatibilityMode',1).
- Added:        GuiCtrlRead return ControlID if Opt("GUIEventCompatibilityMode',2).

3.1.1.3 (10th April, 2005) (beta) COM18 merge

- Fixed:      Variant_Datatype ReInit() didn't release any Objects.
- Fixed:      Double backslashes are no longer required in ObjGet() filename parameter.
- Added:    idispatch_ptr support in DllCall(). (by Valik)

3.1.1.2 (10th April, 2005) (beta)

- Fixed:      TraySetIcon default id.
- Added:    right-click for List/Treeview control  (By Holger).
- Fixed:      regexp crash

3.1.1 (7th April, 2005) (Release)
- Fixed: @OSVersion did not work for Windows Server 2003
- Fixed: $LVS_EX_FULLROWSELECT in GuiConstants.au3 was defined $LBS...
- Fixed: @YDAY was incorrect (one day out)

3.1.0 (7th February, 2005) (Release)

- Added: GUI creation capabilties
- Added: DllCall(), DllOpen(), DllClose()
- Added: ControlListView()
- Added: WinList()
- Added: DirGetSize()
- Added: IniReadSectionNames(), IniReadSection()
- Added: InetGet(), InetGetSize()
- Added: HttpSetProxy(), FtpSetProxy()
- Added: FtpBinaryMode (Option)
- Added: Ping()
- Added: ControlGetHandle()
- Added: WinGetProcess() and ProcessList()
- Added: SetExtended()
- Added: WinSetTrans()
- Added: Assign()
- Added: ConsoleWrite()
- Added: @AutoItExe macro
- Added: Const keyword
- Added: Optional parameter support for user functions
- Added: "main", "primary", "menu", "secondary" added as valid mouse button types
- Added: ExpandVarStrings (Option)
- Added: The user functions OnAutoItStart() and OnAutoItExit() are called during startup/exit
- Added: OnExitFunc (Option)
- Added: (Internal) Native HWND datatype added to variants

- Removed: URLDownloadToFile() (Replaced by InetGet())

- Changed: For loops automatically declare the counter variable as a Local variable
- Changed: IniDelete() can also delete entire sections
- Changed: StringReplace() also returns the number of replacements in the @extended macro
- Changed: StringMid() the "count" parameter is now optional (assumes remainder of the string)
- Changed: PixelChecksum() now has optional step parameter
- Changed: Control...() functions now accept the Control ID as an extra way to identify a control
- Changed: InetGet() function can download in the background
- Changed: Reg...() functions no longer give a hard error when an unknown key is used.
- Changed: The mouse and pixel functions now have an additional "client area" mode
- Changed: Added WIN_2003 to the possible values for @OS_VERSION
- Changed: AU3Spy.exe renamed to AU3Info.exe
- Changed: Major upgrades to the AutoIt Window Spy (control highlighting, magnify)
- Changed: FileSelectFolder supports an initial directory as well as a root directory
- Changed: File functions no longer give fatal errors when -1 is used as a handle
- Changed: (Internal) new quicker variable lookup using a binary tree
- Changed: (Internal) new shared process memory class used for StatusBarGetText()
- Changed: (Internal) Unified structure stacks (If, Func, Select, While, Do, For)
- Changed: (Internal) Variant rewrite (now handles int32, int64, double, string, HWND data)

- Fixed: Memory leak in SplashImageOn()
- Fixed: Expressions like "$var = $var" will now give an error if the variable wasn't previously defined
- Fixed: StringFormat() with \\ characters
- Fixed: Under rare situations after closing a script AutoIt3.exe would still appear in task manager for a while
- Fixed: Certain paths like @WindowsDir were incorrect under Windows Terminal Server
- Fixed: FileSetTime() systems in non-GMT timezones had incorrect results
- Fixed: FileMove() with UNC paths (does a real move when in the same dir rather than a copy).
- Fixed: ^ operator
- Fixed: Chr()
- Fixed: StatusBarGetText() failed when used with no "Text" parameter
- Fixed: InputBox() didn't return focus to the previously active window

3.0.102 (4th August, 2004) (Release)

- Major Change: Colors now default to the standard RGB format rather than the previous BGR format.

    This affects PixelSearch, PixelGetColor.

    The "ColorMode" option has been added to allow old scripts to run with the old BGR mode, just
    place this line at the top of your script to use the old method:

    Opt("ColorMode", 1)

- Added: DriveMapAdd(), DriveMapDel() and DriveMapGet()
- Added: @SW_SHOWDEFAULT, @SW_SHOWMAXIMIZED, @SW_SHOWMINIMIZED, @SW_SHOWMINNOACTIVE,
        @SW_SHOWNA, @SW_SHOWNOACTIVATE, @SW_SHOWNORMAL
- Added: FileGetShortcut()
- Added: Predefined $CmdLineRaw variable now holds the original command line in full
- Added: @DesktopDepth
- Added: ReDim
- Added: Command line option /ErrorStdOut
- Added: More command line params for Aut2Exe.exe: /nodecompile and /comp 0-4  (compression level, 4=best)
- Added: Process ID (PID) support for Process...() and Run() functions
- Added: ProcessSetPriority()
- Added: Decompiler (Exe2Aut) added
- Added: PixelChecksum()
- Added: Strings starting with "0x" are converted from hex when used numerically
- Added: Multi-directory #include <> paths
- Added: MouseWheel()
- Added: FileRecycleEmpty()
- Added: RegEnumKey() and RegEnumVal()

- Changed: TimerStart() renamed to TimerInit().  TimerStop() renamed to TimerDiff()
- Changed: FileSelectFolder() flag parameter changed
- Changed: REG_MULTI_SZ values allow double NULL values.
- Changed: BirOr(), BitAnd() and BitXOR() take up to 255 parameters
- Changed: Icon and windowstate options added to FileCreateShortcut()
- Changed: RunAsSet() supports extra profile handling options
- Changed: RegWrite() now accepts just the keyname in order to create a keyname with no value
- Changed: "Allow Decompilation" option added to Aut2Exe
- Changed: Aut2Exe gives feedback during compilation and gives the option to abort
- Changed: Compiled scripts run/extract much faster when using FileInstall and medium/large files
- Changed: Max number of user function limits removed
- Changed: Max number of variable limits removed
- Changed: -1 does no sleep at all for Send/Mouse delays (SendKeyDelay, etc...)
- Changed: Optional occurance parameter added to StringInStr()
- Changed: Optional default filename added to FileOpenDialog() and FileSaveDialog()
- Changed: Registry functions accept 4 letters keys (HKLM instead of HKEY_LOCAL_MACHINE, etc.)
- Changed: Remote registry keys are accepted in the form "\\computername\key\subkey"
- Changed: AutoItSetOption returns the previous setting
- Changed: (Internal)  Built-in function lookups completely rewritten
- Changed: (Internal) String functions speeded up (concat in astring and variants)
- Changed: (Internal) ControlSearch modified to include the windowsearch

- Fixed: FileGetSize() works on >2GB files and in-use files
- Fixed: The expression: If "non-blank" And 1 - now evaluates as true
- Fixed: /c command line use in compiled scripts
- Fixed: ToolTip() when the mouse is near the bottom of the screen
- Fixed: StringIsDigit()
- Fixed: Process... functions under NT4 unable to see certain processes
- Fixed: Some keywords incorrectly allowed after a THEN keyword
- Fixed: (Internal) Hotkey registering logic

3.0.101 (11th March, 2004) (Release)
- Added: MemGetStats()
- Fixed: Compatibility problem under Windows 95a
- Fixed: Some minor help file typos corrected

3.0.100 (29th February, 2004) (Release)
- Added: WinTextMatchMode (Option)
- Fixed: ExitLoop and ContinueLoop failed during a recursive function
- Fixed: Sleep(0) (or < 0 ) no longer hangs
- Fixed: $ with no name was allowed as a variable
- Fixed: For Loop bug when used in recursion
- Fixed: FileGetLongName() return value
- Fixed: @UserProfileDir under 9x
- Fixed: IsDeclared()
- Fixed: Random()

3.0.94 (21st February, 2004) (Beta)

SCRIPT BREAKING CHANGES for FileReadLine and FileWriteLine:

FileWriteLine now automatically writes a DOS @CRLF pair UNLESS the last character of
the string to write is already @CR or @LF (to make it possible to write non-DOS text files)

FileReadLine will correctly read a DOS, UNIX or MAC line (@CRLF, @LF and @CR terminated respectively).

FileWrite and FileRead added to add further support.

CHANGE YOUR SCRIPTS AS FOLLOWS:

From: FileWriteLine($handle, "line" & @LF)
To: FileWriteLine($handle, "line" & @CRLF) or FileWriteLine($handle, "line")

From: FileWriteLine($handle, "line")
To: FileWrite($handle, "line")

- Added: FileWrite() and FileRead()
- Changed: FileReadLine() and FileWriteLine()
- Added: ToolTip()
- Added: Eval() and IsDeclared()
- Added: CaretCoordMode (AutoItSetOption)
- Added: WinGetCaretPos()
- Added: WinGetState()
- Added: MustDeclareVars (AutoItSetOption)
- Added: Editors page in help
- Changed: EnvSet()
- Changed: WinShow() renamed to WinSetState()  (With WinShow() as an alias)
- Fixed: Splash() and moveable flag (and -1 default flag in options)
- Fixed: Odd elseif error message showing wrong line
- Fixed: Crashes with bad function calls: MsgBox(MsgBox(MsgBox))
- Fixed: HotKey crashes when unregistering a key that was not registered

- Fixed: (Internal) WinWaitDelay, SendKeyDelay, etc type commands now more accurate (previously only accurate to 10ms (NT) or 55ms (9x))
- Fixed: (Internal) Execute() recursion limit dropped to 384 levels
- FIxed: (Internal) Calls to Util_AttachThreadInput will not attach to hung windows
- Fixed: (Internal) some RegRead/RegWrite sizing problems (Ta, Chris)

3.0.93 (12th February, 2004)
- Added: SendAttachMode (AutoItSetOption)
- Added: Opt() is an alias for AutoItSetOption() :)
- Added: Doc updates
- Added: WinSearchChildren (AutoItSetOption)
- Changed: Splash and Progress functions have a "moveable" option
- Changed: StringStripWS (new strip all ws mode)
- Changed: InputBox (timeout param)
- Changed: Hot keys are no longer buffered when the script is paused.
- Fixed: REG_MULTI_SZ support
- Fixed: TrayIconDebug not showing correct filename
- Fixed: ControlClick, ControlCommand("CHECK")
- Fixed: Control functions now using return values rather than @error where appropriate.
- Fixed: Error with '' quotes in Aut2Exe
- Fixed: StringFormat()
- Fixed: Lexer checks that potential user function calls are for existing functions
- Fixed: Input thread attachment in Send() ( check Send("{... down}") still works)

- Changed: (Internal) Removed the only sscanf call and replaced with own code - saves 4KB.

3.0.92 (6th February, 2004)

Note: Script breaking changes to ControlLeftClick(), FileFindFirstFile(), SendSetCapslockState()

- Added: Dec()
- Added: BitNOT(), BitXOR(), BitShift()
- Added: TrayIconDebug (AutoItSetOption)
- Added: Dim single-line initialization and multiple variables
- Added WinTitleMatchMode 4 (AutoItSetOption)
- Added: #comments-start and #comments-end for multiline comments
- Added: DirCopy()
- Added: DirMove()
- Added: Controls will be checked by visible text as well as classname (waves to Chris :) )
- Added: Macros: @USERPROFILEDIR, @HOMEDRIVE, @HOMEPATH, @HOMESHARE, @LOGONSERVER, @LOGONDOMAIN, @LOGONDNSDOMAIN
- Removed: SendSetCapslockState() - Use Send("{CAPSLOCK on/off}")
- Changed: FileFind works differently (handles used and multiple finds now supported)
- Changed: ControlLeftClick() renamed to ControlClick() and options added.
- Changed: Window Spy options added and ability to freeze display
- Changed: StringSplit will return each char if delimiters are ""
- Changed: WinMenuSelectItem return value
- Changed: optional variation added to PixelSearch()
- Changed: optional step value added to PixelSearch()
- Changed: FileMove() overwrite flag added
- Changed: *.* assumed if a directory is used in FileCopy/FileMove/FileDelete
- Fixed: @TempDir under certain conditions
- Fixed: Hotkeys were ignored while another hotkey function was running

- Changed: (Internal) DirRemove changed
- Changed: (Internal) Sendkeys tweaked A LOT

3.0.91 (29th January, 2004)
- Added: Options: MouseClickDelay, MouseClickDownDelay, MouseClickDragDelay (AutoItSetOption)
- Added: REG_BINARY type for RegRead() and RegWrite()
- Added: FileChangeDir()
- Added: ControlCommand() - added GETCURRENTSELECTION
- Added: Added some standard library includes (See Program Files\AutoIt3\Include\)
- Added: SendKeyDownDelay (AutoItSetOption) (alters the amount a time a key is held down before released)
- Added: AutoIt returns an exit code of 1 if script could not be loaded
- Added: FileSetAttrib(), FileSetTime()
- Added: In Au3_Spy pixel colour is also shown in hex
- Fixed: While loops failing when used in recursive functions of themselves... (!?)
- Fixed: Small line coninuation _ bug
- Fixed: URLDownloadToFile()
- Fixed: FileRecycle() not always working
- Fixed: FileRecycle() return value
- Fixed: Relative #include use
- Fixed: Smart boolean comparision re-added
- Fixed: FileFindFirst() not releasing memory when called multiple times
- Changed: FileGetTime outputs strings with leading 0s when required
- Changed: Default value of Local/Global/Dim is the String "" (equates to 0 when used as a number)

- Changed: (Internal) More scriptfile.cpp optimization
- Changed: (Internal) Execute() recursion levels limited to 512 to prevent stack overflows

3.0.90 (20th January, 2004)
- Fixed: Serious nested IF bug

- Changed: (Internal) Rollback of variabletable.cpp and stacks/vectors

3.0.89 (19th January, 2004)
- Added: Method for standard library functions and includes
- Added: #include < > support (must be fully installed to work)
- Added: #include-once directive (put at the top of a file to make sure it is only
       included once)
- Added: @UserName and @TempDir macros
- Fixed: Nasty fatal bug in 3.0.88

3.0.88 (18th January, 2004)
- Added: ElseIf
- Changed: All block structures (IF/WHILE/FOR, etc.) are now checked before execution.
- Fixed: Some single hotkeys not working
- Fixed: Better detection of illegal nesting, e.g.:
         if 1 = 1
           while 1
         endif
           wend

- Changed: (Internal) lots of error checking code removed as a nice side effect of
         initial block structure checking
- Changed: (Internal) windows string functions (lstrcmp etc) moved back to C versions
         due to massive performance penalty

3.0.87 (15th January, 2004)
- Changed: Aut2Exe stores files it can't compress (.zip etc) rather than expanding
- Fixed: Aut2Exe crashing if FileInstall used a file less than 4 bytes
- Fixed: Aut2Exe crashing with uncompressable files
- Fixed: RegRead not working correctly with large DWORD values
- Fixed: NOT fixed when skipped during a boolean expression

- Changed: (Internal) variable_table.cpp rewritten
- Changed: (Internal) All stacks/vectors replaced with templated code

3.0.86 (12th January, 2004)
- Added: Enhanced boolean comparisons
- Added: Send can hold keys down, e.g. Send("{a down}") will hold the A key down (only works usefully with games)
- Fixed: 0 ^ 0 = 1
- Fixed: on_top parameter of ProgressOn()
- Fixed: No longer hanging with blank search in StringReplace()
- Fixed: Asc() giving -1 in some cases
- Fixed: Tray icon's tip not updating when un-pausing
- Changed: Single keys of 0-9, a-z can no longer be used as hotkeys if alt,ctrl or win is NOT also used.

- Changed: (Internal) FPU assembler used for advanced math (sin,cos,pow, etc) functions due to
         exe size problems under VC7

3.0.85 (9th January, 2004)
- Added: HotKeySet()
- Added: Abs(), Sin(), Cos(), Tan(), ASin(), ACos(), ATan(), Sqrt(), Log(), Exp()
- Added: ^ operator
- Added: Round()
- Added: Call()
- Changed: IniWrite/IniDelete() return 0 if they fail
- Changed: No longer need to use virtual keys for FileCreateShortcut()
- Fixed: Return value for FileCopy/FileInstall()
- Fixed: Incorrect use of ExitLoop/ContinueLoop trapped

- Changed: (Internal) Send() tweaking
- Fixed: (Internal) Function calling/scope slightly bugged (Adlib, Hotkey)

3.0.84 (30th December, 2003)
- Added: New window WinTitleMatchMode of 3 (for exact title match)
- Added: Some more details added to helpfile
- Changed: The key # is no longer used as a delimiter but as a left Win key combination.  So
           Send("#e") now presses the left win+e keys.  I don't think anyone actually used
           it as a delimiter anyway - it was just a left over from v1 and it never made
           lines easier to read anyway
- Changed: FileReadLine() and FileWriteLine() modified so that they optionally accept a filename
           instead of a filehandle for "quick 'n' dirty" file access - I'm sure this will be
           popular :)

3.0.83 (30th December, 2003)
- Changed: Due to popular demand, by default functions now return 0 for error and 1 for success.
           This affects the following functions: FileWriteLine, CDTray, DriveSetLabel, DirCreate,
           DirRemove, FileCopy, FileMove, FileDelete, FileInstall, ClipPut, URLDownloadToFile,
           RunAsSet, Shutdown, RegWrite, RegDelete, WinWait, WinWaitActive, WinWaitClose, WinWaitNotActive,
           ProcessWait, ProcessWaitClose.  If you were using the return values of one of
           these functions then please check your scripts.

- Changed: ControlSend() supports {} (for most things at least...)

3.0.82 (29th December, 2003)
- Added: Files installed with FileInstall() now have original timestamps (created/modified)
- Added: IsNumber()
- Fixed: Number to string conversions and general float parsing

- Changed: (Internal) FileInstall() compression code updated

3.0.81
- Fixed: Yet more bugs with single line IF - regretting adding this feature already...
- Fixed: Bugs with NOT operator and the new variant code
- Fixed: Bug with clicking CANCEL on the open script window (introduced in 3.0.80)
- Fixed: StringIs... functions failing when using numbers as parameters

- Fixed: (Internal) VectorVariant modified to allow reference access to variants (instead of copying everytime)

3.0.80 (15th December, 2003)
- Changed: Number to String conversions tweaked
- Fixed: Massive bug fixed with arrays introduced in 3.0.76
- Fixed: Line continuation crash

- Changed: (Internal) script reading code updated for Aut2Exe and merged with AutoIt

3.0.79 (15th December, 2003)
- Added: Lines can be continued over many lines - use _ at the end of a line to continue it (as VBScript)
- Added: Single line IF statements possible
- Changed: Maximum line length (including total of combined lines) increased from 1023 to 4095 characters.
- Changed: "Then" keyword in IF statements no longer optional (helps with single line IFs)

e.g.
MsgBox(0, "Test", "This is some text _
    And more text _
    And even more text")

3.0.78 (15th December, 2003)
- Changed: Variants work differently - no longer a seperate INTEGER type
- Changed: Float() changed to Number()

    All numbers now 15digit precision (internal C double type)
    Also affects Random() you will get floating point numbers back unless you use Int()
        with the result

3.0.77 (30th November, 2003)
- Added: New option "TrayIconHide" (AutoItSetOption)
- Changed: "AutoIt -" prefix removed from compiled a script's tray icon
- Changed: Compiled script's file properties point to a custom web page
- Fixed: Tray icon should redraw after an explorer crash

3.0.76 (30th November, 2003)
- Fixed: Couple of bugs with ContinueLoop and ExitLoop
- Fixed: Statements like $test[$test[0]] now working

3.0.75 (30th November, 2003)
- Added: ControlGetFocus()
- Added: Local and Global keywords
- Changed: Dim (along with Local/Global) can now be used as in vbscript to declare variables
- Changed: FileOpenDialog() uses "|" as the delimiter instead of ","
- Fixed: PixelSearch()
- Fixed: SoundPlay()...maybe
- Fixed: Splash() sizing issues

3.0.74
- Added: Hex notation for integer numbers ($var = 10 or $var = 0xa)
- Added: MouseDown(), MouseUp()
- Added: TrayTip()
- Fixed: PixelCoordMode not working correctly
- Fixed: Compiled exes not producing random numbers

3.0.73
- Added: New option "RunErrorsFatal" (AutoItSetOption)
- Added: New option "ExpandEnvStrings" (AutoItSetOption)
- Changed: FileMove() moves/renames without affecting timestamps - can also be used
           for directories
- Changed: RegRead/RegWrite() now supports REG_EXPAND_SZ
- Changed: Extra options added to FileGetTime()
- Changed: Extra 250ms delay added to start and end of mouse drags
- Fixed: Odd error message fixed where a user function contained a badly formatted line

3.0.72
- Fixed: Compiler was ignoring comments near FileInstall() functions
- Fixed: Memory leak in StatusBarGetText()
- Fixed: PixelGetColor
- Added: New option "PixelCoordMode" (AutoItSetOption)

3.0.71
  Get ready for some script rewriting...*holds up banner with BETA written on it :) *

- Added: ControlSend()
- Added: Framework for AutoItSetOption() - note: this function replaces all
         functions like WinSetDelay, SendSetDelay, MouseSetMode, etc.
- Removed: MouseSetMode(), SendSetCapslockMode(), SendSetDelay(), WinSetDelay(), WinSetDetectHiddenText()
           WinSetTitleMatchMode()

3.0.70
- Fixed: SoundPlay()
- Removed: AutoItWinShow(), AutoItWinWrite(), AutoItWinGetText()
- Changed: ControlCommand() (updated with Larry's recent changes)
- Changed: RegRead() extended error codes
- Added: FileFindFirstFile(), FileFindNextFile()
- Added: AutoItWinGetTitle()
- Added: WinGetClientSize()
- Added: EnvUpdate()
- Added: SoundSetWaveVolume()
- Added: FileGetLongName(), FileGetShortName()
- Added: TimerStart(), TimerStop()

3.0.69
- Fixed: Small delay added into mouseclick functions
- Fixed: FileGetVersion()
- Fixed: WinMenuSelectItem()
- Fixed: StringSplit() buffer overrun

3.0.68
- Added: FileGetAttrib(), WinMenuSelectItem(), FileGetVersion()
- Added: Added options to ControlCommand()

- Changed: (Internal) Larry's nFlag functions split

3.0.67
- Changed: InputBox() narrowed slightly
- Fixed: AutoIt icon not refreshing if Return was used at top level of script
- Fixed: Crash with extra long lines fixed
- Fixed: @OS_VERSION weirdness fixed

- Changed: (Internal) MessagePump handled differently and recursion level of Execute() tracked

3.0.66
- Changed: StringSplit() returns full string in array if no delimiters matched (and count=1 not 0)
- Fixed: Crash related to window titles and text fixed.

3.0.65
- Added: ControlCommand() option GetCurrentLine
- Fixed: Possible bug with optional "Then" statement fixed
- (Internal) Window searching functions altered to check for hung windows

3.0.64
Fixed: IniWrite/Delete() functions were not flushing immediately under 9x.
Added: Errors now include the file name that contained the error

3.0.63
- Changed: ControlCommand() various internal changes.
- Fixed: MsgBox() character limit bug fixed
- Changed: Can now specify a custom time for AdlibEnable()

3.0.62
- Fixed: Aut2Exe icon changing code bugged
- Changed: Timing of "paused" flash and icon modified a little.

3.0.61
- Fixed: FileOpenDialog()
- Changed: (Internal)Encryption code modified - check compiling thoroughly
- Added: AutoIt icon flashes when in paused state

3.0.60
- Changed: Aut2Exe strips version info from compiled script. (Hoping to be custom versioninfo in future)
- Fixed: FileGetSize() (change made, unsure if problem fixed)
- Fixed: FileMove wasn't supported on 9x (9x has no MoveFileEx function, Dave... :) )

3.0.59
- Fixed: InputBox was not returning "" on cancel

3.0.58
- Fixed: The window text searching in AutoIt was not the same as AU3_Spy or WinGetText()
- Added: InputBox() (and very nice it is too...)
- Added: FileMove()

3.0.57
- Fixed: MsgBox under 9x was doing odd things with timeouts - tried something else.

3.0.56
- Fixed: Selecting the default icon in Aut2Exe was not saved between sessions
- Fixed: @OSLang under NT4...
- Added: SysTabControl32 tabbing

3.0.55
- Changed: Better icon support added to Aut2Exe
- Changed: (Internal) upx.exe called during the compiler to compress data -
    necessary to do it this way as you can't edit the resources of a compressed
    exe
- Changed: SoundPlay()

3.0.54
- Fixed: Compiled scripts with custom icons were failing
- Fixed: @OS_LANG under 9x

3.0.53
- Added: StringSplit()

3.0.52
- Changed: SoundPlay() option to wait added
- Added: ChangeIcon support back in Aut2Exe (32x32x16) - Slightly better than v2 in that
        a multiimage iconfile can be used - although only the 32x32x16 image is actually used.

3.0.51
- Fixed: Aut2Exe still used ' comments when including files -whoops.

3.0.50
- Changed: (Internal)A little error checking added to the lexer
- Added: @TAB, @COMSPEC
- Changed: MouseClick() parameters changed
- Added: MouseClickDrag()

3.0.49
- Fixed: Statusbar in Aut2Exe with Visual Styles
- Changed: Single line comment character is now ;
- Changed: ' and " may now be used for strings

3.0.48
- Added: StringIsFloat(), StringIsInt()
- Fixed: MsgBox() wasn't returning -1 on timeout
- Fixed: StringReplace() error if string to replace was at end of string
- Changed: StringReplace() count is now optional (assumes global)
- Added: Aut2Exe and AutoIt3 now use Visual Styles

3.0.47
- Changed: FileExists() to work with wildcards
- Changed: Extra options added to AutoItWinShow()
- Changed: RegRead returns the string "" in addition to @error if the (default) key was requested
    and not found.
- Fixed: DriveGetDrive()  (still an a: drive bug to find though)

3.0.46
- Fixed: RegDelete() return value when value does not exist
- Fixed: CDTray() open/closed problems
- Fixed: FileSelectFolder() crash due to missing initialisers

3.0.45
- Changed: Set...() functions renamed (SendSetDelay, WinSetDelay, etc.)
- Added: StatusbarGetText()

3.0.44
- Added: Break()
- Fixed: DriveStatus()
- Fixed: RegDelete()

3.0.43
- Fixed: @OSLang for 2000+
- Added: Hex(), AutoItWinGetText()
- Changed: UBound() back to how it was again (same as VBScript syntax)

3.0.42 (30th August, 2003)
- Tweaked: Mouse coords were 1 pixel out
- Added: MouseSetMode() to allow for screen _and_ relative coords - yay everyone's happy

3.0.41 (30th August, 2003)
- Fixed: Bug with invalid filehandles (again!).
- Changed: Mouse commands may now work on multiple monitors.
- Fixed: $CmdLine wasn't working correctly for compiled scripts.
- Fixed: The operator == wasn't properly comparing strings
- Fixed: INI functions, filename now doesn't need ".\file.ini" to work in the current directory
- Fixed: Bug in Run() directory would not be set if last parameter was used

3.0.40
- Added: Windows API error messages added onto errors for the Run() commands
    (directory invalid, bad logon, etc).

3.0.39 (29th August, 2003)
- Added: RunAsSet() (2000/XP only)
- Added: FileRecycle()

3.0.38 (28th August, 2003)
- Changed: WinGetText now correctly takes note of detecthiddentext setting
- Added: StringStripWS()
- Added: DriveGetLabel(), DriveGetSerial(), DriveGetFileSystem(),
        DriveSetLabel(), DriveGetType(), MouseGetCursor()

3.0.37
- Changed: Compression tweaked in Aut2Exe

- Changed: UBound($array) now returns number of dimensions
- Renamed all the IsUpper/IsAlpha, etc functions to StringIsUpper/StringIsAlpha, etc.
- Added: IsFloat(), IsArray(), IsInt(), IsString()
- Added: Mod()

3.0.36
- Fixed: Main dialog in Aut2Exe
- Added: New compression code (slower but better at higher levels)

3.0.35
- Added: FileInstall() support
- Added: SplashImageOn(), SplashTestOn(), SplashOff()
- Added: ProgressOn(), ProgressOff(), ProgressSet()
- Added: Compression level option in Aut2Exe

3.0.34
- Fixed: subscript must be > 0 in Dim statement
- Added: Compiled script reading code added
- Added: @Compiled
- Added: Aut2Exe

3.0.33 (22nd August, 2003)
- Added: Case Else
- Added: @DesktopWidth, @DesktopHeight
- Fixed: CDTray - closed/close
- Fixed: Incorrect reference passing of global variables
- Fixed: Bad file handle causing a crash in FileWrite/Read/Close
- Fixed: Crash with badly formatted Func statements
- Parsing speeded up (doubled the speed)
- Optimized string handling in variants

3.0.32 (20th August, 2003)
- Started proper version logging :)

First public beta binary - 4th March, 2003.

Development started - 20th January, 2003.


UDFs renaming

Starting with v3.2.9.3 _GUICtrlXXXYYY() have been renamed _GUICtrlXXX_YYY() without any functional changes except stated in the below table.

For XXX equal to "Combo" and "List" these have been changed to "ComboBox" and "ListBox". They can be found in GuiComboBox.au3 and GuiListBox.au3. So the #include file will have to be changed too.

Old | New | Comments
_GUICtrlComboAddDir | _GUICtrlComboBox_AddDir | parameters inversion and $vAttrib->$iAttrib.
_GUICtrlComboAutoComplete | _GUICtrlComboBox_AutoComplete | $sText, $s_WTitle, $s_WText parameters ignored.
_GUICtrlComboFindString | _GUICtrlComboBox_FindString | or _GUICtrlComboBox_FindStringExact if $fexact was used.
_GUICtrlComboGetList | _GUICtrlComboBox_GetList | $sDelimiter suppress use Opt("GUIDataSeparatorChar").
_GUICtrlComboInsertString | _GUICtrlComboBox_InsertString | parameters inversion.
_GUICtrlComboSelectString | _GUICtrlComboBox_SelectString | parameters inversion.
_GUICtrlComboSetItemHeight | _GUICtrlComboBox_SetItemHeight | parameters inversion.

Old | New | Comments
_GUICtrlEditFind | _GUICtrlEdit_Find | $hGui parameter removed
_GUICtrlEditFindText |  | OBSOLETE
_GUICtrlEditGetRECT | _GUICtrlEdit_GetRECT | return modified.
_GUICtrlEditGetSel | _GUICtrlEdit_GetSel | return modified.
_GUICtrlEditSetRECT | _GUICtrlEdit_SetRECT | return modified.

Old | New | Comments
_GUICtrlIpAddressClear | _GUICtrlIpAddress_ClearAddress | renamed.
_GUICtrlIpAddressDelete | _GUICtrlIpAddress_Destroy | renamed.

Old | New | Comments
_GUICtrlListAddDir | _GUICtrlListBox_Dir | parameters inversion and $vAttrib->$iAttrib.
_GUICtrlListAddItem | _GUICtrlListBox_AddString | renamed.
_GUICtrlListClear | _GUICtrlListBox_ResetContent | renamed.
_GUICtrlListCount | _GUICtrlListBox_GetCount | renamed.
_GUICtrlListDeleteItem | _GUICtrlListBox_DeleteString | renamed.
_GUICtrlListGetInfo | _GUICtrlListBox_GetListBoxInfo | renamed.
_GUICtrlListGetItemRect | _GUICtrlListBox_GetItemRect | return modified.
_GUICtrlListGetLocale | _GUICtrlListBox_GetLocale | $fDec ignored.
_GUICtrlListGetSelState | _GUICtrlListBox_GetSel | renamed.
_GUICtrlListInsertItem | _GUICtrlListBox_InsertString | renamed.
_GUICtrlListSelectedIndex | _GUICtrlListBox_GetCurSel | renamed.
_GUICtrlListSelectIndex | _GUICtrlListBox_SetCurSel | renamed.
_GUICtrlListSelItemRange | _GUICtrlListBox_SelItemRange | parameters inversion.
_GUICtrlListSetSel | _GUICtrlListBox_SetSel | parameters inversion.

Old | New | Comments
_GUICtrlListViewFindItem | _GUICtrlListView_FindInText | _GUICtrlListView_FindItem, _GUICtrlListView_FindNearest, _GUICtrlListView_FindParam, _GUICtrlListView_FindText
_GUICtrlListViewGetBackColor | _GUICtrlListView_GetBkColor | renamed.
_GUICtrlListViewGetCheckedState | _GUICtrlListView_GetItemChecked | renamed.
_GUICtrlListViewGetCurSel | _GUICtrlListView_GetNextItem | renamed.
_GUICtrlListViewGetItemText | _GUICtrlListView_GetItemText | item is mandatory or _GUICtrlListView_GetItemTextString
_GUICtrlListViewGetNextItem | _GUICtrlListView_GetNextItem | $i_direction parameter changed.
_GUICtrlListViewGetSubItemsCount | _GUICtrlListView_GetColumnCount | renamed.
_GUICtrlListViewInsertColumn | _GUICtrlListView_InsertColumn | optional parameters inversion.
_GUICtrlListViewInsertItem | _GUICtrlListView_InsertItem | _GUICtrlListView_SetItemText for column >1
_GUICtrlListViewSetColumnHeaderText | _GUICtrlListView_SetColumn | parameters inversion.
_GUICtrlListViewSetColumnOrder | _GUICtrlListView_SetColumnOrder | $order must be split.
_GUICtrlListViewSetCheckState | _GUICtrlListView_SetItemChecked | renamed.
_GUICtrlListViewSetItemSelState | _GUICtrlListView_SetItemSelected | or _GUICtrlListView_SetItemFocused.
_GUICtrlListViewSetItemText | _GUICtrlListView_SetItemText | parameters inversion.
_GUICtrlListViewSort | _GUICtrlListView_SimpleSort | renamed.

Old | New | Comments
_GUICtrlMonthCalGet1stDOW | _GUICtrlMonthCal_GetFirstDOWStr | renamed.
_GUICtrlMonthCalGetColor | _GUICtrlMonthCal_GetColorArray | renamed.
_GUICtrlMonthCalGetMinReqRECT | _GUICtrlMonthCalGetMinReqRECT | renamed.
_GUICtrlMonthCalSetColor | _GUICtrlMonthCal_SetColor | return modified.
_GUICtrlMonthCalSet1stDOW | _GUICtrlMonthCal_SetFirstDOW | renamed.
_GUICtrlMonthCalSetDelta | _GUICtrlMonthCal_SetMonthDelta | renamed.

Old | New | Comments
_GUICtrlStatusBarCreateProgress |  | OBSOLETE
_GUICtrlStatusBarDelete | _GUICtrlStatusBar_Destroy | renamed.
_GUICtrlStatusBarGetParts | _GUICtrlStatusBar_GetCount | renamed.
_GUICtrlStatusBarGetTip | _GUICtrlStatusBar_GetTipText | renamed.
_GUICtrlStatusBarGetUnicode | _GUICtrlStatusBar_GetUnicodeFormat | renamed.
_GUICtrlStatusBarSetIcon | _GUICtrlStatusBar_SetIcon | optional parameters inversion.
_GUICtrlStatusBarSetParts | _GUICtrlStatusBar_SetParts | $hGUI parameter suppression.
_GUICtrlStatusBarSetUnicode | _GUICtrlStatusBar_SetUnicodeFormat | renamed.

Old | New | Comments
_GUICtrlTabGetItemRECT | _GUICtrlTab_GetItemRect | return modified.

Old | New | Comments
_GUICtrlTreeViewDeleteAllItems | _GUICtrlTreeView_DeleteAll | renamed.
_GUICtrlTreeViewDeleteItem | _GUICtrlTreeView_Delete | $hGUI parameter removed.
_GUICtrlTreeViewExpand | _GUICtrlTreeView_Expand | optional parameter inversion.
_GUICtrlTreeViewGetParentID | _GUICtrlTreeView_GetParentParam | renamed.
_GUICtrlTreeViewGetTree | _GUICtrlTreeView_GetTree | $sSeparator suppress use Opt("GUIDataSeparatorChar").


History

Script Breaking Changes in Recent Versions

This page contains a list of all changes made in recent updates that will almost certainly break existing scripts. Please read this list carefully when upgrading if you have not been keeping up with developments in the beta versions. If any of these issues affect you then you will need to modify your scripts.

7th March, 2010 - v3.3.6.0

UDFs:

  • _DateToDayOfWeekIso returned 0-6 and is changed to 1-7 where Monday = 1.

15th January, 2010 - v3.3.4.0

Some of the following features are deprecated. Deprecated features are no longer documented but continue to work. Deprecated features will be removed after version 3.3.4.0. It is strongly recommended that scripts relying on deprecated features be updated to work with the new behavior. Some features have already been removed and will be noted as such.

AutoIt:

  • The raw reading mode for FileOpen() has been removed.
  • InetGet("abort"), @InetGetActive and @InetGetBytesRead have been removed. The following list shows the new functions used to access the old behavior:
    • InetGet("abort") - Calling the new InetClose() function with a handle returned from InetGet() will abort a download.
    • @InetGetActive - Calling the new InetGetInfo() function with no parameters returns a count of active downloads.
    • @InetGetBytesRead - Calling the new InetGetInfo() function with a handle returned from InetGet()will return the bytes read (and more) for a download.
  • AdlibEnable() and AdlibDisable() have been removed. See the new functions AdlibRegister() and AdlibUnRegister().
  • OnAutoItStart() has been removed. See the new pre-processor statement #OnAutoItStartRegister.
  • OnAutoItExit() has been removed. See the new functions OnAutoItExitRegister() and OnAutoItExitUnregister().

18th December, 2009 - v3.3.2.0

Some of the following features are deprecated. Deprecated features are no longer documented but continue to work. Deprecated features will be removed after version 3.3.2.0. It is strongly recommended that scripts relying on deprecated features be updated to work with the new behavior. Some features have already been removed and will be noted as such.

AutoIt:

  • ShellExecute() and ShellExecuteWait() no longer use the "open" verb by default. See the remarks section for those functions for more details.
  • The return value of InetGet() has changed. It is important to read and understand the changes because it is possible to leak resources if InetGet() is used incorrectly.
  • InetGet("abort"), @InetGetActive and @InetGetBytesRead are now deprecated. The following list shows the new functions used to access the old behavior:
    • InetGet("abort") - Calling the new InetClose() function with a handle returned from InetGet() will abort a download.
    • @InetGetActive - Calling the new InetGetInfo() function with no parameters returns a count of active downloads.
    • @InetGetBytesRead - Calling the new InetGetInfo() function with a handle returned from InetGet()will return the bytes read (and more) for a download.
  • The FtpBinaryMode option set with AutoItSetOption() has been removed. Now InetGet() takes a flag to specify the transfer mode.
  • The URLDownloadToFile() alias for InetGet() has been removed.
  • AdlibEnable() and AdlibDisable() are deprecated. See the new functions AdlibRegister() and AdlibUnRegister().
  • OnAutoItStart() is deprecated. See the new pre-processor statement #OnAutoItStartRegister.
  • OnAutoItExit() is deprecated. See the new functions OnAutoItExitRegister() and OnAutoItExitUnregister().
  • The AutoItSetOption() option OnExitFunc has been removed. See the new functions OnAutoItExitRegister() and OnAutoItExitUnregister().
  • GUICreate() with $WS_EX_MDICHILD has been fixed to be relative to client area as documented.
  • ProcessWait() now returns a PID instead of 1 on success.
  • WinWait(), WinWaitActive(), WinActivate(), WinActive() and WinMove() now return an HWND instead of 1 on success.
  • The macro @YDAY now uses the range 001 - 366 instead of 1 - 366. This makes the macro more consistent with other languages (like C/C++) and more consistent with all other date related macros which return strings with leading 0s to pad the length.
  • RegEnumKey() and RegEnumVal() now return an empty string instead of an error message.

UDFs:

  • The last optional parameter for _StringBetween() has been removed.
  • _StringAddThousandsSep() has been removed. There are too many opinions on what this function should do and too many revisions of this function have been made.
  • _SQLite_SaveMode() has been renamed to _SQLite_SafeMode().

24th December, 2008 - v3.3.0.0

AutoIt:

  • Windows 9x and Windows NT 4.0 Operating System support has been removed. Use v3.2.12.1 of AutoIt if you really need this.
  • @ProcessorArch changed to @OSArch as it was misleading.
  • RegRead() and RegWrite() no longer use hex strings for REG_BINARY types - native binary datatypes are enforced.

AutoItX:

  • The native version of the DLL now exclusively uses Unicode strings (LPWSTR and LPCWTSR). If you really need ANSI strings then continue to use v3.2.12.1. The easiest workaround though is to use a "wrapper" function to simply convert between Unicode and ANSI. A limited selection of functions (WinWait... and Send) have an ANSI version but it is not intended to add ANSI versions for any others unless there is a large demand.

UDFs:

  • N/A

16th May, 2008 - v3.2.12.0

AutoIt:

  • RunAsSet() has been removed. Use the new RunAs() and RunAsWait() functions instead. They have been enhanced with slightly better security (It is still not recommended to store important passwords in your scripts) and more functionality.
  • The option RunErrorsFatal has been removed. Run(), RunWait(), ShellExecute() and ShellExecuteWait() now all set @error when they fail to run the application. AutoIt will no longer throw a fatal error when an application fails to run.
  • StdoutRead(), StderrRead() and ConsoleRead() have undergone significant changes. They no longer block, they return immediately. The parameters have changed as well. It's no longer possible to read count parameters. The peek parameter has moved to the second parameter. The third parameter now specifies you want the data to be returned in binary format (default is text). The macro @extended now holds the number of bytes/characters read.
  • StdinWrite(), ConsoleWrite() and ConsoleWriteError() will now behave differently when given binary data. The binary data is written as-is instead of converting it to a string. Also, the return value from these functions is the number of bytes written instead of a generic value of 1.
  • Removed: ColorMode option ( Opt() ).
  • Fixed: Random(Min,Max,1). Previously this would never actually return Max, so if Max was artificially incremented by one the script will now need to be changed.

UDFs:

(Please see this forum thread for more details and help with these changes.)

  • GUIConstants.au3 is identical to GUIConstantsEx.au3. This means that many scripts using advanced GUI functionality will need to use additional #include statements to include files containing constants that were previously and erroneously included.
  • GUIDefaultConstants.au3 no longer exists. You must now #include the corresponding individual constants file for the control type you need. For example, ListBoxConstants.au3, ComboConstants.au3, EditConstants.au3, etc.
  • _ArrayCreate() documentation has been removed. The function is still present but may be removed at a later time. Scripts should be updated to use the array initialization syntax built into AutoIt.

25th November, 2007 - v3.2.10.0

AutoIt

  • DllCall(): short_ptr, long_ptr, int_ptr types deprecated. Use short*, long* and int* respectively.

UDFs

  • _GUICtrlXXXYYY() have been renamed _GUICtrlXXX_YYY() without any functional changes see UDF renaming.


Functions

GUI Constants Include Files

Below is a complete list of the GUI Constants include files available in AutoIt.

File | Related Control(s)
#include <AVIConstants.au3> | AVI
#include <ButtonConstants.au3> | Button, Group, Radio, Checkbox
#include <ComboConstants.au3> | Combo
#include <Constants.au3> | Tray, Run, StdIO,
#include <DateTimeConstants.au3> | Date, MonthCal
#include <EditConstants.au3> | Edit, Input
#include <GUIConstantsEx.au3> | GUI Create, events
#include <ListboxConstants.au3> | List
#include <ListviewConstants.au3> | Listview
#include <ProgressConstants.au3> | Progress
#include <SliderConstants.au3> | Slider
#include <StaticConstants.au3> | Label, Pic, Icon
#include <TabConstants.au3> | Tab
#include <TreeviewConstants.au3> | Treeview
#include <UpdownConstants.au3> | Updown
#include <WindowsConstants.au3> | Gui extended style


TESTTest-IE6.au3

 ; Example script, showing the usage of COM Event functions.
; Requires at least AutoIt beta version 3.1.1.104 !
;
; See also: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objects/internetexplorer.asp

; We use a very simple GUI to show the results of our Events.
#include "GUIConstantsEx.au3"
$GUIMain=GUICreate ( "Event Test", 600,500 )
$GUIEdit=GUICtrlCreateEdit ( "Test Log:" & @CRLF, 10, 20, 580, 400)
$GUIProg=GUICtrlCreateProgress ( 10, 5, 580, 10)
$GUIExit=GUICtrlCreateButton ( " Close ", 250, 450, 80, 30)
GUISetState () ;Show GUI

; We prepare the Internet Explorer as our test subject
$oIE=ObjCreate("InternetExplorer.Application.1")
With $oIE
.Visible=1
.Top = (@DesktopHeight-400)/2
.Height=400 ; Make it a bit smaller than our GUI.
.Width=600
.Silent=1 ; Don't show IE's dialog boxes
$IEWnd=HWnd(.hWnd) ; Remember the Window, in case user decides to close it
EndWith

; We choose for a specific Internet Explorer interface 'DWebBrowserEvents' because the IE is subject
; to modifications by e.g. Visual Studio and Adobe Acrobat Reader. If you have IE-plugins installed,
; AutoIt might not be able to find the correct interface automatically.
$EventObject=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents")
if @error then
Msgbox(0,"AutoIt COM Test", _
"ObjEvent: Can't use event interface 'DWebBrowserEvents'. Error code: " & hex(@error,8))
exit
endif

; Now starting to load an example Web page.
$URL = "http://www.AutoItScript.com/"
$oIE.Navigate( $URL )
sleep(1000) ; Give it some time to load the web page

GUISwitch ( $GUIMain ) ; Switch back to our GUI in case IE stealed the focus

; Waiting for user to close the GUI.
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE or $msg = $GUIExit Then ExitLoop
Wend

$EventObject.Stop ; Tell IE we don't want to receive events.
$EventObject=0 ; Kill the Event Object
If WinExists($IEWnd) then $oIE.Quit ; Close IE Window
$oIE=0 ; Remove IE from memory (not really necessary).

GUIDelete () ; Remove GUI

exit ; End of our Demo.

; A few Internet Explorer Event Functions
; See also: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objects/webbrowser.asp

Func IEEvent_BeforeNavigate($URL, $Flags, $TargetFrameName, $PostData, $Headers, $Cancel)
; Note: the declaration is different from the one on MSDN.
GUICtrlSetData ( $GUIEdit, "BeforeNavigate: " & $URL & " Flags: " & $Flags & " tgframe: " & $TargetFrameName & " Postdat: " & $PostData & " Hdrs: " & $Headers & " canc: " & $Cancel & @CRLF , "append" )
EndFunc

Func IEEvent_ProgressChange($Progress,$ProgressMax)
If $ProgressMax > 0 Then
GUICtrlSetData($GUIProg, ($Progress * 100) / $ProgressMax )
EndIf
EndFunc

Func IEEvent_StatusTextChange($Text)
GUICtrlSetData ( $GUIEdit, "IE Status text changed to: " & $Text & @CRLF , "append" )
EndFunc

Func IEEvent_PropertyChange( $szProperty)
GUICtrlSetData ( $GUIEdit, "IE Changed the value of the property: " & $szProperty & @CRLF , "append" )
EndFunc

Func IEEvent_DownloadComplete()
GUICtrlSetData ( $GUIEdit, "IE has finished a navigation operation" & @CRLF , "append" )
EndFunc

Func IEEvent_NavigateComplete($URL)
; Note: the declaration is different from the one on MSDN.
GUICtrlSetData ( $GUIEdit, "IE has finished loading URL: " & $URL & @CRLF , "append" )
EndFunc

Func IEEvent_($EventName)
; This is an optional event function to catch non-defined events.
; The parameter contains the name of the event being called.
GUICtrlSetData ( $GUIEdit, "Uncatched event: " & $EventName & @CRLF , "append" )
EndFunc


Function _StringBetween

Function Reference

_StringBetween

Returns the string between the start search string and the end search string.

#Include <String.au3>
_StringBetween($s_String, $s_Start, $s_End [, $v_Case = -1])

Parameters

$s_String | The string to search.
$s_Start | The beginning of the string to find. Passing a blank string starts at the beginning
$s_End | The end of the string to find. Passing a blank string searches from $s_Start to end
$v_Case | [optional] Case sensitive search. Default or -1 is not Case sensitive else Case sensitive.

Return Value

Success: | A 0 based $array[0] contains the first found string.
Failure: | 0
@error: | 1 - No inbetween string found.

Remarks

2009/05/03 Script breaking change, removed 5th parameter

Related

Example

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <String.au3>
#include <Array.au3>

_Main()

Func _Main()
Local $aArray1 = _StringBetween('[18][20][3][5][500][60]', '[', ']')
_ArrayDisplay($aArray1, 'Default Search')
EndFunc ;==>_Main


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip® 9.0 SR-1 Setup
Class:	#32770
Size:	X: 493    Y: 455    W: 413    H: 139

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
&Setup
Cancel
&Info...
Thank you for your interest in WinZip!

Click the "Setup" button to install WinZip 9.0 SR-1.

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip Setup
Class:	#32770
Size:	X: 540    Y: 425    W: 320    H: 199

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
Setup will install WinZip into the following folder, which it will create if necessary.
If you want to install WinZip in a different folder and/or drive, type the name of the folder below:
&Install to:
C:\Program Files\WinZip
&Browse...
OK
Cancel

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip Setup
Class:	#32770
Size:	X: 464    Y: 341    W: 471    H: 333

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
&Help
< &Back
&Next >
Close
Thank you for installing WinZip!
WinZip features include:

* Quick and easy zip and unzip
* Optional Wizard interface
* E-mail support, including Zip and E-Mail from Explorer
* Tight integration with the Windows shell
* Internet file format support, including MIME, TAR, & CAB
* 128-bit and 256-bit AES encryption

Press the F1 key on your keyboard at any time while running WinZip for context sensitive help and complete documentation.

Click Next to continue.

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<
&WinZip Classic


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	License Agreement and Warranty Disclaimer
Class:	#32770
Size:	X: 473    Y: 368    W: 452    H: 279

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
As with other software, WinZip is subject to WARRANTY DISCLAIMERS and
LIABILITY LIMITATIONS, including (but not limited to) the following:
THIS SOFTWARE, AND ALL ACCOMPANYING FILES, DATA AND MATERIALS, ARE
DISTRIBUTED "AS IS", and ANY LIABILITY OF WINZIP COMPUTING, INC. (WCI)
WILL BE LIMITED EXCLUSIVELY TO REFUND OF THE LICENSE FEE PAID TO WCI.
In addition, this version of WinZip is subject to the complete
WinZip License Agreement, which you can view by clicking on the
"View License Agreement" button now.
I agree that by clicking on the "Yes" button below (or otherwise installing
or using WinZip), I accept all terms of the License Agreement, and that I
have read the License Agreement.
&Yes
&No
&View License Agreement

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip Setup
Class:	#32770
Size:	X: 464    Y: 341    W: 471    H: 333

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
&Help
< &Back
&Next >
Close
WinZip Quick Start
For helpful information on installing and using WinZip, print a copy of the "WinZip Quick Start Guide." Click "Print Quick Start".

To see the Guide without printing it, click "View Quick Start".
You can also view or print the Quick Start Guide later by choosing Quick Start from the WinZip Help Contents.

Click Next when you are ready to continue.
&Print Quick Start
&View Quick Start

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<
&WinZip Classic


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip Setup
Class:	#32770
Size:	X: 464    Y: 341    W: 471    H: 333

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
&Help
< &Back
&Next >
Close
Choose "Classic" or "Wizard", then click "Next"
You can start with the "Classic" or "Wizard" interface.  It is easy to switch between the two interfaces, and you can always change the default later.
WinZip Classic is the more powerful of the two interfaces and is recommended if you are comfortable with Windows and Zip files. Most WinZip users choose this interface.
The WinZip Wizard automates the most common tasks involving Zip files and is most useful for users who are new to Windows and Zip files.
Start with WinZip &Classic
&Start with the WinZip Wizard

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<
&WinZip Classic


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip Setup
Class:	#32770
Size:	X: 464    Y: 341    W: 471    H: 333

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
&Help
< &Back
&Next >
Close
Click "Next" to continue.
&Express setup (recommended)
&Custom setup (for advanced users)
Express Setup associates WinZip with archives, creates a program group, and puts WinZip icons on the desktop and Start menu.

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<
&WinZip Classic


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip Setup
Class:	#32770
Size:	X: 464    Y: 341    W: 471    H: 333

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
&Help
< &Back
&Next >
Close
WinZip needs to associate itself with your archives.
Associations allow WinZip to be used to open archives from My Computer, Windows Explorer, etc.
Click "Next" to associate WinZip with all supported archive types.  Click "Associations" if you want more information or would like to specify the archive types with which WinZip is associated.
&Associations...

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<
&WinZip Classic


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip Setup
Class:	#32770
Size:	X: 464    Y: 341    W: 471    H: 333

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
&Help
< &Back
Finish
Close
Thank you for installing this evaluation version.
New WinZip Users:

For a quick introduction to WinZip select "Brief Tutorial" from the "Help" pull-down menu at any time or press the F1 key now.

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<
&WinZip Classic


>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:	WinZip (Evaluation Version)
Class:	WinZipWClass
Size:	X: 417    Y: 334    W: 566    H: 347

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
Choose "New" to create or "Open" to open an archive
ListView

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<


; Run the winzip installer
Run("winzip90.exe")

; Initial Setup Screen
WinWaitActive("WinZip® 9.0 SR-1 Setup", "&Setup")
Send("!s")

; Install location
WinWaitActive("WinZip Setup", "into the following folder")
Send("{ENTER}")

; Features overview
WinWaitActive("WinZip Setup", "WinZip features include")
Send("!n")

; License agreement
WinWaitActive("License Agreement")
Send("!y")

; Quick start
WinWaitActive("WinZip Setup", "Quick Start Guide")
Send("!n")

; Choose interface
WinWaitActive("WinZip Setup", "switch between the two interfaces")
Send("!c")
Send("!n")

; Installation type (custom/express)
WinWaitActive("WinZip Setup", "&Express setup (recommended)")
Send("!e")
Send("!n")

; Select file associations
WinWaitActive("WinZip Setup", "WinZip needs to associate itself with your archives")
Send("!n")

; Completed installation screen
WinWaitActive("WinZip Setup", "Thank you for installing this evaluation version")
Send("{ENTER}")

; Wait for winzip to load then close it
WinWaitActive("WinZip (Evaluation Version)")
WinClose("WinZip (Evaluation Version)")