<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.autoitscript.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JLogan3o13</id>
	<title>AutoIt Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.autoitscript.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JLogan3o13"/>
	<link rel="alternate" type="text/html" href="https://www.autoitscript.com/wiki/Special:Contributions/JLogan3o13"/>
	<updated>2026-04-20T19:43:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13592</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13592"/>
		<updated>2017-01-12T20:48:14Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* What is proper forum etiquette?  What rules are there for the forum? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic; see the [[Decompiling FAQ]] for more information. Topics discussing decompilation of scripts will be locked immediately. Posting the source of a decompiled script with lead to immediate sanctions from the Moderation team, as it directly violates AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;i&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/i&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
In order to be able to recover your script from the compiled executable, you can use the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the compiled script with the following command line parameters your source will be extracted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** &amp;lt;b&amp;gt;AutoIt Specific&amp;lt;/b&amp;gt;&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#*** AutoItX Support (Support for the COM, DLL, PowerShell and .NET add-ons for AutoIt)&lt;br /&gt;
*#** &amp;lt;b&amp;gt;Non-AutoIt&amp;lt;/b&amp;gt;&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13591</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13591"/>
		<updated>2017-01-12T20:45:59Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* What is proper forum etiquette?  What rules are there for the forum? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic; see the [[Decompiling FAQ]] for more information. Topics discussing decompilation of scripts will be locked immediately. Posting the source of a decompiled script with lead to immediate sanctions from the Moderation team, as it directly violates AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;i&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/i&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
In order to be able to recover your script from the compiled executable, you can use the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the compiled script with the following command line parameters your source will be extracted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13590</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13590"/>
		<updated>2017-01-12T20:35:19Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* How can I decompile my AutoIt EXEs? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic; see the [[Decompiling FAQ]] for more information. Topics discussing decompilation of scripts will be locked immediately. Posting the source of a decompiled script with lead to immediate sanctions from the Moderation team, as it directly violates AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;i&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/i&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
In order to be able to recover your script from the compiled executable, you can use the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the compiled script with the following command line parameters your source will be extracted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13589</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13589"/>
		<updated>2017-01-12T20:34:42Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* How can I decompile my AutoIt EXEs? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic; see the [[Decompiling FAQ]] for more information. Topics discussing decompilation of scripts will be locked immediately. Posting the source of a decompiled script with lead to immediate sanctions from the Moderation team, as it directly violates AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;i&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/i&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
In order to be able to recover your script from the compiled executable, you can use the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the compiled script with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13588</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13588"/>
		<updated>2017-01-12T20:28:00Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Why does my script no longer decompile? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic; see the [[Decompiling FAQ]] for more information. Topics discussing decompilation of scripts will be locked immediately. Posting the source of a decompiled script with lead to immediate sanctions from the Moderation team, as it directly violates AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;i&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/i&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13587</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13587"/>
		<updated>2017-01-12T20:27:34Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Why does my script no longer decompile? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic; see the [[Decompiling FAQ]] for more information. Topics discussing decompilation of scripts will be locked immediately. Posting the source of a decompiled script with lead to immediate sanctions from the Moderation team, as it directly violates AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13586</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13586"/>
		<updated>2017-01-12T20:24:32Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Where can I learn AutoIt? Are there any tutorials? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13585</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13585"/>
		<updated>2017-01-12T20:23:07Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Why doesn&amp;#039;t my script work on a locked workstation? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13584</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13584"/>
		<updated>2017-01-12T20:18:56Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Breaking forum rules, law, modesty, or common sense */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13583</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13583"/>
		<updated>2017-01-12T20:17:50Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Breaking forum rules, law, modesty, or common Sense */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13582</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13582"/>
		<updated>2017-01-12T20:16:24Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Speak English and speak it right */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13581</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13581"/>
		<updated>2017-01-12T20:15:30Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Speak English and speak it right */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13580</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13580"/>
		<updated>2017-01-12T19:57:45Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* How can I run my script on a remote computer over the network? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13579</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13579"/>
		<updated>2017-01-12T19:53:28Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* How can I prevent more than one copy of my script from running at once / detect another copy of my script running? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13578</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13578"/>
		<updated>2017-01-12T19:34:10Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Multithreading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13577</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13577"/>
		<updated>2017-01-12T19:30:41Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Multithreading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory.&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the NOT TO DO list&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multiprocessing are closely related to each other and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13576</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13576"/>
		<updated>2017-01-12T19:28:01Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* How can I search an image in another image? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
The AutoIT language is not threadsafe and does not have multithreading on the TODO list &#039;&#039;&#039;its on the WON&#039;t DO it list&#039;&#039;&#039;&lt;br /&gt;
However multiple threads on this subject&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory.&lt;br /&gt;
Multitasking and Multiprocessing are closely related to each other and multiple solutions where made as a bypass&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13575</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13575"/>
		<updated>2017-01-12T19:24:33Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* How can I search an image in another image? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
Official AutoIt Wiki Page&lt;br /&gt;
[https://www.autoitscript.com/wiki/Main_Page AutoIt Wiki]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* simplespy in examples section&lt;br /&gt;
* jabsimplespy in examples section&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of autoit, as well as imagesearch. See the help file for more information and examples.&lt;br /&gt;
Below are some specific UDF examples; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
More difficult ones can be found with specific dll but those above are &amp;quot;native&amp;quot;; no need for external dlls&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
The AutoIT language is not threadsafe and does not have multithreading on the TODO list &#039;&#039;&#039;its on the WON&#039;t DO it list&#039;&#039;&#039;&lt;br /&gt;
However multiple threads on this subject&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory.&lt;br /&gt;
Multitasking and Multiprocessing are closely related to each other and multiple solutions where made as a bypass&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=13383</id>
		<title>Free Software</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=13383"/>
		<updated>2016-03-24T16:13:36Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /*  Archive  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome To The Free Software Page ~ This page is a place to find useful free software recommended by the AutoIt community&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Archive &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.7-zip.org/  7 Zip] ~ Compression Utility ~ CyberSlug&lt;br /&gt;
* [http://www.peazip.org/ PeaZip] ~ Free File Archiver ~ JLogan3o13&lt;br /&gt;
* [http://legroom.net/software/uniextract Universal Extractor] ~ decompress and extract files from any type of archive or installer ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Antivirus, Malware &amp;amp; Spyware Programs &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://general-changelog-team.fr/en/tools/15-adwcleaner AdwCleaner] ~ AIO Adware Removal Tool ~ TheDcoder&lt;br /&gt;
* [http://www.lavasoft.com/products/ad_aware_free.php Ad-Aware] ~ Antivirus Package ~ /dev/null &lt;br /&gt;
* [http://www.avast.com/index Avast] ~ Antivirus Package ~ killaz219&lt;br /&gt;
* [http://www.avira.com/en/avira-free-antivirus  Avira] ~ Antivirus Package ~ MSLx Fanboy&lt;br /&gt;
* [http://free.avg.com/gb-en/homepage AVG Free] ~ Antivirus Package ~ LxP&lt;br /&gt;
* [http://antivirus.baidu.com/en/  Baidu Antivirus] ~ Antivirus ~ wakillon&lt;br /&gt;
* [http://www.trendmicro.co.uk/products/free-tools-and-services/ Hijack This] ~ Threat Removal Tool. Should only be used if you know what you are doing. ~ jefhal&lt;br /&gt;
* [http://www.microsoft.com/security/pc-security/mse.aspx  Microsoft Security Essentials (WIN7 only)] ~ Malware/Spyware Tool ~ Valuater &lt;br /&gt;
* [http://www.safer-networking.org/en/index.html Spybot - Search &amp;amp; Destroy] ~ Spyware Removal ~ BigDod &lt;br /&gt;
* [http://www.javacoolsoftware.com/spywareblaster.html  SpywareBlaster] ~ Spyware Tool ~ forger&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Audio &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://audacity.sourceforge.net/ Audacity] ~ Audio Recording &amp;amp; Editing Tool ~ jefhal&lt;br /&gt;
* [http://mediaarea.net/en/MediaInfo MediaInfo] ~ Display technical and tag data for video and audio files ~ wakillon&lt;br /&gt;
* [http://mp3gain.sourceforge.net/ MP3Gain] ~ Normalize Music Files ~ maqleod &lt;br /&gt;
* [http://www.mp3tag.de/en/index.html Mp3tag] ~ Mp3 Metadata Editor ~ ning&lt;br /&gt;
* [http://www.synthfont.com/ SynthFont] ~ Midi Editing ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Browsers and addons&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.qksoft.com/favorites-management-master/  Bookmark Master] ~ IE Bookmark Manager ~ MHz&lt;br /&gt;
* [http://toolbarcleaner.com/ Toolbar Cleaner] ~  Remove unwanted toolbars, apps, add-ons, and plug-ins   ~ wakillon&lt;br /&gt;
----&lt;br /&gt;
* [http://en.browser.baidu.com/  Baidu Spark Browser] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://chromium.woolyss.com/  Chromium] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/firefox/fx/ Firefox] ~ Web Browser ~ LxP&lt;br /&gt;
* [http://www.srware.net/en/software_srware_iron.php Iron] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.maxthon.com/  Maxthon] ~ Web Browser ~ MHz&lt;br /&gt;
* [http://www.opera.com/  Opera] ~ Browser ~ photonbuddy&lt;br /&gt;
* [http://www.palemoon.org/  Pale Moon] ~ Web Browser ~ qwert&lt;br /&gt;
* [http://support.apple.com/kb/dl1531 Safari] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.slimbrowser.net/en/ Slim Browser] ~ Web Browser ~ jefhal&lt;br /&gt;
* [http://browser.yandex.com/  Yandex] ~ Web Browser ~ wakillon&lt;br /&gt;
* [https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo  RestClient] ~ a RestClient for Google Chrome ~ mLipok&lt;br /&gt;
* [https://addons.mozilla.org/pl/firefox/addon/restclient/  RestClient] ~ a RestClient for FireFox ~ mLipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; CD &amp;amp; DVD Software &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.daemon-tools.cc/eng/products/dtLite  Daemon Tools Lite] ~ Virtual Disc Emulator ~ CyberSlug&lt;br /&gt;
* [http://www.deepburner.com/?r=products&amp;amp;pr=deepburner&amp;amp;prr=features  DeepBurner ] ~ CD/DVD Burner ~ MSLx Fanboy&lt;br /&gt;
* [http://www.magiciso.com/tutorials/miso-magicdisc-mount.htm MagicDisc] ~ Virtual CD/DVD-ROM ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Coding &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.autoitscript.com/site/ AutoIt] ~ Scripting Language ~ layer&lt;br /&gt;
* [http://www.jrsoftware.org/isinfo.php  Inno Setup] ~ Program Installer Setup ~ gcriaco&lt;br /&gt;
* [http://notepad-plus-plus.org/  Notepad++] ~ Source Code Editing ~ maqleod&lt;br /&gt;
* [http://www.pspad.com/en/ PSPad] ~ Universal Editor ~ LxP&lt;br /&gt;
* [http://www.codertools.com TotalEdit] ~ Universal Editor ~ JoeCool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Commandline &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.7-zip.org/download.html 7z Extra] ~ Standalone 7z command-line version (also with 7z.dll) ~ TheDcoder&lt;br /&gt;
* [http://curl.haxx.se/ curl] ~ Commandline Https/Http/Ftp Client ~ /dev/null&lt;br /&gt;
* [http://www.ffmpeg.org/ FFmpeg] ~ Record, convert and stream audio and video ~ wakillon&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
* [http://wget.addictivecode.org/FrequentlyAskedQuestions#download wGet] ~ Commandline Https/Http/Ftp Client ~ Argumentum&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Document Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.openoffice.org/  Apache OpenOffice] ~ Office Suite ~ MSLx Fanboy&lt;br /&gt;
* [http://www.libreoffice.org/  LibreOffice] ~ Office Suite ~ Chimaera&lt;br /&gt;
* [http://liquidninja.com/metapad/ Metapad] ~ Notepad alternative ~ LxP &lt;br /&gt;
* [http://www.vim.org/ Vim] ~ Text Editor ~ /dev/null&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Explorer Replacements &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://explorerplusplus.com/ Explorer++] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://www.softwareok.com/?Freeware/Q-Dir Q-Dir] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://wde.codeplex.com/ Windows Double Explorer] ~  File manager for Windows ~ wakillon&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; FTP / Web Servers &amp;amp; Remote &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.jtsoft.com.pl/ A-Term] ~ Terminal emulator with API (COM / DLL) ~ mlipok&lt;br /&gt;
* [http://httpd.apache.org/  Apache] ~ Web Server ~ maqleod&lt;br /&gt;
* [http://filezilla-project.org/  Filezilla] ~ FTP Client &amp;amp; Server ~ MHz&lt;br /&gt;
* [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html putty] ~ SSP client ~ /dev/null&lt;br /&gt;
* [http://www.realvnc.com/  RealVNC] ~ Remote Control Software ~ ning&lt;br /&gt;
* [http://www.smartftp.com/ SmartFTP] ~ FTP client ~ LxP&lt;br /&gt;
* [http://www.teamviewer.com  TeamViewer] ~ Remote Desktop Software (More features than RealVNC and its free!)&lt;br /&gt;
* [http://www.ayera.com/teraterm/ TeraTerm Pro Web] ~ Enhanced Telnet/SSH2 Client ~ /dev/null&lt;br /&gt;
* [http://winscp.net/eng/index.php WinSCP] ~ FTP over SSH ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Image Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://blog.bahraniapps.com/ GifCam] ~  Animated gif creation  ~ wakillon&lt;br /&gt;
* [http://imageresizer.codeplex.com/  Image Resizer] ~ Image Manipulation ~ maqleod&lt;br /&gt;
* [http://inkscape.org/  Inkscape] ~ Vector Graphics Editor ~ Josbe&lt;br /&gt;
* [http://www.irfanview.com/ IrfanView] ~ Universal image editor ~ LxP&lt;br /&gt;
* [http://www.photofiltre-studio.com/pf7-en.htm PhotoFiltre] ~ Photo Editor ~ wakillon&lt;br /&gt;
* [http://picasa.google.co.uk/  Picasa] ~ Photo Editing Tool ~ jefhal&lt;br /&gt;
* [http://www.gimp.org/  The Gimp] ~ Image Editing ~ Blue_Drache &lt;br /&gt;
* [http://www.xnview.com/en/index.html  XnView] ~ Multimedia Convertor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Internet Messaging &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.miranda-im.org/  Miranda] ~ Multi IM ~ Lazycat&lt;br /&gt;
* [http://www.pidgin.im/ Pidgin] ~ Formerly Gaim ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Mail &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.poppeeper.com/ POP Peeper] ~ Email Client&amp;amp;Notifier ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/thunderbird/ Thunderbird] ~ Email software ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Maintenance &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://security.baidu.co.th/en/  Baidu PC Faster] ~ Advanced Optimization &amp;amp; Security Software ~ wakillon&lt;br /&gt;
* [http://www.piriform.com/ccleaner  CCleaner] ~ PC Cleanup Tool ~ Valuater&lt;br /&gt;
* [http://eraser.heidi.ie/  Eraser] ~ Stubborn File Removal ~ maqleod&lt;br /&gt;
* [http://www.free-codecs.com/download/K_Lite_Codec_Pack.htm  K-Lite Codec Pack] ~ Codecs ~ maqleod&lt;br /&gt;
* [http://www.bleepingcomputer.com/files/killbox.php  Pocket Killbox] ~ Stubborn File Removal Tool ~ jefhal&lt;br /&gt;
* [http://www.steffengerlach.de/freeware/ Scanner] ~ Hard disk usage monitor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Media Players &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.foobar2000.org/ foobar2000] ~ Advanced audio player~ LxP&lt;br /&gt;
* [http://www.jetaudio.com/download/ JetAudio Basic] ~  Media Player  ~ wakillon&lt;br /&gt;
* [http://sourceforge.net/projects/guliverkli/ Media Player Classic] ~ Media player~ LxP &lt;br /&gt;
* [http://mpc-hc.sourceforge.net/ Media Player Classic ( Home Cinema Edition )] ~ HD Video player ~ Chimaera&lt;br /&gt;
* [http://www.videolan.org/vlc/  VLC ] ~ Media Player ~ MSLx Fanboy&lt;br /&gt;
* [http://www.winamp.com/ WinAmp] ~ Media player ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Network &amp;amp; Internet &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [https://www.softperfect.com/products/networx NetWorx] ~ AIO Network Monitor ~ TheDcoder&lt;br /&gt;
* [http://keir.net/neutron.html Neutron] ~ Accurate time ~ LxP&lt;br /&gt;
* [http://www.uvnc.com/index.php UltraVNC] ~ Visual remote computing ~ LxP&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Passwords &amp;amp; Encryption &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.essentialpim.com/?r=products&amp;amp;pr=essentialpim&amp;amp;prr=features  EssentialPIM] ~ Personal Information Manager ~ Josbe&lt;br /&gt;
* [http://keepass.info/  Keepass] ~ Password Manager ~ /dev/null&lt;br /&gt;
* [http://passwordsafe.sourceforge.net/  Password Safe] ~ Password Management ~ maqleod&lt;br /&gt;
* [http://www.truecrypt.org/  TrueCrypt] ~ Encryption ~ photonbuddy&lt;br /&gt;
* [https://lastpass.com/ LastPass] ~ Password Management ~ BrewManNH&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; PDF &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://get.adobe.com/reader/ Adobe Reader] ~ PDF Reader ~ LxP&lt;br /&gt;
* [http://www.cutepdf.com/Products/CutePDF/writer.asp  Cute PDF] ~ Convert To PDF ~ CyberSlug&lt;br /&gt;
* [http://www.foxitsoftware.com/Secure_PDF_Reader/  Foxit Reader] ~ PDF Reader ~ ReFran&lt;br /&gt;
* [http://www.pdfforge.org/ PDF Creator] ~ PDF writer ~ LxP &lt;br /&gt;
* [http://www.acropdf.com/products.html PDF Speedup] ~ Speed up Adobe ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; XML &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.microsoft.com/en-us/download/details.aspx?id=7973 XML Notepad 2007] ~ XML Notepad 2007 provides a simple intuitive user interface for browsing and editing XML documents ~ mLipok&lt;br /&gt;
* [http://qutoric.com/xmlquire/ XMLQuire] ~ &amp;quot;This simple-to-use and free XML Editor brings a new editing experience&amp;quot; ~ mLipok (descripion comes from http://qutoric.com/xmlquire/)&lt;br /&gt;
* [https://xpathvisualizer.codeplex.com/ XPath Visualizer] ~ &amp;quot;XPathVisualizer is a simple, free Winforms tool to help you visualize the results of XPath queries on XML documents.&amp;quot; ~ mLipok (descripion comes from https://xpathvisualizer.codeplex.com)&lt;br /&gt;
* ON LINE XPath Tools:&lt;br /&gt;
http://www.xpathtester.com/xpath&lt;br /&gt;
http://codebeautify.org/Xpath-Tester&lt;br /&gt;
http://xpath.online-toolz.com/tools/xpath-editor.php&lt;br /&gt;
http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm&lt;br /&gt;
http://www.qutoric.com/xslt/analyser/xpathtool.html&lt;br /&gt;
https://addons.mozilla.org/en-US/firefox/addon/xpather/&lt;br /&gt;
http://www.xmlme.com/XpathTool.aspx&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Privacy * &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;* &#039;&#039;&#039;Using some of the software in this section will prevent normal access to the AutoIt site as proxies are not allowed. Discussions on automating these types of products is not permitted.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.privoxy.org/ Privoxy] ~ To filter incoming web pages ~ LxP &lt;br /&gt;
* [https://www.torproject.org/index.html Tor] ~ Anonymity software ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Resource Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.angusj.com/resourcehacker/ Resource Hacker] ~ Extract exe resources ~ LxP&lt;br /&gt;
* [http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#new XVI32] ~ Hex Editor ~ /dev/null&lt;br /&gt;
* [http://www.httrack.com/index.php  HTTTrack] ~ Website Copier ~ gcriaco&lt;br /&gt;
* [http://www.cthing.com/Meazure.asp  Meazure] ~ Window Info Tool ~ MHz&lt;br /&gt;
----&lt;br /&gt;
* [http://www.nliteos.com/index.html  nLite] ~ Win XP Deployment Tool ~ beerman&lt;br /&gt;
* [http://www.vlite.net/  vLite] ~ Win Vista Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.rt7lite.com/  RT 7 Lite] ~ Win 7 Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.2kr2.rt7lite.com/  RT Server Customizer] ~ Win Server 2008 R2 Deployment Tool ~ Chimaera&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Searches and Comparison &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.mythicsoft.com/page.aspx?type=agentransack&amp;amp;page=home  Agent Ransack] ~ File Finder With Regex ~ OldGuyWalking&lt;br /&gt;
* [http://tools.tortoisesvn.net/grepWin.html  grepWin] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://www.wingrep.com/index.htm  WinGrep] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://winmerge.org  WinMerge] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Startup Applications Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://codestuff.obninsk.ru/products_starter.html Starter] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://www.windowsstartup.com/ Startup Inspector] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://download.cnet.com/StartupMonitor/3000-2084_4-10637539.html Startup Monitor] ~  Startup applications Monitoring  ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Task Scheduling &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.codeproject.com/Articles/5371/ToDoList-6-4-6-An-effective-and-flexible-way-to-ke  ToDoList] ~ Task Scheduler ~ Valik&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Video Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.erightsoft.com/SUPER.html SUPER] ~  Audio &amp;amp; Video Converter, Recorder  ~ wakillon&lt;br /&gt;
* [http://www.virtualdub.org/  Virtualdub ] ~ Video Capture / Processing Utility ~ HardCopy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Learning &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.greatis.com/utilities/justtype/ Just Type] ~  Just Type  ~ mLipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Other &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.activexperts.com/freeware/ ACTIVEXPERTS FREEWARE UTILITIES] ~  Tools to monitor: Vmware ESXi servers and Virtual Machines, Citrix XenServer and Virtual Machines, Nimboxx VERDE VDI hosts and Gold Images. Tool to send SMS messages using a GSM modem. ~ mLipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13245</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13245"/>
		<updated>2015-09-29T20:14:19Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: Updated examples to use MsgBox constants&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;Func dbg($msg)&lt;br /&gt;
	 DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $msg)&lt;br /&gt;
 EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;dbg(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the forum rules&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as 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!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=12681</id>
		<title>Free Software</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=12681"/>
		<updated>2014-10-21T14:02:45Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /*  Browsers  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome To The Free Software Page ~ This page is a place to find useful free software recommended by the AutoIt community&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Archive &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.7-zip.org/  7 Zip] ~ Compression Utility ~ CyberSlug&lt;br /&gt;
* [http://legroom.net/software/uniextract Universal Extractor] ~ decompress and extract files from any type of archive or installer ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Antivirus, Malware &amp;amp; Spyware Programs &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.lavasoft.com/products/ad_aware_free.php Ad-Aware] ~ Antivirus Package ~ /dev/null &lt;br /&gt;
* [http://www.avast.com/index Avast] ~ Antivirus Package ~ killaz219&lt;br /&gt;
* [http://www.avira.com/en/avira-free-antivirus  Avira] ~ Antivirus Package ~ MSLx Fanboy&lt;br /&gt;
* [http://free.avg.com/gb-en/homepage AVG Free] ~ Antivirus Package ~ LxP&lt;br /&gt;
* [http://antivirus.baidu.com/en/  Baidu Antivirus] ~ Antivirus ~ wakillon&lt;br /&gt;
* [http://www.trendmicro.co.uk/products/free-tools-and-services/ Hijack This] ~ Threat Removal Tool. Should only be used if you know what you are doing. ~ jefhal&lt;br /&gt;
* [http://www.microsoft.com/security/pc-security/mse.aspx  Microsoft Security Essentials (WIN7 only)] ~ Malware/Spyware Tool ~ Valuater &lt;br /&gt;
* [http://www.safer-networking.org/en/index.html Spybot - Search &amp;amp; Destroy] ~ Spyware Removal ~ BigDod &lt;br /&gt;
* [http://www.javacoolsoftware.com/spywareblaster.html  SpywareBlaster] ~ Spyware Tool ~ forger&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Audio &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://audacity.sourceforge.net/ Audacity] ~ Audio Recording &amp;amp; Editing Tool ~ jefhal&lt;br /&gt;
* [http://mediaarea.net/en/MediaInfo MediaInfo] ~ Display technical and tag data for video and audio files ~ wakillon&lt;br /&gt;
* [http://mp3gain.sourceforge.net/ MP3Gain] ~ Normalize Music Files ~ maqleod &lt;br /&gt;
* [http://www.mp3tag.de/en/index.html Mp3tag] ~ Mp3 Metadata Editor ~ ning&lt;br /&gt;
* [http://www.synthfont.com/ SynthFont] ~ Midi Editing ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Browsers &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.qksoft.com/favorites-management-master/  Bookmark Master] ~ IE Bookmark Manager ~ MHz&lt;br /&gt;
* [http://toolbarcleaner.com/ Toolbar Cleaner] ~  Remove unwanted toolbars, apps, add-ons, and plug-ins   ~ wakillon&lt;br /&gt;
----&lt;br /&gt;
* [http://en.browser.baidu.com/  Baidu Spark Browser] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://chromium.woolyss.com/  Chromium] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/firefox/fx/ Firefox] ~ Web Browser ~ LxP&lt;br /&gt;
* [http://www.srware.net/en/software_srware_iron.php Iron] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.maxthon.com/  Maxthon] ~ Web Browser ~ MHz&lt;br /&gt;
* [http://www.opera.com/  Opera] ~ Browser ~ photonbuddy&lt;br /&gt;
* [http://support.apple.com/kb/dl1531 Safari] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.slimbrowser.net/en/ Slim Browser] ~ Web Browser ~ jefhal&lt;br /&gt;
* [http://browser.yandex.com/  Yandex] ~ Web Browser ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; CD &amp;amp; DVD Software &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.daemon-tools.cc/eng/products/dtLite  Daemon Tools Lite] ~ Virtual Disc Emulator ~ CyberSlug&lt;br /&gt;
* [http://www.deepburner.com/?r=products&amp;amp;pr=deepburner&amp;amp;prr=features  DeepBurner ] ~ CD/DVD Burner ~ MSLx Fanboy&lt;br /&gt;
* [http://www.magiciso.com/tutorials/miso-magicdisc-mount.htm MagicDisc] ~ Virtual CD/DVD-ROM ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Coding &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.autoitscript.com/site/ AutoIt] ~ Scripting Language ~ layer&lt;br /&gt;
* [http://www.jrsoftware.org/isinfo.php  Inno Setup] ~ Program Installer Setup ~ gcriaco&lt;br /&gt;
* [http://notepad-plus-plus.org/  Notepad++] ~ Source Code Editing ~ maqleod&lt;br /&gt;
* [http://www.pspad.com/en/ PSPad] ~ Universal Editor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Commandline &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://curl.haxx.se/ curl] ~ Commandline Https/Http/Ftp Client ~ /dev/null&lt;br /&gt;
* [http://www.ffmpeg.org/ FFmpeg] ~ Record, convert and stream audio and video ~ wakillon&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Document Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.openoffice.org/  Apache OpenOffice] ~ Office Suite ~ MSLx Fanboy&lt;br /&gt;
* [http://www.libreoffice.org/  LibreOffice] ~ Office Suite ~ Chimaera&lt;br /&gt;
* [http://liquidninja.com/metapad/ Metapad] ~ Notepad alternative ~ LxP &lt;br /&gt;
* [http://www.vim.org/ Vim] ~ Text Editor ~ /dev/null&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Explorer Replacements &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://explorerplusplus.com/ Explorer++] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://www.softwareok.com/?Freeware/Q-Dir Q-Dir] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://wde.codeplex.com/ Windows Double Explorer] ~  File manager for Windows ~ wakillon&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; FTP / Web Servers &amp;amp; Remote &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.jtsoft.com.pl/ A-Term] ~ Terminal emulator with API (COM / DLL) ~ mlipok&lt;br /&gt;
* [http://httpd.apache.org/  Apache] ~ Web Server ~ maqleod&lt;br /&gt;
* [http://filezilla-project.org/  Filezilla] ~ FTP Client &amp;amp; Server ~ MHz&lt;br /&gt;
* [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html putty] ~ SSP client ~ /dev/null&lt;br /&gt;
* [http://www.realvnc.com/  RealVNC] ~ Remote Control Software ~ ning&lt;br /&gt;
* [http://www.smartftp.com/ SmartFTP] ~ FTP client ~ LxP&lt;br /&gt;
* [http://www.teamviewer.com  TeamViewer] ~ Remote Desktop Software (More features than RealVNC and its free!)&lt;br /&gt;
* [http://www.ayera.com/teraterm/ TeraTerm Pro Web] ~ Enhanced Telnet/SSH2 Client ~ /dev/null&lt;br /&gt;
* [http://winscp.net/eng/index.php WinSCP] ~ FTP over SSH ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Image Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://blog.bahraniapps.com/ GifCam] ~  Animated gif creation  ~ wakillon&lt;br /&gt;
* [http://imageresizer.codeplex.com/  Image Resizer] ~ Image Manipulation ~ maqleod&lt;br /&gt;
* [http://inkscape.org/  Inkscape] ~ Vector Graphics Editor ~ Josbe&lt;br /&gt;
* [http://www.irfanview.com/ IrfanView] ~ Universal image editor ~ LxP&lt;br /&gt;
* [http://www.photofiltre-studio.com/pf7-en.htm PhotoFiltre] ~ Photo Editor ~ wakillon&lt;br /&gt;
* [http://picasa.google.co.uk/  Picasa] ~ Photo Editing Tool ~ jefhal&lt;br /&gt;
* [http://www.gimp.org/  The Gimp] ~ Image Editing ~ Blue_Drache &lt;br /&gt;
* [http://www.xnview.com/en/index.html  XnView] ~ Multimedia Convertor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Internet Messaging &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.miranda-im.org/  Miranda] ~ Multi IM ~ Lazycat&lt;br /&gt;
* [http://www.pidgin.im/ Pidgin] ~ Formerly Gaim ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Mail &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.poppeeper.com/ POP Peeper] ~ Email Client&amp;amp;Notifier ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/thunderbird/ Thunderbird] ~ Email software ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Maintenance &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://security.baidu.co.th/en/  Baidu PC Faster] ~ Advanced Optimization &amp;amp; Security Software ~ wakillon&lt;br /&gt;
* [http://www.piriform.com/ccleaner  CCleaner] ~ PC Cleanup Tool ~ Valuater&lt;br /&gt;
* [http://eraser.heidi.ie/  Eraser] ~ Stubborn File Removal ~ maqleod&lt;br /&gt;
* [http://www.free-codecs.com/download/K_Lite_Codec_Pack.htm  K-Lite Codec Pack] ~ Codecs ~ maqleod&lt;br /&gt;
* [http://www.bleepingcomputer.com/files/killbox.php  Pocket Killbox] ~ Stubborn File Removal Tool ~ jefhal&lt;br /&gt;
* [http://www.steffengerlach.de/freeware/ Scanner] ~ Hard disk usage monitor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Media Players &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.foobar2000.org/ foobar2000] ~ Advanced audio player~ LxP&lt;br /&gt;
* [http://www.jetaudio.com/download/ JetAudio Basic] ~  Media Player  ~ wakillon&lt;br /&gt;
* [http://sourceforge.net/projects/guliverkli/ Media Player Classic] ~ Media player~ LxP &lt;br /&gt;
* [http://mpc-hc.sourceforge.net/ Media Player Classic ( Home Cinema Edition )] ~ HD Video player ~ Chimaera&lt;br /&gt;
* [http://www.videolan.org/vlc/  VLC ] ~ Media Player ~ MSLx Fanboy&lt;br /&gt;
* [http://www.winamp.com/ WinAmp] ~ Media player ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Network &amp;amp; Internet &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://keir.net/neutron.html Neutron] ~ Accurate time ~ LxP&lt;br /&gt;
* [http://www.uvnc.com/index.php UltraVNC] ~ Visual remote computing ~ LxP&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Passwords &amp;amp; Encryption &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.essentialpim.com/?r=products&amp;amp;pr=essentialpim&amp;amp;prr=features  EssentialPIM] ~ Personal Information Manager ~ Josbe&lt;br /&gt;
* [http://keepass.info/  Keepass] ~ Password Manager ~ /dev/null&lt;br /&gt;
* [http://passwordsafe.sourceforge.net/  Password Safe] ~ Password Management ~ maqleod&lt;br /&gt;
* [http://www.truecrypt.org/  TrueCrypt] ~ Encryption ~ photonbuddy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; PDF &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://get.adobe.com/reader/ Adobe Reader] ~ PDF Reader ~ LxP&lt;br /&gt;
* [http://www.cutepdf.com/Products/CutePDF/writer.asp  Cute PDF] ~ Convert To PDF ~ CyberSlug&lt;br /&gt;
* [http://www.foxitsoftware.com/Secure_PDF_Reader/  Foxit Reader] ~ PDF Reader ~ ReFran&lt;br /&gt;
* [http://www.pdfforge.org/ PDF Creator] ~ PDF writer ~ LxP &lt;br /&gt;
* [http://www.acropdf.com/products.html PDF Speedup] ~ Speed up Adobe ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Privacy * &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;* &#039;&#039;&#039;Using some of the software in this section will prevent normal access to the AutoIt site as proxies are not allowed. Discussions on automating these types of products is not permitted.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.privoxy.org/ Privoxy] ~ To filter incoming web pages ~ LxP &lt;br /&gt;
* [https://www.torproject.org/index.html Tor] ~ Anonymity software ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Resource Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.angusj.com/resourcehacker/ Resource Hacker] ~ Extract exe resources ~ LxP&lt;br /&gt;
* [http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#new XVI32] ~ Hex Editor ~ /dev/null&lt;br /&gt;
* [http://www.httrack.com/index.php  HTTTrack] ~ Website Copier ~ gcriaco&lt;br /&gt;
* [http://www.cthing.com/Meazure.asp  Meazure] ~ Window Info Tool ~ MHz&lt;br /&gt;
----&lt;br /&gt;
* [http://www.nliteos.com/index.html  nLite] ~ Win XP Deployment Tool ~ beerman&lt;br /&gt;
* [http://www.vlite.net/  vLite] ~ Win Vista Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.rt7lite.com/  RT 7 Lite] ~ Win 7 Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.2kr2.rt7lite.com/  RT Server Customizer] ~ Win Server 2008 R2 Deployment Tool ~ Chimaera&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Searches and Comparison &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.mythicsoft.com/page.aspx?type=agentransack&amp;amp;page=home  Agent Ransack] ~ File Finder With Regex ~ OldGuyWalking&lt;br /&gt;
* [http://tools.tortoisesvn.net/grepWin.html  grepWin] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://www.wingrep.com/index.htm  WinGrep] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://winmerge.org  WinMerge] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Startup Applications Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://codestuff.obninsk.ru/products_starter.html Starter] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://www.windowsstartup.com/ Startup Inspector] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://download.cnet.com/StartupMonitor/3000-2084_4-10637539.html Startup Monitor] ~  Startup applications Monitoring  ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Task Scheduling &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.codeproject.com/Articles/5371/ToDoList-6-4-6-An-effective-and-flexible-way-to-ke  ToDoList] ~ Task Scheduler ~ Valik&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Video Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.erightsoft.com/SUPER.html SUPER] ~  Audio &amp;amp; Video Converter, Recorder  ~ wakillon&lt;br /&gt;
* [http://www.virtualdub.org/  Virtualdub ] ~ Video Capture / Processing Utility ~ HardCopy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Learning &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.greatis.com/utilities/justtype/ Just Type] ~  Just Type  ~ mLipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=12680</id>
		<title>Free Software</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=12680"/>
		<updated>2014-10-21T14:00:51Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /*  Audio  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome To The Free Software Page ~ This page is a place to find useful free software recommended by the AutoIt community&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Archive &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.7-zip.org/  7 Zip] ~ Compression Utility ~ CyberSlug&lt;br /&gt;
* [http://legroom.net/software/uniextract Universal Extractor] ~ decompress and extract files from any type of archive or installer ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Antivirus, Malware &amp;amp; Spyware Programs &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.lavasoft.com/products/ad_aware_free.php Ad-Aware] ~ Antivirus Package ~ /dev/null &lt;br /&gt;
* [http://www.avast.com/index Avast] ~ Antivirus Package ~ killaz219&lt;br /&gt;
* [http://www.avira.com/en/avira-free-antivirus  Avira] ~ Antivirus Package ~ MSLx Fanboy&lt;br /&gt;
* [http://free.avg.com/gb-en/homepage AVG Free] ~ Antivirus Package ~ LxP&lt;br /&gt;
* [http://antivirus.baidu.com/en/  Baidu Antivirus] ~ Antivirus ~ wakillon&lt;br /&gt;
* [http://www.trendmicro.co.uk/products/free-tools-and-services/ Hijack This] ~ Threat Removal Tool. Should only be used if you know what you are doing. ~ jefhal&lt;br /&gt;
* [http://www.microsoft.com/security/pc-security/mse.aspx  Microsoft Security Essentials (WIN7 only)] ~ Malware/Spyware Tool ~ Valuater &lt;br /&gt;
* [http://www.safer-networking.org/en/index.html Spybot - Search &amp;amp; Destroy] ~ Spyware Removal ~ BigDod &lt;br /&gt;
* [http://www.javacoolsoftware.com/spywareblaster.html  SpywareBlaster] ~ Spyware Tool ~ forger&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Audio &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://audacity.sourceforge.net/ Audacity] ~ Audio Recording &amp;amp; Editing Tool ~ jefhal&lt;br /&gt;
* [http://mediaarea.net/en/MediaInfo MediaInfo] ~ Display technical and tag data for video and audio files ~ wakillon&lt;br /&gt;
* [http://mp3gain.sourceforge.net/ MP3Gain] ~ Normalize Music Files ~ maqleod &lt;br /&gt;
* [http://www.mp3tag.de/en/index.html Mp3tag] ~ Mp3 Metadata Editor ~ ning&lt;br /&gt;
* [http://www.synthfont.com/ SynthFont] ~ Midi Editing ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Browsers &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.bookmark-master.com/  Bookmark Master] ~ IE Bookmark Manager ~ MHz&lt;br /&gt;
* [http://toolbarcleaner.com/ Toolbar Cleaner] ~  Remove unwanted toolbars, apps, add-ons, and plug-ins   ~ wakillon&lt;br /&gt;
----&lt;br /&gt;
* [http://en.browser.baidu.com/  Baidu Spark Browser] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://chromium.woolyss.com/  Chromium] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/firefox/fx/ Firefox] ~ Web Browser ~ LxP&lt;br /&gt;
* [http://www.srware.net/en/software_srware_iron.php Iron] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.maxthon.com/  Maxthon] ~ Web Browser ~ MHz&lt;br /&gt;
* [http://www.opera.com/  Opera] ~ Browser ~ photonbuddy&lt;br /&gt;
* [http://support.apple.com/kb/dl1531 Safari] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.slimbrowser.net/en/ Slim Browser] ~ Web Browser ~ jefhal&lt;br /&gt;
* [http://browser.yandex.com/  Yandex] ~ Web Browser ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; CD &amp;amp; DVD Software &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.daemon-tools.cc/eng/products/dtLite  Daemon Tools Lite] ~ Virtual Disc Emulator ~ CyberSlug&lt;br /&gt;
* [http://www.deepburner.com/?r=products&amp;amp;pr=deepburner&amp;amp;prr=features  DeepBurner ] ~ CD/DVD Burner ~ MSLx Fanboy&lt;br /&gt;
* [http://www.magiciso.com/tutorials/miso-magicdisc-mount.htm MagicDisc] ~ Virtual CD/DVD-ROM ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Coding &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.autoitscript.com/site/ AutoIt] ~ Scripting Language ~ layer&lt;br /&gt;
* [http://www.jrsoftware.org/isinfo.php  Inno Setup] ~ Program Installer Setup ~ gcriaco&lt;br /&gt;
* [http://notepad-plus-plus.org/  Notepad++] ~ Source Code Editing ~ maqleod&lt;br /&gt;
* [http://www.pspad.com/en/ PSPad] ~ Universal Editor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Commandline &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://curl.haxx.se/ curl] ~ Commandline Https/Http/Ftp Client ~ /dev/null&lt;br /&gt;
* [http://www.ffmpeg.org/ FFmpeg] ~ Record, convert and stream audio and video ~ wakillon&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Document Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.openoffice.org/  Apache OpenOffice] ~ Office Suite ~ MSLx Fanboy&lt;br /&gt;
* [http://www.libreoffice.org/  LibreOffice] ~ Office Suite ~ Chimaera&lt;br /&gt;
* [http://liquidninja.com/metapad/ Metapad] ~ Notepad alternative ~ LxP &lt;br /&gt;
* [http://www.vim.org/ Vim] ~ Text Editor ~ /dev/null&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Explorer Replacements &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://explorerplusplus.com/ Explorer++] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://www.softwareok.com/?Freeware/Q-Dir Q-Dir] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://wde.codeplex.com/ Windows Double Explorer] ~  File manager for Windows ~ wakillon&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; FTP / Web Servers &amp;amp; Remote &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.jtsoft.com.pl/ A-Term] ~ Terminal emulator with API (COM / DLL) ~ mlipok&lt;br /&gt;
* [http://httpd.apache.org/  Apache] ~ Web Server ~ maqleod&lt;br /&gt;
* [http://filezilla-project.org/  Filezilla] ~ FTP Client &amp;amp; Server ~ MHz&lt;br /&gt;
* [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html putty] ~ SSP client ~ /dev/null&lt;br /&gt;
* [http://www.realvnc.com/  RealVNC] ~ Remote Control Software ~ ning&lt;br /&gt;
* [http://www.smartftp.com/ SmartFTP] ~ FTP client ~ LxP&lt;br /&gt;
* [http://www.teamviewer.com  TeamViewer] ~ Remote Desktop Software (More features than RealVNC and its free!)&lt;br /&gt;
* [http://www.ayera.com/teraterm/ TeraTerm Pro Web] ~ Enhanced Telnet/SSH2 Client ~ /dev/null&lt;br /&gt;
* [http://winscp.net/eng/index.php WinSCP] ~ FTP over SSH ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Image Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://blog.bahraniapps.com/ GifCam] ~  Animated gif creation  ~ wakillon&lt;br /&gt;
* [http://imageresizer.codeplex.com/  Image Resizer] ~ Image Manipulation ~ maqleod&lt;br /&gt;
* [http://inkscape.org/  Inkscape] ~ Vector Graphics Editor ~ Josbe&lt;br /&gt;
* [http://www.irfanview.com/ IrfanView] ~ Universal image editor ~ LxP&lt;br /&gt;
* [http://www.photofiltre-studio.com/pf7-en.htm PhotoFiltre] ~ Photo Editor ~ wakillon&lt;br /&gt;
* [http://picasa.google.co.uk/  Picasa] ~ Photo Editing Tool ~ jefhal&lt;br /&gt;
* [http://www.gimp.org/  The Gimp] ~ Image Editing ~ Blue_Drache &lt;br /&gt;
* [http://www.xnview.com/en/index.html  XnView] ~ Multimedia Convertor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Internet Messaging &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.miranda-im.org/  Miranda] ~ Multi IM ~ Lazycat&lt;br /&gt;
* [http://www.pidgin.im/ Pidgin] ~ Formerly Gaim ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Mail &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.poppeeper.com/ POP Peeper] ~ Email Client&amp;amp;Notifier ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/thunderbird/ Thunderbird] ~ Email software ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Maintenance &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://security.baidu.co.th/en/  Baidu PC Faster] ~ Advanced Optimization &amp;amp; Security Software ~ wakillon&lt;br /&gt;
* [http://www.piriform.com/ccleaner  CCleaner] ~ PC Cleanup Tool ~ Valuater&lt;br /&gt;
* [http://eraser.heidi.ie/  Eraser] ~ Stubborn File Removal ~ maqleod&lt;br /&gt;
* [http://www.free-codecs.com/download/K_Lite_Codec_Pack.htm  K-Lite Codec Pack] ~ Codecs ~ maqleod&lt;br /&gt;
* [http://www.bleepingcomputer.com/files/killbox.php  Pocket Killbox] ~ Stubborn File Removal Tool ~ jefhal&lt;br /&gt;
* [http://www.steffengerlach.de/freeware/ Scanner] ~ Hard disk usage monitor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Media Players &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.foobar2000.org/ foobar2000] ~ Advanced audio player~ LxP&lt;br /&gt;
* [http://www.jetaudio.com/download/ JetAudio Basic] ~  Media Player  ~ wakillon&lt;br /&gt;
* [http://sourceforge.net/projects/guliverkli/ Media Player Classic] ~ Media player~ LxP &lt;br /&gt;
* [http://mpc-hc.sourceforge.net/ Media Player Classic ( Home Cinema Edition )] ~ HD Video player ~ Chimaera&lt;br /&gt;
* [http://www.videolan.org/vlc/  VLC ] ~ Media Player ~ MSLx Fanboy&lt;br /&gt;
* [http://www.winamp.com/ WinAmp] ~ Media player ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Network &amp;amp; Internet &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://keir.net/neutron.html Neutron] ~ Accurate time ~ LxP&lt;br /&gt;
* [http://www.uvnc.com/index.php UltraVNC] ~ Visual remote computing ~ LxP&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Passwords &amp;amp; Encryption &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.essentialpim.com/?r=products&amp;amp;pr=essentialpim&amp;amp;prr=features  EssentialPIM] ~ Personal Information Manager ~ Josbe&lt;br /&gt;
* [http://keepass.info/  Keepass] ~ Password Manager ~ /dev/null&lt;br /&gt;
* [http://passwordsafe.sourceforge.net/  Password Safe] ~ Password Management ~ maqleod&lt;br /&gt;
* [http://www.truecrypt.org/  TrueCrypt] ~ Encryption ~ photonbuddy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; PDF &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://get.adobe.com/reader/ Adobe Reader] ~ PDF Reader ~ LxP&lt;br /&gt;
* [http://www.cutepdf.com/Products/CutePDF/writer.asp  Cute PDF] ~ Convert To PDF ~ CyberSlug&lt;br /&gt;
* [http://www.foxitsoftware.com/Secure_PDF_Reader/  Foxit Reader] ~ PDF Reader ~ ReFran&lt;br /&gt;
* [http://www.pdfforge.org/ PDF Creator] ~ PDF writer ~ LxP &lt;br /&gt;
* [http://www.acropdf.com/products.html PDF Speedup] ~ Speed up Adobe ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Privacy * &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;* &#039;&#039;&#039;Using some of the software in this section will prevent normal access to the AutoIt site as proxies are not allowed. Discussions on automating these types of products is not permitted.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.privoxy.org/ Privoxy] ~ To filter incoming web pages ~ LxP &lt;br /&gt;
* [https://www.torproject.org/index.html Tor] ~ Anonymity software ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Resource Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.angusj.com/resourcehacker/ Resource Hacker] ~ Extract exe resources ~ LxP&lt;br /&gt;
* [http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#new XVI32] ~ Hex Editor ~ /dev/null&lt;br /&gt;
* [http://www.httrack.com/index.php  HTTTrack] ~ Website Copier ~ gcriaco&lt;br /&gt;
* [http://www.cthing.com/Meazure.asp  Meazure] ~ Window Info Tool ~ MHz&lt;br /&gt;
----&lt;br /&gt;
* [http://www.nliteos.com/index.html  nLite] ~ Win XP Deployment Tool ~ beerman&lt;br /&gt;
* [http://www.vlite.net/  vLite] ~ Win Vista Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.rt7lite.com/  RT 7 Lite] ~ Win 7 Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.2kr2.rt7lite.com/  RT Server Customizer] ~ Win Server 2008 R2 Deployment Tool ~ Chimaera&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Searches and Comparison &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.mythicsoft.com/page.aspx?type=agentransack&amp;amp;page=home  Agent Ransack] ~ File Finder With Regex ~ OldGuyWalking&lt;br /&gt;
* [http://tools.tortoisesvn.net/grepWin.html  grepWin] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://www.wingrep.com/index.htm  WinGrep] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://winmerge.org  WinMerge] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Startup Applications Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://codestuff.obninsk.ru/products_starter.html Starter] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://www.windowsstartup.com/ Startup Inspector] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://download.cnet.com/StartupMonitor/3000-2084_4-10637539.html Startup Monitor] ~  Startup applications Monitoring  ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Task Scheduling &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.codeproject.com/Articles/5371/ToDoList-6-4-6-An-effective-and-flexible-way-to-ke  ToDoList] ~ Task Scheduler ~ Valik&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Video Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.erightsoft.com/SUPER.html SUPER] ~  Audio &amp;amp; Video Converter, Recorder  ~ wakillon&lt;br /&gt;
* [http://www.virtualdub.org/  Virtualdub ] ~ Video Capture / Processing Utility ~ HardCopy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Learning &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.greatis.com/utilities/justtype/ Just Type] ~  Just Type  ~ mLipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=12679</id>
		<title>Free Software</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=12679"/>
		<updated>2014-10-21T13:56:41Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /*  Antivirus, Malware &amp;amp; Spyware Programs  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome To The Free Software Page ~ This page is a place to find useful free software recommended by the AutoIt community&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Archive &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.7-zip.org/  7 Zip] ~ Compression Utility ~ CyberSlug&lt;br /&gt;
* [http://legroom.net/software/uniextract Universal Extractor] ~ decompress and extract files from any type of archive or installer ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Antivirus, Malware &amp;amp; Spyware Programs &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.lavasoft.com/products/ad_aware_free.php Ad-Aware] ~ Antivirus Package ~ /dev/null &lt;br /&gt;
* [http://www.avast.com/index Avast] ~ Antivirus Package ~ killaz219&lt;br /&gt;
* [http://www.avira.com/en/avira-free-antivirus  Avira] ~ Antivirus Package ~ MSLx Fanboy&lt;br /&gt;
* [http://free.avg.com/gb-en/homepage AVG Free] ~ Antivirus Package ~ LxP&lt;br /&gt;
* [http://antivirus.baidu.com/en/  Baidu Antivirus] ~ Antivirus ~ wakillon&lt;br /&gt;
* [http://www.trendmicro.co.uk/products/free-tools-and-services/ Hijack This] ~ Threat Removal Tool. Should only be used if you know what you are doing. ~ jefhal&lt;br /&gt;
* [http://www.microsoft.com/security/pc-security/mse.aspx  Microsoft Security Essentials (WIN7 only)] ~ Malware/Spyware Tool ~ Valuater &lt;br /&gt;
* [http://www.safer-networking.org/en/index.html Spybot - Search &amp;amp; Destroy] ~ Spyware Removal ~ BigDod &lt;br /&gt;
* [http://www.javacoolsoftware.com/spywareblaster.html  SpywareBlaster] ~ Spyware Tool ~ forger&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Audio &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://audacity.sourceforge.net/  Audacity] ~ Audio Recording &amp;amp; Editing Tool ~ jefhal&lt;br /&gt;
* [http://mediaarea.net/en/MediaInfo/Download/Windows MediaInfo] ~ Display technical and tag data for video and audio files ~ wakillon&lt;br /&gt;
* [http://mp3gain.sourceforge.net/  MP3Gain] ~ Normalize Music Files ~ maqleod &lt;br /&gt;
* [http://www.mp3tag.de/en/index.html  Mp3tag] ~ Mp3 Metadata Editor ~ ning&lt;br /&gt;
* [http://www.synthfont.com/  SynthFont] ~ Midi Editing ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Browsers &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.bookmark-master.com/  Bookmark Master] ~ IE Bookmark Manager ~ MHz&lt;br /&gt;
* [http://toolbarcleaner.com/ Toolbar Cleaner] ~  Remove unwanted toolbars, apps, add-ons, and plug-ins   ~ wakillon&lt;br /&gt;
----&lt;br /&gt;
* [http://en.browser.baidu.com/  Baidu Spark Browser] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://chromium.woolyss.com/  Chromium] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/firefox/fx/ Firefox] ~ Web Browser ~ LxP&lt;br /&gt;
* [http://www.srware.net/en/software_srware_iron.php Iron] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.maxthon.com/  Maxthon] ~ Web Browser ~ MHz&lt;br /&gt;
* [http://www.opera.com/  Opera] ~ Browser ~ photonbuddy&lt;br /&gt;
* [http://support.apple.com/kb/dl1531 Safari] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.slimbrowser.net/en/ Slim Browser] ~ Web Browser ~ jefhal&lt;br /&gt;
* [http://browser.yandex.com/  Yandex] ~ Web Browser ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; CD &amp;amp; DVD Software &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.daemon-tools.cc/eng/products/dtLite  Daemon Tools Lite] ~ Virtual Disc Emulator ~ CyberSlug&lt;br /&gt;
* [http://www.deepburner.com/?r=products&amp;amp;pr=deepburner&amp;amp;prr=features  DeepBurner ] ~ CD/DVD Burner ~ MSLx Fanboy&lt;br /&gt;
* [http://www.magiciso.com/tutorials/miso-magicdisc-mount.htm MagicDisc] ~ Virtual CD/DVD-ROM ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Coding &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.autoitscript.com/site/ AutoIt] ~ Scripting Language ~ layer&lt;br /&gt;
* [http://www.jrsoftware.org/isinfo.php  Inno Setup] ~ Program Installer Setup ~ gcriaco&lt;br /&gt;
* [http://notepad-plus-plus.org/  Notepad++] ~ Source Code Editing ~ maqleod&lt;br /&gt;
* [http://www.pspad.com/en/ PSPad] ~ Universal Editor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Commandline &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://curl.haxx.se/ curl] ~ Commandline Https/Http/Ftp Client ~ /dev/null&lt;br /&gt;
* [http://www.ffmpeg.org/ FFmpeg] ~ Record, convert and stream audio and video ~ wakillon&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Document Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.openoffice.org/  Apache OpenOffice] ~ Office Suite ~ MSLx Fanboy&lt;br /&gt;
* [http://www.libreoffice.org/  LibreOffice] ~ Office Suite ~ Chimaera&lt;br /&gt;
* [http://liquidninja.com/metapad/ Metapad] ~ Notepad alternative ~ LxP &lt;br /&gt;
* [http://www.vim.org/ Vim] ~ Text Editor ~ /dev/null&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Explorer Replacements &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://explorerplusplus.com/ Explorer++] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://www.softwareok.com/?Freeware/Q-Dir Q-Dir] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://wde.codeplex.com/ Windows Double Explorer] ~  File manager for Windows ~ wakillon&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; FTP / Web Servers &amp;amp; Remote &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.jtsoft.com.pl/ A-Term] ~ Terminal emulator with API (COM / DLL) ~ mlipok&lt;br /&gt;
* [http://httpd.apache.org/  Apache] ~ Web Server ~ maqleod&lt;br /&gt;
* [http://filezilla-project.org/  Filezilla] ~ FTP Client &amp;amp; Server ~ MHz&lt;br /&gt;
* [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html putty] ~ SSP client ~ /dev/null&lt;br /&gt;
* [http://www.realvnc.com/  RealVNC] ~ Remote Control Software ~ ning&lt;br /&gt;
* [http://www.smartftp.com/ SmartFTP] ~ FTP client ~ LxP&lt;br /&gt;
* [http://www.teamviewer.com  TeamViewer] ~ Remote Desktop Software (More features than RealVNC and its free!)&lt;br /&gt;
* [http://www.ayera.com/teraterm/ TeraTerm Pro Web] ~ Enhanced Telnet/SSH2 Client ~ /dev/null&lt;br /&gt;
* [http://winscp.net/eng/index.php WinSCP] ~ FTP over SSH ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Image Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://blog.bahraniapps.com/ GifCam] ~  Animated gif creation  ~ wakillon&lt;br /&gt;
* [http://imageresizer.codeplex.com/  Image Resizer] ~ Image Manipulation ~ maqleod&lt;br /&gt;
* [http://inkscape.org/  Inkscape] ~ Vector Graphics Editor ~ Josbe&lt;br /&gt;
* [http://www.irfanview.com/ IrfanView] ~ Universal image editor ~ LxP&lt;br /&gt;
* [http://www.photofiltre-studio.com/pf7-en.htm PhotoFiltre] ~ Photo Editor ~ wakillon&lt;br /&gt;
* [http://picasa.google.co.uk/  Picasa] ~ Photo Editing Tool ~ jefhal&lt;br /&gt;
* [http://www.gimp.org/  The Gimp] ~ Image Editing ~ Blue_Drache &lt;br /&gt;
* [http://www.xnview.com/en/index.html  XnView] ~ Multimedia Convertor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Internet Messaging &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.miranda-im.org/  Miranda] ~ Multi IM ~ Lazycat&lt;br /&gt;
* [http://www.pidgin.im/ Pidgin] ~ Formerly Gaim ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Mail &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.poppeeper.com/ POP Peeper] ~ Email Client&amp;amp;Notifier ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/thunderbird/ Thunderbird] ~ Email software ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Maintenance &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://security.baidu.co.th/en/  Baidu PC Faster] ~ Advanced Optimization &amp;amp; Security Software ~ wakillon&lt;br /&gt;
* [http://www.piriform.com/ccleaner  CCleaner] ~ PC Cleanup Tool ~ Valuater&lt;br /&gt;
* [http://eraser.heidi.ie/  Eraser] ~ Stubborn File Removal ~ maqleod&lt;br /&gt;
* [http://www.free-codecs.com/download/K_Lite_Codec_Pack.htm  K-Lite Codec Pack] ~ Codecs ~ maqleod&lt;br /&gt;
* [http://www.bleepingcomputer.com/files/killbox.php  Pocket Killbox] ~ Stubborn File Removal Tool ~ jefhal&lt;br /&gt;
* [http://www.steffengerlach.de/freeware/ Scanner] ~ Hard disk usage monitor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Media Players &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.foobar2000.org/ foobar2000] ~ Advanced audio player~ LxP&lt;br /&gt;
* [http://www.jetaudio.com/download/ JetAudio Basic] ~  Media Player  ~ wakillon&lt;br /&gt;
* [http://sourceforge.net/projects/guliverkli/ Media Player Classic] ~ Media player~ LxP &lt;br /&gt;
* [http://mpc-hc.sourceforge.net/ Media Player Classic ( Home Cinema Edition )] ~ HD Video player ~ Chimaera&lt;br /&gt;
* [http://www.videolan.org/vlc/  VLC ] ~ Media Player ~ MSLx Fanboy&lt;br /&gt;
* [http://www.winamp.com/ WinAmp] ~ Media player ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Network &amp;amp; Internet &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://keir.net/neutron.html Neutron] ~ Accurate time ~ LxP&lt;br /&gt;
* [http://www.uvnc.com/index.php UltraVNC] ~ Visual remote computing ~ LxP&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Passwords &amp;amp; Encryption &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.essentialpim.com/?r=products&amp;amp;pr=essentialpim&amp;amp;prr=features  EssentialPIM] ~ Personal Information Manager ~ Josbe&lt;br /&gt;
* [http://keepass.info/  Keepass] ~ Password Manager ~ /dev/null&lt;br /&gt;
* [http://passwordsafe.sourceforge.net/  Password Safe] ~ Password Management ~ maqleod&lt;br /&gt;
* [http://www.truecrypt.org/  TrueCrypt] ~ Encryption ~ photonbuddy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; PDF &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://get.adobe.com/reader/ Adobe Reader] ~ PDF Reader ~ LxP&lt;br /&gt;
* [http://www.cutepdf.com/Products/CutePDF/writer.asp  Cute PDF] ~ Convert To PDF ~ CyberSlug&lt;br /&gt;
* [http://www.foxitsoftware.com/Secure_PDF_Reader/  Foxit Reader] ~ PDF Reader ~ ReFran&lt;br /&gt;
* [http://www.pdfforge.org/ PDF Creator] ~ PDF writer ~ LxP &lt;br /&gt;
* [http://www.acropdf.com/products.html PDF Speedup] ~ Speed up Adobe ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Privacy * &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;* &#039;&#039;&#039;Using some of the software in this section will prevent normal access to the AutoIt site as proxies are not allowed. Discussions on automating these types of products is not permitted.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.privoxy.org/ Privoxy] ~ To filter incoming web pages ~ LxP &lt;br /&gt;
* [https://www.torproject.org/index.html Tor] ~ Anonymity software ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Resource Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.angusj.com/resourcehacker/ Resource Hacker] ~ Extract exe resources ~ LxP&lt;br /&gt;
* [http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#new XVI32] ~ Hex Editor ~ /dev/null&lt;br /&gt;
* [http://www.httrack.com/index.php  HTTTrack] ~ Website Copier ~ gcriaco&lt;br /&gt;
* [http://www.cthing.com/Meazure.asp  Meazure] ~ Window Info Tool ~ MHz&lt;br /&gt;
----&lt;br /&gt;
* [http://www.nliteos.com/index.html  nLite] ~ Win XP Deployment Tool ~ beerman&lt;br /&gt;
* [http://www.vlite.net/  vLite] ~ Win Vista Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.rt7lite.com/  RT 7 Lite] ~ Win 7 Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.2kr2.rt7lite.com/  RT Server Customizer] ~ Win Server 2008 R2 Deployment Tool ~ Chimaera&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Searches and Comparison &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.mythicsoft.com/page.aspx?type=agentransack&amp;amp;page=home  Agent Ransack] ~ File Finder With Regex ~ OldGuyWalking&lt;br /&gt;
* [http://tools.tortoisesvn.net/grepWin.html  grepWin] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://www.wingrep.com/index.htm  WinGrep] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://winmerge.org  WinMerge] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Startup Applications Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://codestuff.obninsk.ru/products_starter.html Starter] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://www.windowsstartup.com/ Startup Inspector] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://download.cnet.com/StartupMonitor/3000-2084_4-10637539.html Startup Monitor] ~  Startup applications Monitoring  ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Task Scheduling &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.codeproject.com/Articles/5371/ToDoList-6-4-6-An-effective-and-flexible-way-to-ke  ToDoList] ~ Task Scheduler ~ Valik&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Video Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.erightsoft.com/SUPER.html SUPER] ~  Audio &amp;amp; Video Converter, Recorder  ~ wakillon&lt;br /&gt;
* [http://www.virtualdub.org/  Virtualdub ] ~ Video Capture / Processing Utility ~ HardCopy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Learning &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.greatis.com/utilities/justtype/ Just Type] ~  Just Type  ~ mLipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=12678</id>
		<title>Free Software</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Free_Software&amp;diff=12678"/>
		<updated>2014-10-21T13:55:15Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /*  Antivirus, Malware &amp;amp; Spyware Programs  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome To The Free Software Page ~ This page is a place to find useful free software recommended by the AutoIt community&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Archive &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.7-zip.org/  7 Zip] ~ Compression Utility ~ CyberSlug&lt;br /&gt;
* [http://legroom.net/software/uniextract Universal Extractor] ~ decompress and extract files from any type of archive or installer ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Antivirus, Malware &amp;amp; Spyware Programs &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.lavasoft.com/products/ad_aware_free.php Ad-Aware] ~ Antivirus Package ~ /dev/null &lt;br /&gt;
* [http://www.avast.com/index Avast] ~ Antivirus Package ~ killaz219&lt;br /&gt;
* [http://www.avira.com/en/avira-free-antivirus  Avira] ~ Antivirus Package ~ MSLx Fanboy&lt;br /&gt;
* [http://free.avg.com/gb-en/homepage AVG Free] ~ Antivirus Package ~ LxP&lt;br /&gt;
* [http://antivirus.baidu.com/en/  Baidu Antivirus] ~ Antivirus ~ wakillon&lt;br /&gt;
* [http://www.trendmicro.co.uk/products/free-tools-and-services/ Hijack This] ~ Threat Removal Tool. Should only be used if you know what you are doing. ~ jefhal&lt;br /&gt;
* [http://www.microsoft.com/security/pc-security/mse.aspx  Microsoft Security Essentials] ~ Malware/Spyware Tool ~ Valuater &lt;br /&gt;
* [http://www.safer-networking.org/en/index.html Spybot - Search &amp;amp; Destroy] ~ Spyware Removal ~ BigDod &lt;br /&gt;
* [http://www.javacoolsoftware.com/spywareblaster.html  SpywareBlaster] ~ Spyware Tool ~ forger&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Audio &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://audacity.sourceforge.net/  Audacity] ~ Audio Recording &amp;amp; Editing Tool ~ jefhal&lt;br /&gt;
* [http://mediaarea.net/en/MediaInfo/Download/Windows MediaInfo] ~ Display technical and tag data for video and audio files ~ wakillon&lt;br /&gt;
* [http://mp3gain.sourceforge.net/  MP3Gain] ~ Normalize Music Files ~ maqleod &lt;br /&gt;
* [http://www.mp3tag.de/en/index.html  Mp3tag] ~ Mp3 Metadata Editor ~ ning&lt;br /&gt;
* [http://www.synthfont.com/  SynthFont] ~ Midi Editing ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Browsers &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.bookmark-master.com/  Bookmark Master] ~ IE Bookmark Manager ~ MHz&lt;br /&gt;
* [http://toolbarcleaner.com/ Toolbar Cleaner] ~  Remove unwanted toolbars, apps, add-ons, and plug-ins   ~ wakillon&lt;br /&gt;
----&lt;br /&gt;
* [http://en.browser.baidu.com/  Baidu Spark Browser] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://chromium.woolyss.com/  Chromium] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/firefox/fx/ Firefox] ~ Web Browser ~ LxP&lt;br /&gt;
* [http://www.srware.net/en/software_srware_iron.php Iron] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.maxthon.com/  Maxthon] ~ Web Browser ~ MHz&lt;br /&gt;
* [http://www.opera.com/  Opera] ~ Browser ~ photonbuddy&lt;br /&gt;
* [http://support.apple.com/kb/dl1531 Safari] ~ Web Browser ~ wakillon&lt;br /&gt;
* [http://www.slimbrowser.net/en/ Slim Browser] ~ Web Browser ~ jefhal&lt;br /&gt;
* [http://browser.yandex.com/  Yandex] ~ Web Browser ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; CD &amp;amp; DVD Software &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.daemon-tools.cc/eng/products/dtLite  Daemon Tools Lite] ~ Virtual Disc Emulator ~ CyberSlug&lt;br /&gt;
* [http://www.deepburner.com/?r=products&amp;amp;pr=deepburner&amp;amp;prr=features  DeepBurner ] ~ CD/DVD Burner ~ MSLx Fanboy&lt;br /&gt;
* [http://www.magiciso.com/tutorials/miso-magicdisc-mount.htm MagicDisc] ~ Virtual CD/DVD-ROM ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Coding &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.autoitscript.com/site/ AutoIt] ~ Scripting Language ~ layer&lt;br /&gt;
* [http://www.jrsoftware.org/isinfo.php  Inno Setup] ~ Program Installer Setup ~ gcriaco&lt;br /&gt;
* [http://notepad-plus-plus.org/  Notepad++] ~ Source Code Editing ~ maqleod&lt;br /&gt;
* [http://www.pspad.com/en/ PSPad] ~ Universal Editor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Commandline &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://curl.haxx.se/ curl] ~ Commandline Https/Http/Ftp Client ~ /dev/null&lt;br /&gt;
* [http://www.ffmpeg.org/ FFmpeg] ~ Record, convert and stream audio and video ~ wakillon&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Document Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.openoffice.org/  Apache OpenOffice] ~ Office Suite ~ MSLx Fanboy&lt;br /&gt;
* [http://www.libreoffice.org/  LibreOffice] ~ Office Suite ~ Chimaera&lt;br /&gt;
* [http://liquidninja.com/metapad/ Metapad] ~ Notepad alternative ~ LxP &lt;br /&gt;
* [http://www.vim.org/ Vim] ~ Text Editor ~ /dev/null&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Explorer Replacements &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://explorerplusplus.com/ Explorer++] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://www.softwareok.com/?Freeware/Q-Dir Q-Dir] ~  File manager for Windows ~ wakillon&lt;br /&gt;
* [http://wde.codeplex.com/ Windows Double Explorer] ~  File manager for Windows ~ wakillon&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; FTP / Web Servers &amp;amp; Remote &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.jtsoft.com.pl/ A-Term] ~ Terminal emulator with API (COM / DLL) ~ mlipok&lt;br /&gt;
* [http://httpd.apache.org/  Apache] ~ Web Server ~ maqleod&lt;br /&gt;
* [http://filezilla-project.org/  Filezilla] ~ FTP Client &amp;amp; Server ~ MHz&lt;br /&gt;
* [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html putty] ~ SSP client ~ /dev/null&lt;br /&gt;
* [http://www.realvnc.com/  RealVNC] ~ Remote Control Software ~ ning&lt;br /&gt;
* [http://www.smartftp.com/ SmartFTP] ~ FTP client ~ LxP&lt;br /&gt;
* [http://www.teamviewer.com  TeamViewer] ~ Remote Desktop Software (More features than RealVNC and its free!)&lt;br /&gt;
* [http://www.ayera.com/teraterm/ TeraTerm Pro Web] ~ Enhanced Telnet/SSH2 Client ~ /dev/null&lt;br /&gt;
* [http://winscp.net/eng/index.php WinSCP] ~ FTP over SSH ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Image Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://blog.bahraniapps.com/ GifCam] ~  Animated gif creation  ~ wakillon&lt;br /&gt;
* [http://imageresizer.codeplex.com/  Image Resizer] ~ Image Manipulation ~ maqleod&lt;br /&gt;
* [http://inkscape.org/  Inkscape] ~ Vector Graphics Editor ~ Josbe&lt;br /&gt;
* [http://www.irfanview.com/ IrfanView] ~ Universal image editor ~ LxP&lt;br /&gt;
* [http://www.photofiltre-studio.com/pf7-en.htm PhotoFiltre] ~ Photo Editor ~ wakillon&lt;br /&gt;
* [http://picasa.google.co.uk/  Picasa] ~ Photo Editing Tool ~ jefhal&lt;br /&gt;
* [http://www.gimp.org/  The Gimp] ~ Image Editing ~ Blue_Drache &lt;br /&gt;
* [http://www.xnview.com/en/index.html  XnView] ~ Multimedia Convertor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Internet Messaging &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.miranda-im.org/  Miranda] ~ Multi IM ~ Lazycat&lt;br /&gt;
* [http://www.pidgin.im/ Pidgin] ~ Formerly Gaim ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Mail &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.poppeeper.com/ POP Peeper] ~ Email Client&amp;amp;Notifier ~ wakillon&lt;br /&gt;
* [http://www.mozilla.org/en-US/thunderbird/ Thunderbird] ~ Email software ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Maintenance &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://security.baidu.co.th/en/  Baidu PC Faster] ~ Advanced Optimization &amp;amp; Security Software ~ wakillon&lt;br /&gt;
* [http://www.piriform.com/ccleaner  CCleaner] ~ PC Cleanup Tool ~ Valuater&lt;br /&gt;
* [http://eraser.heidi.ie/  Eraser] ~ Stubborn File Removal ~ maqleod&lt;br /&gt;
* [http://www.free-codecs.com/download/K_Lite_Codec_Pack.htm  K-Lite Codec Pack] ~ Codecs ~ maqleod&lt;br /&gt;
* [http://www.bleepingcomputer.com/files/killbox.php  Pocket Killbox] ~ Stubborn File Removal Tool ~ jefhal&lt;br /&gt;
* [http://www.steffengerlach.de/freeware/ Scanner] ~ Hard disk usage monitor ~ LxP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Media Players &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.foobar2000.org/ foobar2000] ~ Advanced audio player~ LxP&lt;br /&gt;
* [http://www.jetaudio.com/download/ JetAudio Basic] ~  Media Player  ~ wakillon&lt;br /&gt;
* [http://sourceforge.net/projects/guliverkli/ Media Player Classic] ~ Media player~ LxP &lt;br /&gt;
* [http://mpc-hc.sourceforge.net/ Media Player Classic ( Home Cinema Edition )] ~ HD Video player ~ Chimaera&lt;br /&gt;
* [http://www.videolan.org/vlc/  VLC ] ~ Media Player ~ MSLx Fanboy&lt;br /&gt;
* [http://www.winamp.com/ WinAmp] ~ Media player ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Network &amp;amp; Internet &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://keir.net/neutron.html Neutron] ~ Accurate time ~ LxP&lt;br /&gt;
* [http://www.uvnc.com/index.php UltraVNC] ~ Visual remote computing ~ LxP&lt;br /&gt;
* [http://www.poweradmin.com/paexec PAExec] ~ Launch Remote Windows Apps (PSEXEC &#039;&#039;&#039;Free&#039;&#039;&#039; alternative) ~ Pincopanco&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Passwords &amp;amp; Encryption &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.essentialpim.com/?r=products&amp;amp;pr=essentialpim&amp;amp;prr=features  EssentialPIM] ~ Personal Information Manager ~ Josbe&lt;br /&gt;
* [http://keepass.info/  Keepass] ~ Password Manager ~ /dev/null&lt;br /&gt;
* [http://passwordsafe.sourceforge.net/  Password Safe] ~ Password Management ~ maqleod&lt;br /&gt;
* [http://www.truecrypt.org/  TrueCrypt] ~ Encryption ~ photonbuddy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; PDF &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://get.adobe.com/reader/ Adobe Reader] ~ PDF Reader ~ LxP&lt;br /&gt;
* [http://www.cutepdf.com/Products/CutePDF/writer.asp  Cute PDF] ~ Convert To PDF ~ CyberSlug&lt;br /&gt;
* [http://www.foxitsoftware.com/Secure_PDF_Reader/  Foxit Reader] ~ PDF Reader ~ ReFran&lt;br /&gt;
* [http://www.pdfforge.org/ PDF Creator] ~ PDF writer ~ LxP &lt;br /&gt;
* [http://www.acropdf.com/products.html PDF Speedup] ~ Speed up Adobe ~ LxP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Privacy * &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;* &#039;&#039;&#039;Using some of the software in this section will prevent normal access to the AutoIt site as proxies are not allowed. Discussions on automating these types of products is not permitted.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.privoxy.org/ Privoxy] ~ To filter incoming web pages ~ LxP &lt;br /&gt;
* [https://www.torproject.org/index.html Tor] ~ Anonymity software ~ killaz219&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Resource Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.angusj.com/resourcehacker/ Resource Hacker] ~ Extract exe resources ~ LxP&lt;br /&gt;
* [http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#new XVI32] ~ Hex Editor ~ /dev/null&lt;br /&gt;
* [http://www.httrack.com/index.php  HTTTrack] ~ Website Copier ~ gcriaco&lt;br /&gt;
* [http://www.cthing.com/Meazure.asp  Meazure] ~ Window Info Tool ~ MHz&lt;br /&gt;
----&lt;br /&gt;
* [http://www.nliteos.com/index.html  nLite] ~ Win XP Deployment Tool ~ beerman&lt;br /&gt;
* [http://www.vlite.net/  vLite] ~ Win Vista Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.rt7lite.com/  RT 7 Lite] ~ Win 7 Deployment Tool ~ Chimaera&lt;br /&gt;
* [http://www.2kr2.rt7lite.com/  RT Server Customizer] ~ Win Server 2008 R2 Deployment Tool ~ Chimaera&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Searches and Comparison &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.mythicsoft.com/page.aspx?type=agentransack&amp;amp;page=home  Agent Ransack] ~ File Finder With Regex ~ OldGuyWalking&lt;br /&gt;
* [http://tools.tortoisesvn.net/grepWin.html  grepWin] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://www.wingrep.com/index.htm  WinGrep] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
* [http://winmerge.org  WinMerge] ~ File Finder With Regex ~ mlipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Startup Applications Management &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://codestuff.obninsk.ru/products_starter.html Starter] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://www.windowsstartup.com/ Startup Inspector] ~  Manage Windows startup applications  ~ wakillon&lt;br /&gt;
* [http://download.cnet.com/StartupMonitor/3000-2084_4-10637539.html Startup Monitor] ~  Startup applications Monitoring  ~ wakillon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Task Scheduling &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.codeproject.com/Articles/5371/ToDoList-6-4-6-An-effective-and-flexible-way-to-ke  ToDoList] ~ Task Scheduler ~ Valik&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Video Editing &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.erightsoft.com/SUPER.html SUPER] ~  Audio &amp;amp; Video Converter, Recorder  ~ wakillon&lt;br /&gt;
* [http://www.virtualdub.org/  Virtualdub ] ~ Video Capture / Processing Utility ~ HardCopy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;blockquote style=&amp;quot;background-color:white; padding:1em; border:2px solid #8FBC8F&amp;quot;&amp;gt;&#039;&#039;&#039; Learning &#039;&#039;&#039;&amp;lt;/blockquote&amp;gt; =====&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* [http://www.greatis.com/utilities/justtype/ Just Type] ~  Just Type  ~ mLipok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Function_list&amp;diff=12677</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Function_list&amp;diff=12677"/>
		<updated>2014-10-21T13:50:29Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This function list should be a duplicate of the one found on the [http://www.autoitscript.com/autoit3/docs/functions.htm function list] found in the standard documentation. If the content differs then the other page takes precedence. Some effort has been made to add value to the contents of this page over that one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Functon name&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Abs}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the absolute value of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ACos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the arccosine of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|AdlibRegister}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Registers an Adlib function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|AdlibUnRegister}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unregisters an Adlib function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Asc}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the ASCII code of a character.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|AscW}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the unicode code of a character.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ASin}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the arcsine of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Assign}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assigns a variable by name with the data.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ATan}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the arctangent of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|AutoItSetOption}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the operation of various AutoIt functions/parameters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|AutoItWinGetTitle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the title of the AutoIt window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|AutoItWinSetTitle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the title of the AutoIt window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Beep}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Plays back a beep to the user.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Binary}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a binary representation of an expression.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BinaryLen}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the number of bytes in a binary variant.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BinaryMid}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Extracts the number of bytes from a binary variant.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BinaryToString}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts a binary variant into a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BitAND}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Performs a bitwise AND operation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BitNOT}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Performs a bitwise NOT operation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BitOR}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Performs a bitwise OR operation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BitRotate}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Performs a bit shifting operation with rotation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BitShift}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Performs a bit shifting operation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BitXOR}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Performs a bitwise exclusive OR operation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|BlockInput}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Disables/Enables user input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Break}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Enable/Disable the user&#039;s ability to exit a script from the tray icon menu.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Call}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calls a user-defined function contained in a string parameter.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|CDTray}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Opens or closes the CD tray.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Ceiling}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a number rounded up to the next integer.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Chr}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a character corresponding to an ASCII code.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ChrW}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a character representation to a unicode code.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ClipGet}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves text from clipboard.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ClipPut}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Writes text to clipboard.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ConsoleRead}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Read from STDIN stream of the AutoIt script process.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ConsoleWrite}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Writes data to the STDOUT stream.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ConsoleWriteError}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Writes data to the STDERR stream.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlClick}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a mouse click command to a given control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlCommand}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a command to a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlDisable}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Disables a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlEnable}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Enables a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlFocus}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets input focus to a given control on a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlGetFocus}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the ControlRef# of the control that has keyboard focus within a specified window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlGetHandle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the internal handle of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlGetPos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the position and size of a control relative to it&#039;s window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlGetText}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves text from a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlHide}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Hides a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlListView}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a command to a ListView32 control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlMove}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Moves a control within a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlSend}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a string of characters to a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlSetText}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets text of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlShow}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unhides a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ControlTreeView}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a command to a TreeView32 control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Cos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the cosine of a value.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Dec}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a numeric representation of a hexadecimal string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DirCopy}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Copy a directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DirCreate}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DirGetSize}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the size in bytes of a given directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DirMove}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Move/Rename a directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DirRemove}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Delete a directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllCall}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Dynamically calls a function in a DLL.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllCallAddress}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Dynamically calls a function at a specific memory address.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllCallbackFree}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Frees a previously created handle created with DLLCallbackRegister.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllCallbackGetPtr}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the pointer to a callback function that can be passed to the Win32 API.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllCallbackRegister}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a user-defined DLL Callback function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllClose}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Closes a previously opened DLL.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllOpen}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Opens a DLL file for use in DllCall.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllStructCreate}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a C/C++ style structure to be used in DllCall.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllStructGetData}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;returns the data of an element of the struct.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllStructGetPtr}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the pointer to the struct or an element in the struct.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllStructGetSize}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the size of the struct in bytes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DllStructSetData}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the data of an element in the struct.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveGetDrive}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns an array containing the enumerated drives.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveGetFileSystem}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns File System Type of drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveGetLabel}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns Volume Label of a drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveGetSerial}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns Serial Number of a drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveGetType}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns drive type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveMapAdd}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Maps a network drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveMapDel}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Disconnects a network drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveMapGet}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the details of a mapped drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveSetLabel}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the Volume Label of a drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveSpaceFree}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the free disk space of a path in Megabytes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveSpaceTotal}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the total disk space of a path in Megabytes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|DriveStatus}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the status of the drive as a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|EnvGet}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves an environment variable.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|EnvSet}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Writes an environment variable.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|EnvUpdate}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Refreshes the OS environment.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Eval}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the value of the variable defined by a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Execute}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Execute an expression.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Exp}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates &#039;&#039;&#039;&amp;lt;i&amp;gt;e&amp;lt;/i&amp;gt;&#039;&#039;&#039; to the power of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileChangeDir}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the current working directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileClose}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Closes a previously opened file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileCopy}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Copies one or more files.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileCreateNTFSLink}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates an NTFS hardlink to a file or directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileCreateShortcut}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a shortcut (.lnk) to a file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileDelete}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Delete one or more files.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileExists}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a file or directory exists.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileFindFirstFile}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a search &amp;quot;handle&amp;quot; according to file search string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileFindNextFile}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a filename according to a previous call to FileFindFirstFile.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileFlush}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Flushes the file&#039;s buffer to disk.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetAttrib}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a code string representing a file&#039;s attributes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetEncoding}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Determines the text encoding used in a file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetLongName}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the long path + name of the path + name passed.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetPos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the current file position.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetShortcut}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves details about a shortcut.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetShortName}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the 8.3 short path+name of the path+name passed.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetSize}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;returns the size of a file in bytes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetTime}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the time and date information for a file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileGetVersion}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the &amp;quot;File&amp;quot; version information.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileInstall}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Include and install a file with the compiled script.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileMove}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Moves one or more files.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileOpen}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Opens a text file for reading or writing.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileOpenDialog}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Initiates a Open File Dialog.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileRead}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Read in a number of characters from a previously opened text file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileReadLine}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Read in a line of text from a previously opened text file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileReadToArray}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads the specified file into an array.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileRecycle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a file or directory to the recycle bin.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileRecycleEmpty}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Empties the recycle bin.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileSaveDialog}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Initiates a Save File dialog.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileSelectFolder}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Initiates a Browse For Folder dialog.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileSetAttrib}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the attributes of one or more files.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileSetPos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the current file position.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileSetTime}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the timestamp of one or more files.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileWrite}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Append a line of text to the end of a previously opened text file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FileWriteLine}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Append a line of text to the end of a previously opened text file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Floor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a number rounded down to the nearest integer.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FtpSetProxy}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the internet proxy to use for ftp access.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|FuncName}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the name of a function stored in a variable.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICreate}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateAvi}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates an AVI video control for the GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateButton}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Button control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateCheckbox}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Checkbox control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateCombo}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creats a ComboBox control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateContextMenu}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a context menu for a GUI or an underlying control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateDate}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a date control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateDummy}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Dummy control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateEdit}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates an Edit control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateGraphic}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Graphic control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateGroup}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Group control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateIcon}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates an icon within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateInput}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates an Input control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateLabel}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a static Label control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateList}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a List control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateListView}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a ListView control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateListViewItem}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a ListView item.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateMenu}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Menu control for a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateMenuItem}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a MenuItem control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateMonthCal}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a month calendar control for the GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateObj}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates an ActiveX control for a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreatePic}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Picture control for a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateProgress}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Progress control for a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateRadio}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Radio button control within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateSlider}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Slider control for the GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateTab}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a Tab control for the GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateTabItem}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a TabItem.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateTreeView}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a TreeView control for a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateTreeViewItem}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a TreeViewItem.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlCreateUpdown}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates an UpDown control for a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlDelete}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Deletes a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlGetHandle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the handle for a control and some special (item) handles.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlGetState}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Gets the current state of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlRead}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads the state or data of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlRecvMsg}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a message to a control and retrieves information in lParam.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlRegisterListViewSort}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Registers a user defined function for an internal listview sorting callback function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSendMsg}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a message to a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSendToDummy}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends a message to a Dummy control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetBkColor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the background color of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetColor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the text color of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetCursor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the mouse cursor icon for a particular control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetData}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Modifies the data for a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetDefBkColor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the default background color of all controls within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetDefColor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the default text color of all controls within a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetFont}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the font for a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetGraphic}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Modifies the data for a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetImage}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets a control&#039;s bitmap/icon image.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetLimit}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Limits the number of characters/pixels for a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetOnEvent}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Defines a user-defined function to be called when a control is clicked.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetPos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the position of a control within the GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetResizing}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Defines the resizing method for a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetState}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the state of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetStyle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the style of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUICtrlSetTip}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the tip text associated with a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUIDelete}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Deletes a GUI and all underlying controls.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUIGetCursorInfo}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Gets the mouse cursor position relative to the GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUIGetMsg}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Polls a GUI for an event.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUIGetStyle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;retrieves the styles of a GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUIRegisterMsg}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Register a user defined function for a known Windows Message ID (WM_MSG).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetAccelerators}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the accelerator table to be used in a GUI.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetBkColor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the background color of a GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetCoord}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the absolute coordinates for the next control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetCursor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sest the mouse cursor icon for a GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetFont}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the default font for a GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetHelp}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets an executable file that will run when F1 is pressed.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetIcon}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the icon used in a GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetOnEvent}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Defines a user function to be called when a system button is pressed.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetState}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the state of a GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISetStyle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the styles of a GUI window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUIStartGroup}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Defines that any subsequent controls that are created will be &amp;quot;grouped&amp;quot; together.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|GUISwitch}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Switches the current window used for GUI functions.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Hex}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a string representation of an integer or of a binary type converted to hexadecimal.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|HotKeySet}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets a hotkey that calls a user function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|HttpSetProxy}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the internet proxy to use for http access.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|HttpSetUserAgent}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the HTTP user-agent string which is sent with all Inet requests.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|HWnd}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts an expression into an HWND handle.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|InetClose}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Closes a handle returned from InetGet().&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|InetGet}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Downloads a file from the internet using the http or ftp protocol.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|InetGetInfo}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns detailed data for a handle returned from InetGet().&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|InetGetSize}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the size (in bytes) of a file located on the internet.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|InetRead}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IniDelete}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Deletes a value from a standard format .ini file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IniRead}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads a value from a standard format .ini file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IniReadSection}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads all key/value pairs from a section in a standard format .ini file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IniReadSectionNames}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads all sections in a standard format .ini file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IniRenameSection}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Renames a section in a standard format .ini file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IniWrite}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Writes a value to a standard format .ini file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IniWriteSection}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Writes a section to a standard format .ini file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|InputBox}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Displays an input box requesting a user input string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Int}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the integer (whole) representation of an expression.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsAdmin}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if the current user has full administrator privileges.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsArray}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable is an array type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsBinary}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable or expression is a binary type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsBool}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable&#039;s base type is boolean.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsDeclared}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable has been declared.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsDllStruct}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable is a DllStruct type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsFloat}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable or expression is a float-type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsFunc}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable or expression is a function type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsHWnd}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable&#039;s base type is a pointer and window handle.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsInt}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable or expression is an integer type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsKeyword}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable is a keyword. (e.g. Default)&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsNumber}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if variable&#039;s base type is numeric.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsObj}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable or expression is an object type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsPtr}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable&#039;s base type is a pointer.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|IsString}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a variable is a string type.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Log}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the natural logarithm of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MemGetStats}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves memory related information.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Mod}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Performs the modulus operation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MouseClick}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Perform a mouse click operation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MouseClickDrag}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Perform a a mouse click and drag operation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MouseDown}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Perform a mouse down event at the current mouse position.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MouseGetCursor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the cursor ID Number for the current Mouse Cursor.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MouseGetPos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the current position of the mouse cursor.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MouseMove}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Moves the mouse pointer.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MouseUp}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Performs a mouse up event at the current mouse position.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MouseWheel}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Moves the mouse wheel up or down. (NT/2k/XP only)&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|MsgBox}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Displays a simple message box with optional timeout.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Number}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the numeric representation of an expression.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ObjCreate}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a reference to a COM object from the given classname.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ObjCreateInterface}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a reference to an object from the given classname/object pointer, interface identifier and description string. &amp;lt;font color=&amp;quot;#F88&amp;quot;&amp;gt;(experimental!)&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ObjEvent}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Handles incoming events from the given Object.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ObjGet}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves a reference to a COM object from an existing process or filename.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ObjName}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the name or interface description of an Object.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|OnAutoItExitRegister}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Registers a function to be called when AutoIt exits.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|OnAutoItExitUnRegister}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unregisters a function to be called when AutoIt exits.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Ping}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Pings a host and returns the roundtrip-time.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|PixelChecksum}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Generates a checksum for a region of pixels.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|PixelGetColor}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a pixel color according to x,y pixel coordinates.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|PixelSearch}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Searches a rectangle of pixels for the pixel color provided.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProcessClose}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Terminates a named process.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProcessExists}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks to see if a specified process exists.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProcessGetStats}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns an array of information about a running process.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProcessList}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns an array of currently running processes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProcessSetPriority}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the priority of a process.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProcessWait}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Pauses script execution until a given process exists.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProcessWaitClose}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Pauses a script execution until a given process does not exist.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProgressOff}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Turns Progress window off.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProgressOn}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a customizable progress bar window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ProgressSet}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the position and/or text of a previously created Progress bar window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Ptr}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts an expression into a pointer variant.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Random}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Generates a pseudo-random float-type number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|RegDelete}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Deletes a key or value from the registry.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|RegEnumKey}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads the name of a subkey according to it&#039;s instance.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|RegEnumVal}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads the name of a value according to it&#039;s instance.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|RegRead}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;reads a value from the registry.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|RegWrite}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a key or value in the registry.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Round}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a number rounded to a specified number of decimal places.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Run}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Runs an external program.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|RunAs}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Runs an external program under the context of a different user.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|RunAsWait}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Runs an external program under the context of a different user and pauses script execution until the program finishes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|RunWait}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Runs an external program and pauses script execution until the program finishes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Send}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends simulated keystrokes to the active window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SendKeepActive}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Attempts to keep a specified window active during Send().&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SetError}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Manually set the value of the @error macro.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SetExtended}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Manually set the value of the @extended macro.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ShellExecute}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Runs an external program using the ShellExecute API.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ShellExecuteWait}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Runs an external program using the ShellExecute API and pauses script execution until it finishes.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Shutdown}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Shuts down the system.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Sin}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the sine of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Sleep}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Pause script execution.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SoundPlay}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Play a sound file.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SoundSetWaveVolume}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the system wave volume by percent.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SplashImageOn}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a customizable image popup window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SplashOff}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Turns SplashText or SplashImage off.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SplashTextOn}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a customizable text popup window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Sqrt}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the square-root of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|SRandom}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set Seed for random number generation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StatusbarGetText}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the text from a standard status bar control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StderrRead}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads from the STDERR stream of a previously run child process.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StdinWrite}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Writes a number of characters to the STDIN stream of a previously run child process.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StdioClose}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Closes all resources associated with a process previously run with STDIO redirection.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StdoutRead}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reads from the STDOUT stream of a previously run child process.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|String}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the string representation of an expression.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringAddCR}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Takes a string and prefixes all linefeed characters (Chr(10)) with a carriage return character (Chr(13)).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringCompare}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Compares two strings with options.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringFormat}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a formatted string. (Similar to C&#039;s sprintf() function.)&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringFromASCIIArray}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts an array of ASCII codes to a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringInStr}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains a given substring.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsAlNum}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains only alphanumeric characters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsAlpha}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains only alphabetic characters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsASCII}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains only ASCII characters in the range 0x00 - 0x7f (0-127).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsDigit}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains only digit (0-9) characters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsFloat}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string is a floating point number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsInt}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string is an integer.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsLower}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains only lowercase characters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsSpace}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains only whitespace characters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsUpper}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains only uppercase characters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringIsXDigit}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks if a string contains only hexadecimal digit (0-F) characters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringLeft}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a number of characters from the left-hand side of a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringLen}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the number of characters in a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringLower}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts a string to lowercase.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringMid}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Extracts a number of characters from a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringRegExp}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Check if a string fits a given regular expression pattern.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringRegExpReplace}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Replace text in a string based on a regular expression.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringReplace}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Replaces substrings in a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringReverse}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Reverses the contents of the specified string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringRight}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a number of characters from the right-hand side of a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringSplit}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Splits up a string into substrings depending on the given delimiters.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringStripCR}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Removes all carriage return values ( Chr(13) ) from a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringStripWS}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Strips whitespace from a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringToASCIIArray}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts a string to an array containing the ASCII code of each character.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringToBinary}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts a string into binary data.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringTrimLeft}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Trims a number of characters from the left hand side of a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringTrimRight}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Trims a number of characters from the right hand side of a string.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|StringUpper}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts a string to uppercase.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|Tan}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Calculates the tangent of a number.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPAccept}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Permits an incoming connection attempt on a socket.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPCloseSocket}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Closes a TCP socket.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPConnect}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a socket connected to an existing server.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPListen}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a socket listening for an incoming connection.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPNameToIP}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Converts an Internet name to IP address.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPRecv}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Receives data from a connected socket.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPSend}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends data on a connected socket.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPShutdown}}, {{Help File|UDPShutdown}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Stops TCP/UDP services.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TCPStartup}}, {{Help File|UDPStartup}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Starts TCP/UDP services.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TimerDiff}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the difference in time from a previous call to TimerInit().&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TimerInit}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns a handle that can be passed to TimerDiff() to calculate the difference in milliseconds.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|ToolTip}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a tooltip anywhere on the screen.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayCreateItem}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a MenuItem control for the tray.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayCreateMenu}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Creates a menu control for the tray menu.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayGetMsg}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Polls the tray to see if any events have occurred.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayItemDelete}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Deletes a menu/item control from the tray menu.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayItemGetHandle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the handle for a tray menu(item).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayItemGetState}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Gets the current state of a control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayItemGetText}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Gets the itemtext of a tray menu/item control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayItemSetOnEvent}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Defines a user-defined function to be called when a tray item is clicked.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayItemSetState}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the state of a tray menu/item control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayItemSetText}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the itemtext of a tray menu/item control.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TraySetClick}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the clickmode of the tray icon - what mouseclicks will display the tray menu.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TraySetIcon}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Loads/Sets a specified tray icon.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TraySetOnEvent}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Defines a user function to be called when a special tray action happens.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TraySetPauseIcon}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Loads/Sets a specified tray pause icon.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TraySetState}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the state of the tray icon.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TraySetToolTip}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;(Re)Sets the tooltip text for the tray icon.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|TrayTip}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Displays a balloon tip from the AutoIt Icon.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|UBound}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the size of array dimensions.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|UDPBind}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a socket bound to an incoming connection.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|UDPCloseSocket}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Close a UDP socket.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|UDPOpen}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Open a socket connected to an existing server.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|UDPRecv}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Receives data from a opened socket.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|UDPSend}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sends data on an opened socket.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|VarGetType}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the internal type representation of a variant.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinActivate}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Activates (gives focus to) a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinActive}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks to see if a specified window exists and is currently active.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinClose}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Closes a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinExists}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Checks to see if a specified window exists.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinFlash}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Flashes a window in the taskbar.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetCaretPos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Returns the coordinates of the caret in the foreground window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetClassList}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the classes from a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetClientSize}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the size of a given window&#039;s client area.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetHandle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the internal handle of a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetPos}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the position and size of a given window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetProcess}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the ProcessID (PID) associated with a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetState}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the state of a given window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetText}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the text from a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinGetTitle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves the full title from a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinKill}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Forces a window to close.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinList}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Retrieves a list of windows.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinMenuSelectItem}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Invokes a menu item of a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinMinimizeAll}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Minimizes all windows.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinMinimizeAllUndo}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Undoes a previous WinMinimizeAll function call.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinMove}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Moves and/or resizes a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinSetOnTop}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes a window&#039;s &amp;quot;Always On Top&amp;quot; attribute.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinSetState}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Shows, hides, minimizes, maximizes, or restores a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinSetTitle}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Changes the title of a window.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinSetTrans}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sets the transparency of a window. (2k/XP or later)&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinWait}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Pauses execution of the script until the requested window exists.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinWaitActive}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Pauses execution of the script until the requested window is active.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinWaitClose}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Pauses the execution of a script until the requested window does not exist.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{{Help File|WinWaitNotActive}}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Pauses execution of the script until the requested window is not active.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#88F&amp;quot;&amp;gt;&amp;lt;sub&amp;gt;AutoIt v3.3.12.0&amp;lt;/sub&amp;gt;&amp;lt;/font&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Documentation&amp;diff=12676</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Documentation&amp;diff=12676"/>
		<updated>2014-10-21T13:01:42Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: Updated wording (Categories to Contents)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is extensive AutoIt documentation available and this documentation is your recommended reference. Many developers keep the documentation or &#039;&#039;AutoIt Help File&#039;&#039;, as it is better known, constantly open to look up functions and keywords.&lt;br /&gt;
&lt;br /&gt;
= Using the help file =&lt;br /&gt;
&lt;br /&gt;
[[File:Using-helpfile.png|300x226px|frame|Help file showing index]]&lt;br /&gt;
If you have AutoIt installed then you can find it in the SciTE editor if you press [F1], or in the start menu under AutoIt &amp;gt; AutoIt Help File.&lt;br /&gt;
&lt;br /&gt;
There are three common methods of using the help file. You can use the Contents tab to browse the help file by category, which allows you to quickly find the resource you&#039;re after based on the type of script you&#039;re writing. Alternatively, you can use the Index tab to search for a resource page by title; this is practical if you know the name of the function you&#039;re after. Finally, by using the Search tab you can search all documents for a word or phrase. This is helpful when looking for words that may appear in multiple resource pages.&lt;br /&gt;
&lt;br /&gt;
As another alternative, if you are not finding the resource you&#039;re after, you can use Google to search in the online documentation.&lt;br /&gt;
&lt;br /&gt;
When in doubt, if you cannot find the answer to your problem, use the [[forums]].&lt;br /&gt;
&lt;br /&gt;
= Offline =&lt;br /&gt;
&lt;br /&gt;
An offline copy of the help file is available for download on the official AutoIt home page. You download the [[AutoIt Full Installation]] or the [[AutoIt Self Extracting Archive]] which both contain the AutoIt help file.&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
&lt;br /&gt;
The source code for the help file is available to anyone so that they can expand, modify or translate the original. After editing, the help file source code can be submitted to the development team.&lt;br /&gt;
&lt;br /&gt;
= Online =&lt;br /&gt;
&lt;br /&gt;
There is also online documentation available if you do not have or want to download the offline version. This is less convenient to use for regular development since some features that the offline help file offers are not supported.&lt;br /&gt;
&lt;br /&gt;
The online copy can be found here: [http://www.autoitscript.com/autoit3/docs/ Online documentation]&lt;br /&gt;
&lt;br /&gt;
If you like to try AutoIt Online in your Webbrowser you can use [http://www.script-example.com/themen/AutoIT-Online-Compiler.php script-example.com free AutoIt Web Compiler]&lt;br /&gt;
&lt;br /&gt;
== Searching ==&lt;br /&gt;
&lt;br /&gt;
Similar to the forums, you can use Google or your search engine of choice as a valuable searching tool. You start your query with &#039;&#039;site:http://www.autoitscript.com/autoit3/docs/&#039;&#039; and then your search query.&lt;br /&gt;
&lt;br /&gt;
A finished query may look like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
site:http://www.autoitscript.com/autoit3/docs/ GUICtrlCreateButton&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other languages =&lt;br /&gt;
&lt;br /&gt;
The AutoIt help file is available in a few other languages beside English.&lt;br /&gt;
&lt;br /&gt;
You can find these help files here: &lt;br /&gt;
[http://www.autoitscript.com/autoit3/docs.shtml Non-english documentation]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=SciTE4AutoIt3&amp;diff=12675</id>
		<title>SciTE4AutoIt3</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=SciTE4AutoIt3&amp;diff=12675"/>
		<updated>2014-10-21T12:49:17Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: Removed duplicate sentence&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SciTE4AutoIt3&#039;&#039;&#039; is a specialist editor package based on the excellent [http://www.scintilla.org/SciTE.html SciTE] editor.  &lt;br /&gt;
SciTE has been set up to compile AutoIt scripts and has been extended with a multitude of Lua scripts.  &lt;br /&gt;
SciTE4AutoIt3 may be downloaded here: [http://www.AutoItscript.com/site/AutoIt-script-editor/ SciTE4AutoIt3].&lt;br /&gt;
Keep in mind that SciTE4AutoIt3 is not an official package.&lt;br /&gt;
Direct any bug reports or feature requests to the AutoIt3 forum and not the bug tracker.&lt;br /&gt;
&lt;br /&gt;
== Syntax Highlighting ==&lt;br /&gt;
&lt;br /&gt;
[[File:Syntax_Highlighting.JPG|right|A demonstration of syntax highlighting using the default theme.]]&lt;br /&gt;
&lt;br /&gt;
SciTE4AutoIt3 comes with a customized AutoIt3 lexer which enables syntax highlighting.&lt;br /&gt;
Syntax highlighting enables the colorization of various code elements such as variables, strings, operators, comments etc.&lt;br /&gt;
Syntax highlighting allows one to differentiate the various code elements such as keywords, variables, strings, control flow structures etc. quickly without having to specifically identify the element.&lt;br /&gt;
To load a custom theme a user may press [Ctrl] + [1] to bring up [[SciTEConfig]].&lt;br /&gt;
When the &#039;&#039;Color Settings&#039;&#039; tab is selected a button labeled &#039;New Scheme&#039; will appear at the bottom. &lt;br /&gt;
Alternatively, the colors may be customized individually.&lt;br /&gt;
&lt;br /&gt;
Some options that are available for customization include: White Space, Comment Line, Comment Block, Number, Function, Keyword, Macro and String.&lt;br /&gt;
&lt;br /&gt;
== Quick Tips ==&lt;br /&gt;
&lt;br /&gt;
For anyone not familiar with SciTE, here are a few tips and tricks to help easily customize the installation. &lt;br /&gt;
For any advanced info, visit the [http://www.scintilla.org/SciTEDoc.html SciTE home page].&lt;br /&gt;
&lt;br /&gt;
=== Help Files ===&lt;br /&gt;
&lt;br /&gt;
To access the AutoIt3 helpfile the user may press [F1].  &lt;br /&gt;
To quickly access help information on a specific function, simply click or highlight the desired function and press the [F1] key to bring up the help file on the relevant page.&lt;br /&gt;
To access the SciTE4AutoIt3 helpfile the user may press [ctrl] + [F1].&lt;br /&gt;
&lt;br /&gt;
=== Properties Files ===&lt;br /&gt;
&lt;br /&gt;
Minor editing of SciTE&#039;s configuration files will be required to make use of the information in this section.&lt;br /&gt;
It is important to be familiar with the hierarchy of SciTE&#039;s configuration files.&lt;br /&gt;
&lt;br /&gt;
There are four properties files used:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| SciTE.properties || Local properties file which may be present in the same directory as the file being edited. This file overrides any other properties files settings below. This file is user created.&lt;br /&gt;
|-&lt;br /&gt;
| SciTEDirectory.properties || Directory properties file which may be present in the same or in a parent directory as the file being edited.&lt;br /&gt;
This file overrides all properties setting of the files below, but not the local properties settings aka &#039;&#039;SciTE.properties&#039;&#039;. &lt;br /&gt;
This file is user created.&lt;br /&gt;
|-&lt;br /&gt;
| SciTEUser.properties || User properties file, this file&#039;s settings override only the global properties settings aka &#039;&#039;SciTEGlobal.properties&#039;&#039;.&lt;br /&gt;
This file is found under the current logged on users profile directory.&lt;br /&gt;
|-&lt;br /&gt;
| SciTEGlobal.properties || All settings in this file can be overridden by any of the above files. &lt;br /&gt;
Typically this file should not be edited. &lt;br /&gt;
Use any of the above methods to implement a setting change.&lt;br /&gt;
This file can be found in SciTE&#039;s installation directory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Inline Errors ===&lt;br /&gt;
&lt;br /&gt;
[[File:InlineError.JPG|234px|thumb|right|Intentional error prone code used to display the &amp;quot;Inline Error&amp;quot; feature.]]&lt;br /&gt;
&lt;br /&gt;
In the latest version of SciTE, there exists a new feature called &amp;quot;Inline Errors&amp;quot;.  &lt;br /&gt;
Inline Error marks are error messages that will appear in the source code within the Scintilla window.&lt;br /&gt;
&lt;br /&gt;
The feature may be toggled and customized by using SciTEConfig.&lt;br /&gt;
&lt;br /&gt;
=== Selection Highlighting ===&lt;br /&gt;
&lt;br /&gt;
Selection highlighting is a new feature which highlights other instances of the currently highlighted word or string.  &lt;br /&gt;
Due to the colors, sometimes it is hard to tell the selection apart.&lt;br /&gt;
The default colors may be changed.&lt;br /&gt;
&lt;br /&gt;
The feature may be toggled and customized by using SciTEConfig.&lt;br /&gt;
&lt;br /&gt;
=== Colors in the Output Pane ===&lt;br /&gt;
&lt;br /&gt;
SciTE has a console window which can be used to output information from running scripts.  &lt;br /&gt;
The function {{Help File|ConsoleWrite}} may be used in an AutoIt script to output text to the console.  &lt;br /&gt;
The colors of the text may be altered by prepending a string with special characters.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(&amp;quot;This is plain text&amp;quot; &amp;amp; @LF)&lt;br /&gt;
ConsoleWrite(&amp;quot;&amp;gt; This text will have a different color.&amp;quot; &amp;amp; @LF)&lt;br /&gt;
ConsoleWrite(&amp;quot;+ This text will have a different color.&amp;quot; &amp;amp; @LF)&lt;br /&gt;
ConsoleWrite(&amp;quot;- This text will have a different color.&amp;quot; &amp;amp; @LF)&lt;br /&gt;
ConsoleWrite(&amp;quot;! This text will have a different color.&amp;quot; &amp;amp; @LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== AutoIt3Wrapper ==&lt;br /&gt;
&lt;br /&gt;
AutoIt3Wrapper directives allow for in depth control of the compilation and interpretation of AutoIt scripts.  &lt;br /&gt;
Some of these can be very useful under different circumstances.&lt;br /&gt;
See [[AutoIt3Wrapper Directives]] for a full list of directives and their descriptions.&lt;br /&gt;
&lt;br /&gt;
== Au3Stripper ==&lt;br /&gt;
&lt;br /&gt;
[[Au3Stripper]] may be used to strip away unused [[Function|functions]] and [[Global|global]] [[Variable|variables]] from the script prior to compilation.  &lt;br /&gt;
Functions and variables may be renamed to shorter three character names to save space and to provide some measure of obscurity.  &lt;br /&gt;
&lt;br /&gt;
=== Stripping Excess Code ===&lt;br /&gt;
&lt;br /&gt;
For instance, in a script that has several includes Au3Stripper can often strip thousands of lines from the script.&lt;br /&gt;
&lt;br /&gt;
 #AutoIt3Wrapper_Run_Au3Stripper=y&lt;br /&gt;
 #Au3Stripper_Parameters=/sf /sv /rm&lt;br /&gt;
&lt;br /&gt;
On a medium sized script, results are often like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;Running Au3Stripper (1.2.0.6)  from:C:\Program Files\AutoIt3\SciTE cmdline:&lt;br /&gt;
 - Iteration 1 Strip Functions result: Output  2580 lines and stripped 6741 lines&lt;br /&gt;
 - Iteration 2 Strip Variables result: Output  1585 lines and stripped 950 lines&lt;br /&gt;
 - Iteration 3 Strip Variables result: Output  1566 lines and stripped 19 lines&lt;br /&gt;
 - Iteration 4 Start the actual Obfuscation.&lt;br /&gt;
 +&amp;gt; Source    26190 lines 1447980 Characters.&lt;br /&gt;
 +&amp;gt; Stripped  7710 Func/Var lines and  16862 comment lines, Total 1373871 Characters.&lt;br /&gt;
 +&amp;gt; Saved     93% lines 94% Characters.&lt;br /&gt;
 +&amp;gt; Au3Stripper v1.0.27.0 finished obfuscating 1566 lines, created:C:\MyScript_stripped.au3&lt;br /&gt;
&lt;br /&gt;
== Run_After and Run_Before Commands ==&lt;br /&gt;
&lt;br /&gt;
=== Running the exe On Build ===&lt;br /&gt;
&lt;br /&gt;
Often a build is performed as a testing procedure and so to have to continually open up Windows Explorer to find the exe is repetitive. &lt;br /&gt;
Furthermore, if the script writes to the console using the function {{Help File|ConsoleWrite}} then the messages will not be written to SciTE&#039;s console pane.  The solution is simple:&lt;br /&gt;
&lt;br /&gt;
 #AutoIt3Wrapper_Run_After=&amp;quot;%out%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will run the program and read the console output to the SciTE debug frame.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Version Directory ===&lt;br /&gt;
&lt;br /&gt;
When compiling, it is very possible that you want to go back to a previous version. &lt;br /&gt;
If so, then it is neat to have a directory which will store all previous builds, without the need for you to manually copy and paste every time.&lt;br /&gt;
Make sure you add these directives in last (after adding resources) as they might not be included in the copied result.&lt;br /&gt;
&lt;br /&gt;
 #AutoIt3Wrapper_Run_After=md &amp;quot;%scriptdir%\Versions\%fileversion%&amp;quot;&lt;br /&gt;
 #AutoIt3Wrapper_Run_After=copy &amp;quot;%in%&amp;quot; &amp;quot;%scriptdir%\Versions\%fileversion%\%scriptfile%%fileversion%.au3&amp;quot;&lt;br /&gt;
 #AutoIt3Wrapper_Run_After=copy &amp;quot;%out%&amp;quot; &amp;quot;%scriptdir%\Versions\%fileversion%\%scriptfile%%fileversion%.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Using ResHacker ===&lt;br /&gt;
&lt;br /&gt;
ResHacker is a very important programming tool for extracting and adding resources into executables. &lt;br /&gt;
It has a very simple command line interface that allows it to be used easily using the &amp;quot;Run_After&amp;quot; directive. &lt;br /&gt;
Adding a picture to an executable could be done like this:&lt;br /&gt;
&lt;br /&gt;
 #AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, MyPicture.bmp, BITMAP, RESOURCENAME, 0&lt;br /&gt;
&lt;br /&gt;
NB: Reshacker.exe &#039;&#039;must&#039;&#039; be copied into the script directory for this to work.&lt;br /&gt;
&lt;br /&gt;
If you then want to use the resources in your code, there is an excellent [http://www.AutoItscript.com/forum/index.php?showtopic=51103 Resources UDF] which will allow you to access the resources from within the exe.&lt;br /&gt;
&lt;br /&gt;
==== Adding Original Source Code ====&lt;br /&gt;
&lt;br /&gt;
When using the above tip on stripping excess code, the new source is not readable. &lt;br /&gt;
As a result, using the standard directive for saving the source:&lt;br /&gt;
&lt;br /&gt;
 #AutoIt3Wrapper_Res_SaveSource=y&lt;br /&gt;
&lt;br /&gt;
Would add the obfuscated code to the exe, which is not the desired result. &lt;br /&gt;
The solution is to add it in manually. &lt;br /&gt;
This code does not require any editing, so you can just copy and paste it in:&lt;br /&gt;
&lt;br /&gt;
 #AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, %scriptfile%.au3, RCDATA, SOURCE, 0&lt;br /&gt;
 &lt;br /&gt;
==== Extended Reshacker Info ====&lt;br /&gt;
&lt;br /&gt;
ResHacker doesn&#039;t always return with a return code (rc) of not 0 if it fails, to get that info you need to read the ResHacker.log file that is created. This is also pretty simple to do:&lt;br /&gt;
&lt;br /&gt;
 #AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, MyPicture.bmp, BITMAP, RESOURCENAME, 0&lt;br /&gt;
 #AutoIt3Wrapper_Run_After=TYPE ResHacker.log&lt;br /&gt;
&lt;br /&gt;
The new output now looks like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;Running:ResHacker.exe -add C:\MyScript.exe, C:\MyScript.exe, MyPicture.bmp, BITMAP, RESOURCENAME, 0&lt;br /&gt;
 &amp;gt;ResHacker.exe -add C:\MyScript.exe, C:\MyScript.exe, MyPicture.bmp, BITMAP, RESOURCENAME, 0 Ended   rc:0&lt;br /&gt;
 &amp;gt;Running:TYPE ResHacker.log&lt;br /&gt;
 [19 Jan 2010, 21:26:22]&lt;br /&gt;
 ResHacker.exe  -add C:\MyScript.exe, C:\MyScript.exe, MyPicture.bmp, BITMAP, RESOURCENAME, 0&lt;br /&gt;
  Added: BITMAP,RESOURCENAME,0&lt;br /&gt;
 &lt;br /&gt;
 Commands completed&lt;br /&gt;
 &amp;gt;TYPE ResHacker.log Ended   rc:0&lt;br /&gt;
&lt;br /&gt;
And an example of it showing an error:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;ResHacker.exe -add C:\MyScript.exe, C:\MyScript.exe, MyPicture.bmp, BITMAP, RESOURCENAME, 0 Ended   rc:0&lt;br /&gt;
 &amp;gt;Running:TYPE ResHacker.log&lt;br /&gt;
 [19 Jan 2010, 21:32:10]&lt;br /&gt;
 ResHacker.exe  -add C:\MyScript.exe, C:\MyScript.exe, MyPicture.bmp, BITMAP, RESOURCENAME, 0&lt;br /&gt;
 Error: &amp;quot;MyPicture.bmp&amp;quot; does not exist&lt;br /&gt;
 &amp;gt;TYPE ResHacker.log Ended   rc:0&lt;br /&gt;
&lt;br /&gt;
As you can see, Reshacker on its own returns rc: 0, usually indicating no error. This would have gone completely unnoticed except for the log file, which shows the error and an explanation.&lt;br /&gt;
&lt;br /&gt;
=== Other Run_After and Run_Before Commands ===&lt;br /&gt;
&lt;br /&gt;
You can use any commands you like in the Run_After and Run_Before directives. Examples such as &amp;quot;TYPE&amp;quot; have been shown above. &lt;br /&gt;
&lt;br /&gt;
For a more complete list the following website is very useful: [http://ss64.com/nt An A-Z Index of the Windows CMD Line]&lt;br /&gt;
&lt;br /&gt;
== Other Wiki Pages ==&lt;br /&gt;
&lt;br /&gt;
[[Adding_utilities_to_the_SciTE_Tools_menu|Adding Utilities to the SciTE Tools Menu]]&lt;br /&gt;
&lt;br /&gt;
[[Adding_UDFs_to_AutoIt_and_SciTE|Adding UDFs to AutoIt and SciTE]]&lt;br /&gt;
&lt;br /&gt;
== Useful Lua links and scripts ==&lt;br /&gt;
&lt;br /&gt;
[http://www.scintilla.org/SciTELua.html SciTELua]&lt;br /&gt;
&lt;br /&gt;
[http://www.lua.org Lua Website]&lt;br /&gt;
&lt;br /&gt;
[http://www.lua.org/pil/1.html Programming in Lua]&lt;br /&gt;
&lt;br /&gt;
[http://lua-users.org/wiki/ lua-users wiki]&lt;br /&gt;
&lt;br /&gt;
[http://lua-users.org/wiki/SciTEScripts SciTEScripts]&lt;br /&gt;
&lt;br /&gt;
[http://lua-users.org/wiki/SampleCode SampleCode]&lt;br /&gt;
&lt;br /&gt;
[http://www.AutoItscript.com/forum/topic/140881-mouse-hover-call-tips-update-03182013/ AutoIt3 Forum: MouseHoverCallTips]&lt;br /&gt;
&lt;br /&gt;
[http://www.AutoItscript.com/forum/topic/152960-SciTE-lua-tool-to-make-string-variable-from-selected-text/ AutoIt3 Forum: SciTE lua Tool To Make String Variable From Selected Text]&lt;br /&gt;
&lt;br /&gt;
[[Category:SciTE]]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12674</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12674"/>
		<updated>2014-10-21T12:45:58Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Additional Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
There are many tutorials available for AutoIt. This page is an overview of a few known tutorials. More tutorials can possibly be found and will be added to this page in time.&lt;br /&gt;
&lt;br /&gt;
= AutoIt beginner =&lt;br /&gt;
These tutorials describe simple tasks and AutoIt syntax.&lt;br /&gt;
&lt;br /&gt;
* [[Tutorial_Core_Language|Language tutorial]] &#039;&#039;( cheat sheet )&#039;&#039;&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=21048 Welcome to AutoIt 1-2-3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=84960 Learning to script with AutoIt v3]&lt;br /&gt;
&lt;br /&gt;
==Autoit-1-2-3==&lt;br /&gt;
&lt;br /&gt;
By Valuater, this tutorial is one of the most popular. Some key features are:&lt;br /&gt;
* Over 19 Interactive GUI&#039;s&lt;br /&gt;
* Over 50 Step-by-Step Scripts&lt;br /&gt;
* Verbal Instructions&lt;br /&gt;
* Complete with Demonstrations and Answers&lt;br /&gt;
* Exe Format for New People&lt;br /&gt;
&lt;br /&gt;
This is the second page you will see when running AutoIt 1-2-3.  It gives important links to necessary downloads and allows you to run demos that are supplied with the program.&lt;br /&gt;
[[image:Autoit-1-2-3.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
You can download AutoIt 1-2-3 from [http://www.autoitscript.com/forum/index.php?act=attach&amp;amp;type=post&amp;amp;id=10824 here], or check out the [http://www.autoitscript.com/forum/index.php?showtopic=21048&amp;amp;hl=tutorials Forum page].&lt;br /&gt;
&lt;br /&gt;
==Learning to script with AutoIt V3==&lt;br /&gt;
&lt;br /&gt;
This tutorial has example AU3 files contained in the text, printable exercise question/answer sheet and more. Originally by lxP and updated by BrettF, this is a great starting point for those who have never scripted before. For people who may have done other languages, this will also be a good back to basics tutorial.&lt;br /&gt;
&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 Download now].&lt;br /&gt;
&lt;br /&gt;
= Video =&lt;br /&gt;
These are almost 20 AutoIt video tutorials by 403forbidden. You can view all the tutorials at the link below.  They start at a beginner level and work up from there.&lt;br /&gt;
* [http://www.youtube.com/watch?v=BLU60CD-Poo AutoIt Video Tutorials - Part 1]&lt;br /&gt;
&lt;br /&gt;
Set of tutorials by [http://www.autoitscript.com/forum/user/64654-morthawt/ Morthawt aka TutsTeach]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PL4Jcq5zn02jKpjX0nqI1_fS7mEEb5tw6z Easy Autoit Scripting Video Tutorials]&lt;br /&gt;
&lt;br /&gt;
= More complicated AutoIt commands and concepts =&lt;br /&gt;
*[[Arrays]]&lt;br /&gt;
*[[Tutorial GUIRegisterMsg|GUIRegisterMsg]]&lt;br /&gt;
*[[Interrupting a running function]]&lt;br /&gt;
*[[Variables - using Global, Local, Static and ByRef]]&lt;br /&gt;
*[[Managing Multiple GUIs|Managing multiple GUIs]]&lt;br /&gt;
*[[Setting Styles|Setting styles]]&lt;br /&gt;
*[[Moving and Resizing PopUp GUIs|Moving and resizing pop up GUIs]]&lt;br /&gt;
*[[Modal MsgBox Styles|Modal MsgBox styles]]&lt;br /&gt;
*[[Tabs]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[ADO|Microsoft ActiveX Data Objects (ADO)]]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=93496 DllCall] - Tutorial on DllCall() &amp;amp; DllStructs.&lt;br /&gt;
* [http://bug-fix.info/dll/dll_tut.html DllCall] - Dll Tutorial (German language).&lt;br /&gt;
&lt;br /&gt;
= Tips to make your coding easier =&lt;br /&gt;
*[[Adding UDFs to AutoIt and SciTE]]&lt;br /&gt;
*[[Adding utilities to the SciTE Tools menu]]&lt;br /&gt;
*[http://www.autoitscript.com/forum/topic/131833-scite-jump-navigate-between-functions-and-regions-in-an-autoit-script/  Use tools like SciTE Jump]&lt;br /&gt;
&lt;br /&gt;
= Additional Resources =&lt;br /&gt;
The AutoIt community is itself your best source for information, tutorials and assistance with the language. AutoIt boasts a very large community of both professional and hobbyist coders, all of whom&lt;br /&gt;
volunteer their time to assist with scripting questions. See below for just a few of our different forums:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/ Forum Home]&lt;br /&gt;
* [http://www.autoitscript.com/forum/forum/2-general-help-and-support/ General Support Questions]&lt;br /&gt;
* [http://www.autoitscript.com/forum/forum/10-graphical-user-interface-gui-help-and-support/ GUI Support Questions]&lt;br /&gt;
* [http://www.autoitscript.com/forum/forum/9-example-scripts/ Example Scripts]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12672</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12672"/>
		<updated>2014-10-20T18:56:44Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Additional Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
There are many tutorials available for AutoIt. This page is an overview of a few known tutorials. More tutorials can possibly be found and will be added to this page in time.&lt;br /&gt;
&lt;br /&gt;
= AutoIt beginner =&lt;br /&gt;
These tutorials describe simple tasks and AutoIt syntax.&lt;br /&gt;
&lt;br /&gt;
* [[Tutorial_Core_Language|Language tutorial]] &#039;&#039;( cheat sheet )&#039;&#039;&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=21048 Welcome to AutoIt 1-2-3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=84960 Learning to script with AutoIt v3]&lt;br /&gt;
&lt;br /&gt;
==Autoit-1-2-3==&lt;br /&gt;
&lt;br /&gt;
By Valuater, this tutorial is one of the most popular. Some key features are:&lt;br /&gt;
* Over 19 Interactive GUI&#039;s&lt;br /&gt;
* Over 50 Step-by-Step Scripts&lt;br /&gt;
* Verbal Instructions&lt;br /&gt;
* Complete with Demonstrations and Answers&lt;br /&gt;
* Exe Format for New People&lt;br /&gt;
&lt;br /&gt;
This is the second page you will see when running AutoIt 1-2-3.  It gives important links to necessary downloads and allows you to run demos that are supplied with the program.&lt;br /&gt;
[[image:Autoit-1-2-3.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
You can download AutoIt 1-2-3 from [http://www.autoitscript.com/forum/index.php?act=attach&amp;amp;type=post&amp;amp;id=10824 here], or check out the [http://www.autoitscript.com/forum/index.php?showtopic=21048&amp;amp;hl=tutorials Forum page].&lt;br /&gt;
&lt;br /&gt;
==Learning to script with AutoIt V3==&lt;br /&gt;
&lt;br /&gt;
This tutorial has example AU3 files contained in the text, printable exercise question/answer sheet and more. Originally by lxP and updated by BrettF, this is a great starting point for those who have never scripted before. For people who may have done other languages, this will also be a good back to basics tutorial.&lt;br /&gt;
&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 Download now].&lt;br /&gt;
&lt;br /&gt;
= Video =&lt;br /&gt;
These are almost 20 AutoIt video tutorials by 403forbidden. You can view all the tutorials at the link below.  They start at a beginner level and work up from there.&lt;br /&gt;
* [http://www.youtube.com/watch?v=BLU60CD-Poo AutoIt Video Tutorials - Part 1]&lt;br /&gt;
&lt;br /&gt;
Set of tutorials by [http://www.autoitscript.com/forum/user/64654-morthawt/ Morthawt aka TutsTeach]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PL4Jcq5zn02jKpjX0nqI1_fS7mEEb5tw6z Easy Autoit Scripting Video Tutorials]&lt;br /&gt;
&lt;br /&gt;
= More complicated AutoIt commands and concepts =&lt;br /&gt;
*[[Arrays]]&lt;br /&gt;
*[[Tutorial GUIRegisterMsg|GUIRegisterMsg]]&lt;br /&gt;
*[[Interrupting a running function]]&lt;br /&gt;
*[[Variables - using Global, Local, Static and ByRef]]&lt;br /&gt;
*[[Managing Multiple GUIs|Managing multiple GUIs]]&lt;br /&gt;
*[[Setting Styles|Setting styles]]&lt;br /&gt;
*[[Moving and Resizing PopUp GUIs|Moving and resizing pop up GUIs]]&lt;br /&gt;
*[[Modal MsgBox Styles|Modal MsgBox styles]]&lt;br /&gt;
*[[Tabs]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[ADO|Microsoft ActiveX Data Objects (ADO)]]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=93496 DllCall] - Tutorial on DllCall() &amp;amp; DllStructs.&lt;br /&gt;
* [http://bug-fix.info/dll/dll_tut.html DllCall] - Dll Tutorial (German language).&lt;br /&gt;
&lt;br /&gt;
= Tips to make your coding easier =&lt;br /&gt;
*[[Adding UDFs to AutoIt and SciTE]]&lt;br /&gt;
*[[Adding utilities to the SciTE Tools menu]]&lt;br /&gt;
*[http://www.autoitscript.com/forum/topic/131833-scite-jump-navigate-between-functions-and-regions-in-an-autoit-script/  Use tools like SciTE Jump]&lt;br /&gt;
&lt;br /&gt;
= Additional Resources =&lt;br /&gt;
The AutoIt community is itself your best source for information, tutorials and assistance with the language. AutoIt boasts a very large community of both professional and hobbyist coders, all of whom&lt;br /&gt;
volunteer their time to assist with scripting question. See below for just a few of our different forums:&lt;br /&gt;
&lt;br /&gt;
* [http://http://www.autoitscript.com/forum/ Forum Home]&lt;br /&gt;
* [http://www.autoitscript.com/forum/forum/2-general-help-and-support/ General Support Questions]&lt;br /&gt;
* [http://www.autoitscript.com/forum/forum/10-graphical-user-interface-gui-help-and-support/ GUI Support Questions]&lt;br /&gt;
* [http://www.autoitscript.com/forum/forum/9-example-scripts/ Example Scripts]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12671</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12671"/>
		<updated>2014-10-20T18:56:07Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Additional Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
There are many tutorials available for AutoIt. This page is an overview of a few known tutorials. More tutorials can possibly be found and will be added to this page in time.&lt;br /&gt;
&lt;br /&gt;
= AutoIt beginner =&lt;br /&gt;
These tutorials describe simple tasks and AutoIt syntax.&lt;br /&gt;
&lt;br /&gt;
* [[Tutorial_Core_Language|Language tutorial]] &#039;&#039;( cheat sheet )&#039;&#039;&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=21048 Welcome to AutoIt 1-2-3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=84960 Learning to script with AutoIt v3]&lt;br /&gt;
&lt;br /&gt;
==Autoit-1-2-3==&lt;br /&gt;
&lt;br /&gt;
By Valuater, this tutorial is one of the most popular. Some key features are:&lt;br /&gt;
* Over 19 Interactive GUI&#039;s&lt;br /&gt;
* Over 50 Step-by-Step Scripts&lt;br /&gt;
* Verbal Instructions&lt;br /&gt;
* Complete with Demonstrations and Answers&lt;br /&gt;
* Exe Format for New People&lt;br /&gt;
&lt;br /&gt;
This is the second page you will see when running AutoIt 1-2-3.  It gives important links to necessary downloads and allows you to run demos that are supplied with the program.&lt;br /&gt;
[[image:Autoit-1-2-3.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
You can download AutoIt 1-2-3 from [http://www.autoitscript.com/forum/index.php?act=attach&amp;amp;type=post&amp;amp;id=10824 here], or check out the [http://www.autoitscript.com/forum/index.php?showtopic=21048&amp;amp;hl=tutorials Forum page].&lt;br /&gt;
&lt;br /&gt;
==Learning to script with AutoIt V3==&lt;br /&gt;
&lt;br /&gt;
This tutorial has example AU3 files contained in the text, printable exercise question/answer sheet and more. Originally by lxP and updated by BrettF, this is a great starting point for those who have never scripted before. For people who may have done other languages, this will also be a good back to basics tutorial.&lt;br /&gt;
&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 Download now].&lt;br /&gt;
&lt;br /&gt;
= Video =&lt;br /&gt;
These are almost 20 AutoIt video tutorials by 403forbidden. You can view all the tutorials at the link below.  They start at a beginner level and work up from there.&lt;br /&gt;
* [http://www.youtube.com/watch?v=BLU60CD-Poo AutoIt Video Tutorials - Part 1]&lt;br /&gt;
&lt;br /&gt;
Set of tutorials by [http://www.autoitscript.com/forum/user/64654-morthawt/ Morthawt aka TutsTeach]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PL4Jcq5zn02jKpjX0nqI1_fS7mEEb5tw6z Easy Autoit Scripting Video Tutorials]&lt;br /&gt;
&lt;br /&gt;
= More complicated AutoIt commands and concepts =&lt;br /&gt;
*[[Arrays]]&lt;br /&gt;
*[[Tutorial GUIRegisterMsg|GUIRegisterMsg]]&lt;br /&gt;
*[[Interrupting a running function]]&lt;br /&gt;
*[[Variables - using Global, Local, Static and ByRef]]&lt;br /&gt;
*[[Managing Multiple GUIs|Managing multiple GUIs]]&lt;br /&gt;
*[[Setting Styles|Setting styles]]&lt;br /&gt;
*[[Moving and Resizing PopUp GUIs|Moving and resizing pop up GUIs]]&lt;br /&gt;
*[[Modal MsgBox Styles|Modal MsgBox styles]]&lt;br /&gt;
*[[Tabs]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[ADO|Microsoft ActiveX Data Objects (ADO)]]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=93496 DllCall] - Tutorial on DllCall() &amp;amp; DllStructs.&lt;br /&gt;
* [http://bug-fix.info/dll/dll_tut.html DllCall] - Dll Tutorial (German language).&lt;br /&gt;
&lt;br /&gt;
= Tips to make your coding easier =&lt;br /&gt;
*[[Adding UDFs to AutoIt and SciTE]]&lt;br /&gt;
*[[Adding utilities to the SciTE Tools menu]]&lt;br /&gt;
*[http://www.autoitscript.com/forum/topic/131833-scite-jump-navigate-between-functions-and-regions-in-an-autoit-script/  Use tools like SciTE Jump]&lt;br /&gt;
&lt;br /&gt;
= Additional Resources =&lt;br /&gt;
The AutoIt community is itself your best source for information, tutorials and assistance with the language. AutoIt boasts a very large community of both professional and hobbyist coders, all of whom&lt;br /&gt;
volunteer their time to assist with scripting question. See below for just a few of our different forums:&lt;br /&gt;
&lt;br /&gt;
[http://http://www.autoitscript.com/forum/ Forum Home]&lt;br /&gt;
[http://www.autoitscript.com/forum/forum/2-general-help-and-support/ General Support Questions]&lt;br /&gt;
[http://www.autoitscript.com/forum/forum/10-graphical-user-interface-gui-help-and-support/ GUI Support Questions]&lt;br /&gt;
[http://www.autoitscript.com/forum/forum/9-example-scripts/ Example Scripts]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12670</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12670"/>
		<updated>2014-10-20T18:55:38Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Additional Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
There are many tutorials available for AutoIt. This page is an overview of a few known tutorials. More tutorials can possibly be found and will be added to this page in time.&lt;br /&gt;
&lt;br /&gt;
= AutoIt beginner =&lt;br /&gt;
These tutorials describe simple tasks and AutoIt syntax.&lt;br /&gt;
&lt;br /&gt;
* [[Tutorial_Core_Language|Language tutorial]] &#039;&#039;( cheat sheet )&#039;&#039;&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=21048 Welcome to AutoIt 1-2-3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=84960 Learning to script with AutoIt v3]&lt;br /&gt;
&lt;br /&gt;
==Autoit-1-2-3==&lt;br /&gt;
&lt;br /&gt;
By Valuater, this tutorial is one of the most popular. Some key features are:&lt;br /&gt;
* Over 19 Interactive GUI&#039;s&lt;br /&gt;
* Over 50 Step-by-Step Scripts&lt;br /&gt;
* Verbal Instructions&lt;br /&gt;
* Complete with Demonstrations and Answers&lt;br /&gt;
* Exe Format for New People&lt;br /&gt;
&lt;br /&gt;
This is the second page you will see when running AutoIt 1-2-3.  It gives important links to necessary downloads and allows you to run demos that are supplied with the program.&lt;br /&gt;
[[image:Autoit-1-2-3.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
You can download AutoIt 1-2-3 from [http://www.autoitscript.com/forum/index.php?act=attach&amp;amp;type=post&amp;amp;id=10824 here], or check out the [http://www.autoitscript.com/forum/index.php?showtopic=21048&amp;amp;hl=tutorials Forum page].&lt;br /&gt;
&lt;br /&gt;
==Learning to script with AutoIt V3==&lt;br /&gt;
&lt;br /&gt;
This tutorial has example AU3 files contained in the text, printable exercise question/answer sheet and more. Originally by lxP and updated by BrettF, this is a great starting point for those who have never scripted before. For people who may have done other languages, this will also be a good back to basics tutorial.&lt;br /&gt;
&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 Download now].&lt;br /&gt;
&lt;br /&gt;
= Video =&lt;br /&gt;
These are almost 20 AutoIt video tutorials by 403forbidden. You can view all the tutorials at the link below.  They start at a beginner level and work up from there.&lt;br /&gt;
* [http://www.youtube.com/watch?v=BLU60CD-Poo AutoIt Video Tutorials - Part 1]&lt;br /&gt;
&lt;br /&gt;
Set of tutorials by [http://www.autoitscript.com/forum/user/64654-morthawt/ Morthawt aka TutsTeach]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PL4Jcq5zn02jKpjX0nqI1_fS7mEEb5tw6z Easy Autoit Scripting Video Tutorials]&lt;br /&gt;
&lt;br /&gt;
= More complicated AutoIt commands and concepts =&lt;br /&gt;
*[[Arrays]]&lt;br /&gt;
*[[Tutorial GUIRegisterMsg|GUIRegisterMsg]]&lt;br /&gt;
*[[Interrupting a running function]]&lt;br /&gt;
*[[Variables - using Global, Local, Static and ByRef]]&lt;br /&gt;
*[[Managing Multiple GUIs|Managing multiple GUIs]]&lt;br /&gt;
*[[Setting Styles|Setting styles]]&lt;br /&gt;
*[[Moving and Resizing PopUp GUIs|Moving and resizing pop up GUIs]]&lt;br /&gt;
*[[Modal MsgBox Styles|Modal MsgBox styles]]&lt;br /&gt;
*[[Tabs]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[ADO|Microsoft ActiveX Data Objects (ADO)]]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=93496 DllCall] - Tutorial on DllCall() &amp;amp; DllStructs.&lt;br /&gt;
* [http://bug-fix.info/dll/dll_tut.html DllCall] - Dll Tutorial (German language).&lt;br /&gt;
&lt;br /&gt;
= Tips to make your coding easier =&lt;br /&gt;
*[[Adding UDFs to AutoIt and SciTE]]&lt;br /&gt;
*[[Adding utilities to the SciTE Tools menu]]&lt;br /&gt;
*[http://www.autoitscript.com/forum/topic/131833-scite-jump-navigate-between-functions-and-regions-in-an-autoit-script/  Use tools like SciTE Jump]&lt;br /&gt;
&lt;br /&gt;
= Additional Resources =&lt;br /&gt;
The AutoIt community is itself your best source for information, tutorials and assistance with the language. AutoIt boasts a very large community of both professional and hobbyist coders, all of whom&lt;br /&gt;
volunteer their time to assist with scripting question. See below for just a few of our different forums:&lt;br /&gt;
&lt;br /&gt;
[http://http://www.autoitscript.com/forum/ Forum Home]&lt;br /&gt;
General Support Questions: [http://www.autoitscript.com/forum/forum/2-general-help-and-support/]&lt;br /&gt;
GUI Support Questions: [http://www.autoitscript.com/forum/forum/10-graphical-user-interface-gui-help-and-support/]&lt;br /&gt;
Example Scripts: [http://www.autoitscript.com/forum/forum/9-example-scripts/]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12669</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorials&amp;diff=12669"/>
		<updated>2014-10-20T18:54:35Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Books */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
There are many tutorials available for AutoIt. This page is an overview of a few known tutorials. More tutorials can possibly be found and will be added to this page in time.&lt;br /&gt;
&lt;br /&gt;
= AutoIt beginner =&lt;br /&gt;
These tutorials describe simple tasks and AutoIt syntax.&lt;br /&gt;
&lt;br /&gt;
* [[Tutorial_Core_Language|Language tutorial]] &#039;&#039;( cheat sheet )&#039;&#039;&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=21048 Welcome to AutoIt 1-2-3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=84960 Learning to script with AutoIt v3]&lt;br /&gt;
&lt;br /&gt;
==Autoit-1-2-3==&lt;br /&gt;
&lt;br /&gt;
By Valuater, this tutorial is one of the most popular. Some key features are:&lt;br /&gt;
* Over 19 Interactive GUI&#039;s&lt;br /&gt;
* Over 50 Step-by-Step Scripts&lt;br /&gt;
* Verbal Instructions&lt;br /&gt;
* Complete with Demonstrations and Answers&lt;br /&gt;
* Exe Format for New People&lt;br /&gt;
&lt;br /&gt;
This is the second page you will see when running AutoIt 1-2-3.  It gives important links to necessary downloads and allows you to run demos that are supplied with the program.&lt;br /&gt;
[[image:Autoit-1-2-3.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
You can download AutoIt 1-2-3 from [http://www.autoitscript.com/forum/index.php?act=attach&amp;amp;type=post&amp;amp;id=10824 here], or check out the [http://www.autoitscript.com/forum/index.php?showtopic=21048&amp;amp;hl=tutorials Forum page].&lt;br /&gt;
&lt;br /&gt;
==Learning to script with AutoIt V3==&lt;br /&gt;
&lt;br /&gt;
This tutorial has example AU3 files contained in the text, printable exercise question/answer sheet and more. Originally by lxP and updated by BrettF, this is a great starting point for those who have never scripted before. For people who may have done other languages, this will also be a good back to basics tutorial.&lt;br /&gt;
&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 Download now].&lt;br /&gt;
&lt;br /&gt;
= Video =&lt;br /&gt;
These are almost 20 AutoIt video tutorials by 403forbidden. You can view all the tutorials at the link below.  They start at a beginner level and work up from there.&lt;br /&gt;
* [http://www.youtube.com/watch?v=BLU60CD-Poo AutoIt Video Tutorials - Part 1]&lt;br /&gt;
&lt;br /&gt;
Set of tutorials by [http://www.autoitscript.com/forum/user/64654-morthawt/ Morthawt aka TutsTeach]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PL4Jcq5zn02jKpjX0nqI1_fS7mEEb5tw6z Easy Autoit Scripting Video Tutorials]&lt;br /&gt;
&lt;br /&gt;
= More complicated AutoIt commands and concepts =&lt;br /&gt;
*[[Arrays]]&lt;br /&gt;
*[[Tutorial GUIRegisterMsg|GUIRegisterMsg]]&lt;br /&gt;
*[[Interrupting a running function]]&lt;br /&gt;
*[[Variables - using Global, Local, Static and ByRef]]&lt;br /&gt;
*[[Managing Multiple GUIs|Managing multiple GUIs]]&lt;br /&gt;
*[[Setting Styles|Setting styles]]&lt;br /&gt;
*[[Moving and Resizing PopUp GUIs|Moving and resizing pop up GUIs]]&lt;br /&gt;
*[[Modal MsgBox Styles|Modal MsgBox styles]]&lt;br /&gt;
*[[Tabs]]&lt;br /&gt;
*[[Recursion]]&lt;br /&gt;
*[[ADO|Microsoft ActiveX Data Objects (ADO)]]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=93496 DllCall] - Tutorial on DllCall() &amp;amp; DllStructs.&lt;br /&gt;
* [http://bug-fix.info/dll/dll_tut.html DllCall] - Dll Tutorial (German language).&lt;br /&gt;
&lt;br /&gt;
= Tips to make your coding easier =&lt;br /&gt;
*[[Adding UDFs to AutoIt and SciTE]]&lt;br /&gt;
*[[Adding utilities to the SciTE Tools menu]]&lt;br /&gt;
*[http://www.autoitscript.com/forum/topic/131833-scite-jump-navigate-between-functions-and-regions-in-an-autoit-script/  Use tools like SciTE Jump]&lt;br /&gt;
&lt;br /&gt;
= Additional Resources =&lt;br /&gt;
The AutoIt community is itself your best source for information, tutorials and assistance with the language. AutoIt boasts a very large community of both professional and hobbyist coders, all of whom&lt;br /&gt;
volunteer their time to assist with scripting question. See below for just a few of our different forums:&lt;br /&gt;
&lt;br /&gt;
Forum Home: [http://http://www.autoitscript.com/forum/]&lt;br /&gt;
General Support Questions: [http://www.autoitscript.com/forum/forum/2-general-help-and-support/]&lt;br /&gt;
GUI Support Questions: [http://www.autoitscript.com/forum/forum/10-graphical-user-interface-gui-help-and-support/]&lt;br /&gt;
Example Scripts: [http://www.autoitscript.com/forum/forum/9-example-scripts/]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=12668</id>
		<title>Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=12668"/>
		<updated>2014-10-20T17:26:56Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;array&#039;&#039;&#039; is a [[Data_Structures|data structure]] which stores elements (variables) aligned in a computer&#039;s memory.  Arrays are referenced by an [[identifier]] (variable name) and an index specifying a desired element.  The array concept seems complex but the concept can be easily grasped.  Why are arrays so important?  The array is a fundamental data structure found in most programming languages.  &lt;br /&gt;
&lt;br /&gt;
This tutorial targets people who are beginners.  To understand how arrays work, it is imperative to try out and modify the provided samples.  Make sure that each concept is understood before the next concept is attempted.  This tutorial assumes the use of the SciTE editor.  There is a minimal version of SciTE included in the latest stable release of AutoIt (version 3.2.0.1 and above).&lt;br /&gt;
&lt;br /&gt;
== Declaring Arrays in AutoIt ==&lt;br /&gt;
&lt;br /&gt;
An array is declared in the same manner as a variable in AutoIt.  The difference is that for an array, extra information on how many elements are to be included in the array must be specified.  This information is provided by adding brackets after the identifier and a number indicating how many elements the array will possess. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Global $arr[4] ; Will make space for 4 elements.&lt;br /&gt;
Local  $arr[1] ; Will make space for 1 element.&lt;br /&gt;
Dim    $arr[3] ; Will make space for 3 elements.  Note: Avoid using Dim.  Use Global or Local instead.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In AutoIt, a variable may be converted to an array by either using the {{Help File|ReDim}} keyword or assigning a function which returns an array to the variable.  &lt;br /&gt;
&lt;br /&gt;
For example, the function {{Help File|StringSplit}} returns an array which will be assigned to $arr.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr = StringSplit(&amp;quot;This is my string. I want to split it in sentences.&amp;quot;, &#039;.&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to make really certain we have an array from {{Help File|StringSplit}}, we should check it with the {{Help File|IsArray}} built-in function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
     ; Do work on the array&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning Data to Array Elements ==&lt;br /&gt;
&lt;br /&gt;
When we declare the array we make some room in memory for future data.  We want to assign some data to the items in the array.  Now here is the catch. The array always starts at index zero.  So, the first element in the array will be accessed by zero, the second element in the array is accessed at by one and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
 Local $arr[3] ; Make room for three elements&lt;br /&gt;
 ;Assign some data&lt;br /&gt;
 $arr[0] = &amp;quot;Element 1&amp;quot;&lt;br /&gt;
 $arr[1] = &amp;quot;Element 2&amp;quot;&lt;br /&gt;
 $arr[2] = &amp;quot;Element 3&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also assign all the data in one smack like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This zero-based indexing is quite common in most computer languages, but it can be a source of headaches to beginners until it becomes second nature to them.  For example, every time you want to loop through a range of elements and the range includes the last element, you have to subtract one from the number of items your array is holding, to get the index of the last item. I.E.,  An array with three elements has a last index of two.&lt;br /&gt;
&lt;br /&gt;
So if you don&#039;t take zero-based indexing into consideration in your code, you may ask for something outside the memory area set aside for the array. When you do, you get an error message (&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Array variable has incorrect number of subscripts or subscript dimension range exceeded&amp;lt;/font&amp;gt;) and your script will cease execution.&lt;br /&gt;
&lt;br /&gt;
== Accessing Data in Arrays ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk all elements in the previous sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
For $i = 0 to 3 - 1 ; We have an array with three elements but the last index is two.&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Determine Array Size With UBound ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;3 - 1&amp;quot; construct used in the last sample looked strange.  It is not a good idea to hard-code size like that. So lets improve our sample a little. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax = 3&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [&amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to $iMax - 1&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that&#039;s a bit cleaner. It&#039;s also a lot easier to increase or decrease the size of the array. &amp;lt;br&amp;gt;&lt;br /&gt;
But say you don&#039;t know the size of the array upfront because it may come in a variable size when created dynamically.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax &lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot; &lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered &lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then&lt;br /&gt;
     $iMax = UBound($arr); get array size&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite(&amp;quot;Items in the array: &amp;quot; &amp;amp; $iMax &amp;amp; @LF)&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to $iMax - 1; subtract 1 from size to prevent an out of bounds error&lt;br /&gt;
         ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
     Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you run the above code you will see that $iMax is four and not three as you might have expected. The reason for this is that the developer of the {{Help File|StringSplit}} function thought it was a good idea to use the first item (item zero) to keep a count of valid items in the array. This makes sense in many situations as you now have an array containing data with an index starting at one. So our sample code can now be rewritten like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax&lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered&lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;)  &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
    For $i = 1 to $arr[0]&lt;br /&gt;
        ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is another good reason for keeping the count in $arr[0]. When you start to use arrays extensively, you will encounter situations where you have to create an array without knowing how many of the elements you will use. Resizing the array is a relatively expensive operation (in CPU cycles) in most languages.&lt;br /&gt;
&lt;br /&gt;
Now consider our example if our initial array has reserved space for ten items but we end up only using three. In this case iterating the array using {{Help File|UBound}} will force us to check for empty elements. While iterating with $arr[0] needs no other change than maintaining the correct count in $arr[0].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax=10&lt;br /&gt;
&lt;br /&gt;
;NOTE: We have added the count in the first element&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [3, &amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
;NOTE: We use the count in $arr[0] to indicate the last item and we start from index=1&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changing Array Sizes With ReDim ==&lt;br /&gt;
&lt;br /&gt;
As arrays are critical to algorithm implementations, and in AutoIt even more so as there is no other means of grouping data, we have to understand how to let it grow and shrink. This is where the keyword {{Help File|ReDim}} comes into the picture.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s make an example. We want our array to hold data lines but we don&#039;t know how many items we need. We make a guess, in this case five. Now, we use that array to hold data we get from a loop with a random number of iterations. If the array is too small it should automatically be increased. Before we dump the array to output, we should adjust it to the exact size it is supposed to be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $iMax = 5&lt;br /&gt;
&lt;br /&gt;
; NOTE: We have added the count in the first element&lt;br /&gt;
Local $arr[$iMax] = [0] ; Initiate the array and place a counter in the first element.&lt;br /&gt;
&lt;br /&gt;
; Generate a random number between 0 and 20&lt;br /&gt;
Local Const $iRandom = Random(0, 20, 1)&lt;br /&gt;
&lt;br /&gt;
For $i = 1 to $iRandom&lt;br /&gt;
    ; Check that the array is big enough&lt;br /&gt;
    If UBound($arr) = $i Then&lt;br /&gt;
        ; Resize the array when $i is equal to the element count in the array to prevent subscript error&lt;br /&gt;
        ReDim $arr[$arr[0] + $iMax]&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    $arr[$i] = &amp;quot;Item &amp;quot; &amp;amp; $i ; safely add data to new index element&lt;br /&gt;
&lt;br /&gt;
    $arr[0] = $i ; update the index count for future reference&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Adjust the array size. This time it is probably downward to the size of&lt;br /&gt;
; $arr[0] + 1 (remember the first item is $arr[0])&lt;br /&gt;
ReDim $arr[$arr[0] + 1] &lt;br /&gt;
&lt;br /&gt;
; Now dump the results&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Visually check that the values are sound&lt;br /&gt;
ConsoleWrite(&amp;quot;Ubound($arr):=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; &amp;quot;, $iRandom:=&amp;quot; &amp;amp; $iRandom &amp;amp; @LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how the array now has first been adjusted to a multiple of $iMax and in the last part adjusted down to a size matching the data items.&lt;br /&gt;
&lt;br /&gt;
== Passing Arrays to Functions ==&lt;br /&gt;
&lt;br /&gt;
There is no special syntax required to pass an array as a function argument unlike a low level language such as C.&lt;br /&gt;
The following example demonstrates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array)&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can not declare the variable to hold the array in the function declaration as an array. So, users could pass on a variable. So you have to check that the variable holds an array before you do array specific operations on it.&lt;br /&gt;
The following code example will cause an error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array[5])&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the tutorial you have probably noticed that there is a lot of code that is equal in each sample. I&#039;m especially thinking about the code we have used to output the array content. Let&#039;s make life easier and create a debug function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func dbgArray(ByRef $arr, $msg=&amp;quot;&amp;quot;)&lt;br /&gt;
     If $msg &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then &lt;br /&gt;
         ConsoleWrite(&amp;quot;*** &amp;quot; &amp;amp; $msg &amp;amp; &amp;quot; ***&amp;quot; &amp;amp; @LF)&lt;br /&gt;
     EndIf&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to UBound($arr) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
     Next&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite( &amp;quot;Ubound($arr)=:=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; @LF)   &lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And let&#039;s make a little function to fill our arrays with something. Note how the ArrayFiller makes sure it works on an array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller(ByRef $arr)&lt;br /&gt;
     If IsArray($arr) Then &lt;br /&gt;
         ReDim $arr[3] ; Notice we might discard content in this operation&lt;br /&gt;
     Else&lt;br /&gt;
         Local $foo[3]&lt;br /&gt;
         $arr = $foo&lt;br /&gt;
     EndIf &lt;br /&gt;
&lt;br /&gt;
     ;Fill the array&lt;br /&gt;
     $arr[0] = 2&lt;br /&gt;
     $arr[1] = &amp;quot;Fill 1&amp;quot;&lt;br /&gt;
     $arr[2] = &amp;quot;Fill 2&amp;quot;&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally some code using the new functions&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr1[1]&lt;br /&gt;
   ArrayFiller($arr1)&lt;br /&gt;
   dbgArray($arr1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code is a test on what happens when we pass a regular variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr2&lt;br /&gt;
   ArrayFiller($arr2)&lt;br /&gt;
   dbgArray($arr2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Returning Arrays From Functions ==&lt;br /&gt;
&lt;br /&gt;
As you could observe, in the previous samples, an array will be passed back and forth with the ByRef keyword infront of the variable holding the array in the function declaration.&lt;br /&gt;
&lt;br /&gt;
We could also have used the Return keyword in a function.&lt;br /&gt;
Lets re-work the ArrayFiller function to do this rather than using a variable ByRef.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller2()&lt;br /&gt;
   Local $arr = [3, &amp;quot;Fill 1&amp;quot;, &amp;quot;Fill 2&amp;quot;]&lt;br /&gt;
   Return $arr&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And now we can use the function like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $foo = ArrayFiller2()&lt;br /&gt;
 dbgArray($foo)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing Arrays ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You can not compare complete arrays:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $Array1[3] = [1, 2, 3]&lt;br /&gt;
Local $Array2[3] = [1, 2, 3]&lt;br /&gt;
Local $Array3[4] = [1, 2, 3, 4]&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array2 Then ConsoleWrite(&amp;quot;1.) $Array1 is equal to $Array2! which might be correct in some sense.&amp;quot; &amp;amp; @LF); while they contain the same data, the comparison does not work.&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array3 Then ConsoleWrite(&amp;quot;2.) $Array1 is equal to $Array3! which is incorrect.&amp;quot; &amp;amp; @LF); even though they&#039;re different in size, it&#039;s incorrectly determined that they&#039;re equal.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have the impression that such comparisons compare the memory address of the arrays instead of the array elements values. And the addresses are always different for different arrays.  You have to instead, compare all elements one after the other. It might be a good idea to first compare array sizes if that can vary for both the compared arrays!&lt;br /&gt;
&lt;br /&gt;
== Multi Dimensional Arrays ==&lt;br /&gt;
&lt;br /&gt;
Now what is a good explanation of a multi-dimensional array?&lt;br /&gt;
It could be a table where you access one item in the table at a time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local  $arr[3][3] = [[1, 2, 3], [2, 3, 4], [3, 4, 5]]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to UBound( $arr, 1) - 1&lt;br /&gt;
    For $j = 0 to UBound($arr, 2) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j] &amp;amp; @LF)&lt;br /&gt;
    Next &lt;br /&gt;
&lt;br /&gt;
    ConsoleWrite(@LF)&lt;br /&gt;
Next &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a number of dimensions not to exceed sixty-four as stated in the help file section [http://www.autoitscript.com/autoit3/docs/appendix/LimitsDefaults.htm AutoIt3 limits/Defaults].&lt;br /&gt;
&lt;br /&gt;
Here is a four dimensional example. You tell me how that initializer is for readability.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; &lt;br /&gt;
; NOTE: The following is supposed to be all on one line&lt;br /&gt;
; but we use the &amp;quot;_&amp;quot; character to split it into multiple lines for readability&lt;br /&gt;
&lt;br /&gt;
Local $arr[3][3][3][3] = _&lt;br /&gt;
		[ _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		] _&lt;br /&gt;
		]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 To UBound($arr, 1) - 1&lt;br /&gt;
	For $j = 0 To UBound($arr, 2) - 1&lt;br /&gt;
		For $k = 0 To UBound($arr, 3) - 1&lt;br /&gt;
			For $l = 0 To UBound($arr, 4) - 1&lt;br /&gt;
				ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $k &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $l &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j][$k][$l] &amp;amp; @LF)&lt;br /&gt;
			Next&lt;br /&gt;
		Next&lt;br /&gt;
	Next&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arrays in Arrays ==&lt;br /&gt;
&lt;br /&gt;
You may save an array in an array element (item). The thing is, there is no way to directly access that array stored in the element. You have to go through a variable to get access to the embedded array which may make your code overly complicated and difficult to debug.&lt;br /&gt;
&lt;br /&gt;
Remember that there may be issues if you pass an array containing arrays into a function and the embedded array is changed inside that function. So, to conclude this, try not to embed arrays within arrays unless you absolutely need to and are prepared to do rigorous testing to make sure your code will always work as expected.&lt;br /&gt;
&lt;br /&gt;
That said, here is an example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $arr[3]&lt;br /&gt;
Local $a1[3] = [2, &amp;quot;a1-1&amp;quot;,&amp;quot;a1-2&amp;quot;]&lt;br /&gt;
Local $a2[3] = [2, &amp;quot;a2-1&amp;quot;,&amp;quot;a2-2&amp;quot;]&lt;br /&gt;
$arr[1] = $a1&lt;br /&gt;
$arr[2] = $a2&lt;br /&gt;
$arr[0] = 2&lt;br /&gt;
Local $dumy&lt;br /&gt;
&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    $dumy = $arr[$i]&lt;br /&gt;
&lt;br /&gt;
    If IsArray($dumy) Then&lt;br /&gt;
        For $j = 1 to $dumy[0]&lt;br /&gt;
            ConsoleWrite(&amp;quot;$i:=&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;, $dumy[&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $dumy[$j] &amp;amp; @LF)&lt;br /&gt;
        Next&lt;br /&gt;
    Else&lt;br /&gt;
        ConsoleWrite(&amp;quot;!&amp;gt;Oops!, What happened? Expected an array!&amp;quot; &amp;amp; @LF)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More Information ==&lt;br /&gt;
&lt;br /&gt;
AutoIt features a large list of [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions (UDF)], among which is a module supplying extra array functions. You can find a reference on those functions in AutoIt&#039;s Help file as the last main chapter named [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions Reference].&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=12667</id>
		<title>Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=12667"/>
		<updated>2014-10-20T17:26:31Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;array&#039;&#039;&#039; is a [[Data_Structures|data structure]] which stores elements (variables) aligned in a computer&#039;s memory.  Arrays are referenced by an [[identifier]] (variable name) and an index specifying a desired element.  &lt;br /&gt;
&lt;br /&gt;
The array concept seems complex but the concept can be easily grasped.  Why are arrays so important?  The array is a fundamental data structure found in most programming languages.  &lt;br /&gt;
&lt;br /&gt;
This tutorial targets people who are beginners.  To understand how arrays work, it is imperative to try out and modify the provided samples.  Make sure that each concept is understood before the next concept is attempted.  This tutorial assumes the use of the SciTE editor.  There is a minimal version of SciTE included in the latest stable release of AutoIt (version 3.2.0.1 and above).&lt;br /&gt;
&lt;br /&gt;
== Declaring Arrays in AutoIt ==&lt;br /&gt;
&lt;br /&gt;
An array is declared in the same manner as a variable in AutoIt.  The difference is that for an array, extra information on how many elements are to be included in the array must be specified.  This information is provided by adding brackets after the identifier and a number indicating how many elements the array will possess. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Global $arr[4] ; Will make space for 4 elements.&lt;br /&gt;
Local  $arr[1] ; Will make space for 1 element.&lt;br /&gt;
Dim    $arr[3] ; Will make space for 3 elements.  Note: Avoid using Dim.  Use Global or Local instead.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In AutoIt, a variable may be converted to an array by either using the {{Help File|ReDim}} keyword or assigning a function which returns an array to the variable.  &lt;br /&gt;
&lt;br /&gt;
For example, the function {{Help File|StringSplit}} returns an array which will be assigned to $arr.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr = StringSplit(&amp;quot;This is my string. I want to split it in sentences.&amp;quot;, &#039;.&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to make really certain we have an array from {{Help File|StringSplit}}, we should check it with the {{Help File|IsArray}} built-in function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
     ; Do work on the array&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning Data to Array Elements ==&lt;br /&gt;
&lt;br /&gt;
When we declare the array we make some room in memory for future data.  We want to assign some data to the items in the array.  Now here is the catch. The array always starts at index zero.  So, the first element in the array will be accessed by zero, the second element in the array is accessed at by one and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
 Local $arr[3] ; Make room for three elements&lt;br /&gt;
 ;Assign some data&lt;br /&gt;
 $arr[0] = &amp;quot;Element 1&amp;quot;&lt;br /&gt;
 $arr[1] = &amp;quot;Element 2&amp;quot;&lt;br /&gt;
 $arr[2] = &amp;quot;Element 3&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also assign all the data in one smack like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This zero-based indexing is quite common in most computer languages, but it can be a source of headaches to beginners until it becomes second nature to them.  For example, every time you want to loop through a range of elements and the range includes the last element, you have to subtract one from the number of items your array is holding, to get the index of the last item. I.E.,  An array with three elements has a last index of two.&lt;br /&gt;
&lt;br /&gt;
So if you don&#039;t take zero-based indexing into consideration in your code, you may ask for something outside the memory area set aside for the array. When you do, you get an error message (&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Array variable has incorrect number of subscripts or subscript dimension range exceeded&amp;lt;/font&amp;gt;) and your script will cease execution.&lt;br /&gt;
&lt;br /&gt;
== Accessing Data in Arrays ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk all elements in the previous sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
For $i = 0 to 3 - 1 ; We have an array with three elements but the last index is two.&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Determine Array Size With UBound ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;3 - 1&amp;quot; construct used in the last sample looked strange.  It is not a good idea to hard-code size like that. So lets improve our sample a little. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax = 3&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [&amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to $iMax - 1&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that&#039;s a bit cleaner. It&#039;s also a lot easier to increase or decrease the size of the array. &amp;lt;br&amp;gt;&lt;br /&gt;
But say you don&#039;t know the size of the array upfront because it may come in a variable size when created dynamically.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax &lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot; &lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered &lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then&lt;br /&gt;
     $iMax = UBound($arr); get array size&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite(&amp;quot;Items in the array: &amp;quot; &amp;amp; $iMax &amp;amp; @LF)&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to $iMax - 1; subtract 1 from size to prevent an out of bounds error&lt;br /&gt;
         ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
     Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you run the above code you will see that $iMax is four and not three as you might have expected. The reason for this is that the developer of the {{Help File|StringSplit}} function thought it was a good idea to use the first item (item zero) to keep a count of valid items in the array. This makes sense in many situations as you now have an array containing data with an index starting at one. So our sample code can now be rewritten like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax&lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered&lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;)  &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
    For $i = 1 to $arr[0]&lt;br /&gt;
        ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is another good reason for keeping the count in $arr[0]. When you start to use arrays extensively, you will encounter situations where you have to create an array without knowing how many of the elements you will use. Resizing the array is a relatively expensive operation (in CPU cycles) in most languages.&lt;br /&gt;
&lt;br /&gt;
Now consider our example if our initial array has reserved space for ten items but we end up only using three. In this case iterating the array using {{Help File|UBound}} will force us to check for empty elements. While iterating with $arr[0] needs no other change than maintaining the correct count in $arr[0].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax=10&lt;br /&gt;
&lt;br /&gt;
;NOTE: We have added the count in the first element&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [3, &amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
;NOTE: We use the count in $arr[0] to indicate the last item and we start from index=1&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changing Array Sizes With ReDim ==&lt;br /&gt;
&lt;br /&gt;
As arrays are critical to algorithm implementations, and in AutoIt even more so as there is no other means of grouping data, we have to understand how to let it grow and shrink. This is where the keyword {{Help File|ReDim}} comes into the picture.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s make an example. We want our array to hold data lines but we don&#039;t know how many items we need. We make a guess, in this case five. Now, we use that array to hold data we get from a loop with a random number of iterations. If the array is too small it should automatically be increased. Before we dump the array to output, we should adjust it to the exact size it is supposed to be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $iMax = 5&lt;br /&gt;
&lt;br /&gt;
; NOTE: We have added the count in the first element&lt;br /&gt;
Local $arr[$iMax] = [0] ; Initiate the array and place a counter in the first element.&lt;br /&gt;
&lt;br /&gt;
; Generate a random number between 0 and 20&lt;br /&gt;
Local Const $iRandom = Random(0, 20, 1)&lt;br /&gt;
&lt;br /&gt;
For $i = 1 to $iRandom&lt;br /&gt;
    ; Check that the array is big enough&lt;br /&gt;
    If UBound($arr) = $i Then&lt;br /&gt;
        ; Resize the array when $i is equal to the element count in the array to prevent subscript error&lt;br /&gt;
        ReDim $arr[$arr[0] + $iMax]&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    $arr[$i] = &amp;quot;Item &amp;quot; &amp;amp; $i ; safely add data to new index element&lt;br /&gt;
&lt;br /&gt;
    $arr[0] = $i ; update the index count for future reference&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Adjust the array size. This time it is probably downward to the size of&lt;br /&gt;
; $arr[0] + 1 (remember the first item is $arr[0])&lt;br /&gt;
ReDim $arr[$arr[0] + 1] &lt;br /&gt;
&lt;br /&gt;
; Now dump the results&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Visually check that the values are sound&lt;br /&gt;
ConsoleWrite(&amp;quot;Ubound($arr):=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; &amp;quot;, $iRandom:=&amp;quot; &amp;amp; $iRandom &amp;amp; @LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how the array now has first been adjusted to a multiple of $iMax and in the last part adjusted down to a size matching the data items.&lt;br /&gt;
&lt;br /&gt;
== Passing Arrays to Functions ==&lt;br /&gt;
&lt;br /&gt;
There is no special syntax required to pass an array as a function argument unlike a low level language such as C.&lt;br /&gt;
The following example demonstrates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array)&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can not declare the variable to hold the array in the function declaration as an array. So, users could pass on a variable. So you have to check that the variable holds an array before you do array specific operations on it.&lt;br /&gt;
The following code example will cause an error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array[5])&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the tutorial you have probably noticed that there is a lot of code that is equal in each sample. I&#039;m especially thinking about the code we have used to output the array content. Let&#039;s make life easier and create a debug function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func dbgArray(ByRef $arr, $msg=&amp;quot;&amp;quot;)&lt;br /&gt;
     If $msg &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then &lt;br /&gt;
         ConsoleWrite(&amp;quot;*** &amp;quot; &amp;amp; $msg &amp;amp; &amp;quot; ***&amp;quot; &amp;amp; @LF)&lt;br /&gt;
     EndIf&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to UBound($arr) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
     Next&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite( &amp;quot;Ubound($arr)=:=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; @LF)   &lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And let&#039;s make a little function to fill our arrays with something. Note how the ArrayFiller makes sure it works on an array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller(ByRef $arr)&lt;br /&gt;
     If IsArray($arr) Then &lt;br /&gt;
         ReDim $arr[3] ; Notice we might discard content in this operation&lt;br /&gt;
     Else&lt;br /&gt;
         Local $foo[3]&lt;br /&gt;
         $arr = $foo&lt;br /&gt;
     EndIf &lt;br /&gt;
&lt;br /&gt;
     ;Fill the array&lt;br /&gt;
     $arr[0] = 2&lt;br /&gt;
     $arr[1] = &amp;quot;Fill 1&amp;quot;&lt;br /&gt;
     $arr[2] = &amp;quot;Fill 2&amp;quot;&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally some code using the new functions&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr1[1]&lt;br /&gt;
   ArrayFiller($arr1)&lt;br /&gt;
   dbgArray($arr1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code is a test on what happens when we pass a regular variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr2&lt;br /&gt;
   ArrayFiller($arr2)&lt;br /&gt;
   dbgArray($arr2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Returning Arrays From Functions ==&lt;br /&gt;
&lt;br /&gt;
As you could observe, in the previous samples, an array will be passed back and forth with the ByRef keyword infront of the variable holding the array in the function declaration.&lt;br /&gt;
&lt;br /&gt;
We could also have used the Return keyword in a function.&lt;br /&gt;
Lets re-work the ArrayFiller function to do this rather than using a variable ByRef.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller2()&lt;br /&gt;
   Local $arr = [3, &amp;quot;Fill 1&amp;quot;, &amp;quot;Fill 2&amp;quot;]&lt;br /&gt;
   Return $arr&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And now we can use the function like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $foo = ArrayFiller2()&lt;br /&gt;
 dbgArray($foo)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing Arrays ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You can not compare complete arrays:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $Array1[3] = [1, 2, 3]&lt;br /&gt;
Local $Array2[3] = [1, 2, 3]&lt;br /&gt;
Local $Array3[4] = [1, 2, 3, 4]&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array2 Then ConsoleWrite(&amp;quot;1.) $Array1 is equal to $Array2! which might be correct in some sense.&amp;quot; &amp;amp; @LF); while they contain the same data, the comparison does not work.&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array3 Then ConsoleWrite(&amp;quot;2.) $Array1 is equal to $Array3! which is incorrect.&amp;quot; &amp;amp; @LF); even though they&#039;re different in size, it&#039;s incorrectly determined that they&#039;re equal.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have the impression that such comparisons compare the memory address of the arrays instead of the array elements values. And the addresses are always different for different arrays.  You have to instead, compare all elements one after the other. It might be a good idea to first compare array sizes if that can vary for both the compared arrays!&lt;br /&gt;
&lt;br /&gt;
== Multi Dimensional Arrays ==&lt;br /&gt;
&lt;br /&gt;
Now what is a good explanation of a multi-dimensional array?&lt;br /&gt;
It could be a table where you access one item in the table at a time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local  $arr[3][3] = [[1, 2, 3], [2, 3, 4], [3, 4, 5]]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to UBound( $arr, 1) - 1&lt;br /&gt;
    For $j = 0 to UBound($arr, 2) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j] &amp;amp; @LF)&lt;br /&gt;
    Next &lt;br /&gt;
&lt;br /&gt;
    ConsoleWrite(@LF)&lt;br /&gt;
Next &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a number of dimensions not to exceed sixty-four as stated in the help file section [http://www.autoitscript.com/autoit3/docs/appendix/LimitsDefaults.htm AutoIt3 limits/Defaults].&lt;br /&gt;
&lt;br /&gt;
Here is a four dimensional example. You tell me how that initializer is for readability.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; &lt;br /&gt;
; NOTE: The following is supposed to be all on one line&lt;br /&gt;
; but we use the &amp;quot;_&amp;quot; character to split it into multiple lines for readability&lt;br /&gt;
&lt;br /&gt;
Local $arr[3][3][3][3] = _&lt;br /&gt;
		[ _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		] _&lt;br /&gt;
		]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 To UBound($arr, 1) - 1&lt;br /&gt;
	For $j = 0 To UBound($arr, 2) - 1&lt;br /&gt;
		For $k = 0 To UBound($arr, 3) - 1&lt;br /&gt;
			For $l = 0 To UBound($arr, 4) - 1&lt;br /&gt;
				ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $k &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $l &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j][$k][$l] &amp;amp; @LF)&lt;br /&gt;
			Next&lt;br /&gt;
		Next&lt;br /&gt;
	Next&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arrays in Arrays ==&lt;br /&gt;
&lt;br /&gt;
You may save an array in an array element (item). The thing is, there is no way to directly access that array stored in the element. You have to go through a variable to get access to the embedded array which may make your code overly complicated and difficult to debug.&lt;br /&gt;
&lt;br /&gt;
Remember that there may be issues if you pass an array containing arrays into a function and the embedded array is changed inside that function. So, to conclude this, try not to embed arrays within arrays unless you absolutely need to and are prepared to do rigorous testing to make sure your code will always work as expected.&lt;br /&gt;
&lt;br /&gt;
That said, here is an example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $arr[3]&lt;br /&gt;
Local $a1[3] = [2, &amp;quot;a1-1&amp;quot;,&amp;quot;a1-2&amp;quot;]&lt;br /&gt;
Local $a2[3] = [2, &amp;quot;a2-1&amp;quot;,&amp;quot;a2-2&amp;quot;]&lt;br /&gt;
$arr[1] = $a1&lt;br /&gt;
$arr[2] = $a2&lt;br /&gt;
$arr[0] = 2&lt;br /&gt;
Local $dumy&lt;br /&gt;
&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    $dumy = $arr[$i]&lt;br /&gt;
&lt;br /&gt;
    If IsArray($dumy) Then&lt;br /&gt;
        For $j = 1 to $dumy[0]&lt;br /&gt;
            ConsoleWrite(&amp;quot;$i:=&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;, $dumy[&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $dumy[$j] &amp;amp; @LF)&lt;br /&gt;
        Next&lt;br /&gt;
    Else&lt;br /&gt;
        ConsoleWrite(&amp;quot;!&amp;gt;Oops!, What happened? Expected an array!&amp;quot; &amp;amp; @LF)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More Information ==&lt;br /&gt;
&lt;br /&gt;
AutoIt features a large list of [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions (UDF)], among which is a module supplying extra array functions. You can find a reference on those functions in AutoIt&#039;s Help file as the last main chapter named [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions Reference].&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12666</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12666"/>
		<updated>2014-10-20T17:22:23Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* IniDelete */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each In, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each In==&lt;br /&gt;
The For Each In loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Anytime you find yourself writing the same code again you can do three things: Write the code, copy and paste the previously written code, or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values can be useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Methods for writing to an INI:&lt;br /&gt;
==IniWriteSection==&lt;br /&gt;
With this method you can create a new ini file, or add an additional section to an existing file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
IniWriteSection(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniWrite==&lt;br /&gt;
This method allows you to write a section, key or value to an existing ini file. If the file does not exist, this method will create it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;, &amp;quot;MyVal&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniRead==&lt;br /&gt;
Allows for the reading of values beneath a specified section and key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sVal = IniRead(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;, Default)&lt;br /&gt;
	ConsoleWrite($sVal &amp;amp; @CRLF) ; If INI data missing, $MyVal will return &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniReadSection==&lt;br /&gt;
This method will return a 2 dimensional array showing all of the key/value pairs for the specified section in an existing ini file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
$aArray = IniReadSection(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;)&lt;br /&gt;
   _ArrayDisplay($aArray)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniReadSectionNames==&lt;br /&gt;
Returns a 1 dimensional array showing all of the section names for an existing ini file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
$aArray = IniReadSectionNames(&amp;quot;My.ini&amp;quot;)&lt;br /&gt;
   _ArrayDisplay($aArray)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniRenameSection==&lt;br /&gt;
Rename the specified section in an existing ini file. The flag parameter can be set to 0, causing the script to fail if the new section name already exists.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
IniRenameSection(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Section2&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniDelete==&lt;br /&gt;
Delete a key from the specified section in an existing ini file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
IniDelete(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;My.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section1]&lt;br /&gt;
Key1=MyVal&lt;br /&gt;
Key2=YourVal&lt;br /&gt;
Key3=OurVal&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12665</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12665"/>
		<updated>2014-10-20T17:21:36Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* File I/O */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each In, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each In==&lt;br /&gt;
The For Each In loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Anytime you find yourself writing the same code again you can do three things: Write the code, copy and paste the previously written code, or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values can be useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Methods for writing to an INI:&lt;br /&gt;
==IniWriteSection==&lt;br /&gt;
With this method you can create a new ini file, or add an additional section to an existing file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
IniWriteSection(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniWrite==&lt;br /&gt;
This method allows you to write a section, key or value to an existing ini file. If the file does not exist, this method will create it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;, &amp;quot;MyVal&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniRead==&lt;br /&gt;
Allows for the reading of values beneath a specified section and key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sVal = IniRead(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;, Default)&lt;br /&gt;
	ConsoleWrite($sVal &amp;amp; @CRLF) ; If INI data missing, $MyVal will return &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniReadSection==&lt;br /&gt;
This method will return a 2 dimensional array showing all of the key/value pairs for the specified section in an existing ini file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
$aArray = IniReadSection(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;)&lt;br /&gt;
   _ArrayDisplay($aArray)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniReadSectionNames==&lt;br /&gt;
Returns a 1 dimensional array showing all of the section names for an existing ini file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
$aArray = IniReadSectionNames(&amp;quot;My.ini&amp;quot;)&lt;br /&gt;
   _ArrayDisplay($aArray)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniRenameSection==&lt;br /&gt;
Rename the specified section in an existing ini file. The flag parameter can be set to 0, causing the script to fail if the new section name already exists.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
IniRenameSection(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Section2&amp;quot;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniDelete==&lt;br /&gt;
Delete a key from the specified section in an existing ini file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
IniDelete(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;My.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key1=MyVal&lt;br /&gt;
Key2=YourVal&lt;br /&gt;
Key3=OurVal&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12664</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12664"/>
		<updated>2014-10-20T17:02:37Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* INI Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each In, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each In==&lt;br /&gt;
The For Each In loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Anytime you find yourself writing the same code again you can do three things: Write the code, copy and paste the previously written code, or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values can be useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Methods for writing to an INI:&lt;br /&gt;
==IniWriteSection==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWriteSection(&amp;quot;My.ini&amp;quot;, &amp;quot;Section1&amp;quot;, &amp;quot;Key1&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IniWrite==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Read:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     $MyVar = IniRead(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Default&amp;quot;); If INI data missing, $MyVar set to &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;FileName.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key=Value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***TODO: File I/O stuffs***&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12663</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12663"/>
		<updated>2014-10-20T16:57:49Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* INI Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each In, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each In==&lt;br /&gt;
The For Each In loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Anytime you find yourself writing the same code again you can do three things: Write the code, copy and paste the previously written code, or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values can be useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Methods for writing to an INI:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Read:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     $MyVar = IniRead(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Default&amp;quot;); If INI data missing, $MyVar set to &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;FileName.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key=Value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***TODO: File I/O stuffs***&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12662</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12662"/>
		<updated>2014-10-20T16:54:11Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* INI Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each In, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each In==&lt;br /&gt;
The For Each In loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Anytime you find yourself writing the same code again you can do three things: Write the code, copy and paste the previously written code, or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values can be useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Write:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Read:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     $MyVar = IniRead(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Default&amp;quot;); If INI data missing, $MyVar set to &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;FileName.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key=Value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***TODO: File I/O stuffs***&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12661</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12661"/>
		<updated>2014-10-20T16:53:07Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* User defined functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each In, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each In==&lt;br /&gt;
The For Each In loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Anytime you find yourself writing the same code again you can do three things: Write the code, copy and paste the previously written code, or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values. Useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Write:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Read:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     $MyVar = IniRead(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Default&amp;quot;); If INI data missing, $MyVar set to &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;FileName.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key=Value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***TODO: File I/O stuffs***&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12660</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12660"/>
		<updated>2014-10-20T16:51:00Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* For Each */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each In, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each In==&lt;br /&gt;
The For Each In loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Everytime you find yourselfe writing the same code again you can do three things. Write the code. Copy and paste the previously written code or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values. Useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Write:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Read:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     $MyVar = IniRead(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Default&amp;quot;); If INI data missing, $MyVar set to &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;FileName.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key=Value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***TODO: File I/O stuffs***&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12659</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12659"/>
		<updated>2014-10-20T16:50:27Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Loops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each In, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each==&lt;br /&gt;
The For Each loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Everytime you find yourselfe writing the same code again you can do three things. Write the code. Copy and paste the previously written code or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values. Useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Write:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Read:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     $MyVar = IniRead(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Default&amp;quot;); If INI data missing, $MyVar set to &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;FileName.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key=Value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***TODO: File I/O stuffs***&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12658</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12658"/>
		<updated>2014-10-20T16:48:58Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Loops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the code block we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each==&lt;br /&gt;
The For Each loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Everytime you find yourselfe writing the same code again you can do three things. Write the code. Copy and paste the previously written code or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values. Useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Write:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Read:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     $MyVar = IniRead(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Default&amp;quot;); If INI data missing, $MyVar set to &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;FileName.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key=Value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***TODO: File I/O stuffs***&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12657</id>
		<title>Tutorial Core Language</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Tutorial_Core_Language&amp;diff=12657"/>
		<updated>2014-10-20T16:28:46Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* If-ElseIf-Else */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
This is a tutorial describing the core elements of the AutoIt language.&lt;br /&gt;
&amp;lt;!-- NOTE: It would be nice if we could keep most of the code in here &amp;quot;runable&amp;quot;, so that a user reading around can just copy and paste the code into SciTE for a quick user friendly demonstration --&amp;gt;&lt;br /&gt;
=Comments=&lt;br /&gt;
Two types of comments tend to exist in every language. Comments are simply lines/blocks of code that are meant as guidelines or notes to help understand what the code is doing.&lt;br /&gt;
&lt;br /&gt;
Inline/Single-line comments may be added using a preceeding semicolon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This is a single-line comment&lt;br /&gt;
msgbox(1,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;) ; This is an inline comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where as multiline comments are a little less intuitive but just as effective...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#comments-start&lt;br /&gt;
  All code within this block is commented and will not be interpretted at compile/run time.&lt;br /&gt;
#comments-end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There&#039;s also a shorthand method to this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
 All code within this block is commented as well.&lt;br /&gt;
#ce&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
==Declarations==&lt;br /&gt;
A variable is a placeholder in memory where we can store some kind of data. In AutoIt the data is a string, number or reference to an array.&lt;br /&gt;
AutoIt has three keywords to declare a variable. Namely Global, Local and Dim. When we declare a variable we set aside some memory for the variable. &lt;br /&gt;
All variable names in AutoIt starts with a $ sign. So they are easy spotted in the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Global $gVar&lt;br /&gt;
 Local $Var&lt;br /&gt;
 Dim $i&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Arrays are simply collections of variables stored under a common name using addresses as a means of defining their position within memory. Similar to defining a variable, the only difference in defining an array is expressing the number of elements to be attributed to that collection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $aarr[4] ; 4 elements allocated.&lt;br /&gt;
Local  $barr[1] ; 1 element allocated.&lt;br /&gt;
Dim    $carr[3] ; 3 elements allocated. ; Try to avoid Dim, use Global and Local.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more on arrays visit the [[Arrays|Arrays Tutorial]] page.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
Generally speaking, scope pertains to the length of time for which a variable is visible or more precisely how long a variable is stored in memory before it returns to a free state. As such, the allocation(declaration) and deallocation(trash collection) of a variable is usually left up to the compiler/interpreter and occasionally is given to the user to play with. As a rule of thumb, all information stored in memory for a program is deallocated upon completion of the program. &lt;br /&gt;
&lt;br /&gt;
Why is this important? Scope allows a developer to track and reuse variable names for multiple occurances. Imagine having to create a unique name for every single variable stored in memory at that point. You would have to compensate for all the variable names used in the operating system, other programs running parallel to yours, and every name in your own script. It wouldn&#039;t be long before randomly generated 256 character names would be more efficient than a list of used names.&lt;br /&gt;
&lt;br /&gt;
With this in mind the three methods of declaring a variable explained above have different scopes in mind:&lt;br /&gt;
*Global variables are given scope over the entire program&#039;s run.&lt;br /&gt;
*Local variables have a scope that is immediately related to the block of code they&#039;re currently a member of.&lt;br /&gt;
*Dim variables are hybrid-like depending upon whether or not the name is already defined in a global variable status:&lt;br /&gt;
**Global variable exists of the same name&lt;br /&gt;
***Overwrites the Global variable&lt;br /&gt;
**Global variable does not exist&lt;br /&gt;
***Creates a Local variable for that block&lt;br /&gt;
&lt;br /&gt;
=Assignment=&lt;br /&gt;
Assigning a value to a variable is the only way to get things going. Fortunately, AutoIt uses loose typing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = &amp;quot;Hi there!&amp;quot;  ; $x is a string&lt;br /&gt;
$x = 7                  ; $x is an integer&lt;br /&gt;
$x = .15                ; $x is a float&lt;br /&gt;
$x = 123456789          ; $x is a double&lt;br /&gt;
$x = &amp;quot;Hello again!&amp;quot;     ; $x is back to a string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Loose typing simply means a variable is malleable and its format can be changed to your liking, this also means that you have to watch your scope and what&#039;s going in and out of that variable.&lt;br /&gt;
&lt;br /&gt;
Arrays are handled a bit differently. They may contain several different types and those types are loosely typed but the array must have a predetermined size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $y[3]&lt;br /&gt;
$y[0] = 1        ; first address is an integer&lt;br /&gt;
$y[1] = &amp;quot;two&amp;quot;    ; second address is a string&lt;br /&gt;
$y[2] = 3.33333  ; third address is a float&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Equivalently&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $z[3] = [1,&amp;quot;two&amp;quot;,3.3333]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, for more on arrays see the [[Arrays|Arrays Tutorial]].&lt;br /&gt;
&lt;br /&gt;
You may also declare and assign several variables at the same time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $x = 1, $y = &amp;quot;&amp;quot;, $z[3] = [1,2,3]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Operators=&lt;br /&gt;
===Assignment===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Assignment operator. e.g. $var = 5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;amp;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Concatenation assignment. e.g. $var &amp;amp;= &amp;quot;Hello&amp;quot; equivalent to $var = $var &amp;amp; &amp;quot;Hello&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
===Mathematical Operation===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; + &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition operator. e.g. 10 + 20&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; - &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction operator. e.g. 20 - 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; * &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplication operator. e.g. 20 * 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; / &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Division operator. e.g. 20 / 10&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; ^ &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Powers operator. e.g. 2 ^ 4&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; += &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Addition assignment. e.g. $var += 1 is equivalent to $var = $var + 1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; -= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Subtraction assignment. e.g. $var -= 1 is equivalent to $var = $var -1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; *= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Multiplicative assignment. e.g. $var *= 2 is equivalent to $var = $var * 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; /= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Divisive assignment. e.g. $var /= 2 is equivalent to $var = $var / 2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mathematical Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; = &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equal operator. e.g. If $var &amp;lt;&amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than operator. e.g. If $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;gt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Greater-than-or-Equal-to operator. e.g. If $var &amp;gt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than operator. e.g. If $var &amp;lt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;= &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Less-than-or-Equal-to operator. e.g. If $var &amp;lt;= 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String Comparison===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;  =  &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var = &amp;quot;Hi&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; == &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Equivalence operator. e.g. If $var == &amp;quot;Bye&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; &amp;lt;&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent operator. e.g. If $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case insensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Not &amp;lt;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not equivalent combinative operator. e.g. If Not $var &amp;lt;&amp;gt; &amp;quot;blah&amp;quot; Then ... ; case sensitive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logical===&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; And &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical And operator. e.g. If $var &amp;gt; 5 And $var &amp;lt; 3 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Or &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Binary logical Or operator. e.g. If $var &amp;lt;&amp;gt; 5 Or $var &amp;lt;&amp;gt; 6 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Not &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unary inversion operator. e.g. If Not $var &amp;gt; 5 Then ...&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Precedence===&lt;br /&gt;
All languages have a list of precedences that define when an operator is to be evaluated. Operators with equal precedence are evaluated from &#039;&#039;left&#039;&#039; to &#039;&#039;right&#039;&#039;.&lt;br /&gt;
 From highest to lowest:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
  &#039;&#039;&#039;Not&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; ^ &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;* /&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;+ -&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;&amp;lt; &amp;gt; &amp;lt;= &amp;gt;= = &amp;lt;&amp;gt; ==&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;And Or&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It should be noted that the use of And/Or operators evaluate from left to right such that&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt; 5 And $x &amp;gt; 3 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
checks the &#039;&#039;$x &amp;lt; 5&#039;&#039; first and if it returns false will not evaluate &#039;&#039;$x &amp;gt; 3&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similarly for Or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 If $x &amp;lt;&amp;gt; 5 Or $x &amp;lt;&amp;gt; 6 Then &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will evaluate &#039;&#039;$x &amp;lt;&amp;gt; 5&#039;&#039; and if it returns true will not evaluate &#039;&#039;$x &amp;lt;&amp;gt; 6&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All tables and information adapted from the [http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm AutoIt intro].&lt;br /&gt;
&lt;br /&gt;
=Branching=&lt;br /&gt;
Branching is to let the computer compare something and based on the result let it execute a block of code.&lt;br /&gt;
Autoit has three keywords for identifying branching. They are If, Select and Switch. In addition there are several sub keywords to identify the comparing code and assosiated block of code.&lt;br /&gt;
==If-ElseIf-Else==&lt;br /&gt;
When a test returns a true statement then execute code block down to the assosiated ElseIf, Else or EndIf keyword. If Else or Else if was encountered then jump to the EndIf Line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $x = 1&lt;br /&gt;
&lt;br /&gt;
If $x = 1 Then&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
 &lt;br /&gt;
If $x &amp;lt; 2 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
ElseIf $x &amp;gt;= 3 Then &lt;br /&gt;
   ;Code block&lt;br /&gt;
Else&lt;br /&gt;
   ;Code block&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There also exists a shorthand method of the If statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If true = 1 then MsgBox(1,&amp;quot;Is it true?&amp;quot;,&amp;quot;Yarp!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Additionally, there is the Ternary Operator, which acts as a shorthand conditional statement. The Ternary operator allows a binary choice to be executed without the overhead of an If..Else...EndIf statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
MsgBox($MB_SYSTEMMODAL, &amp;quot;Result: 1=1&amp;quot;, (1 = 1) ? &amp;quot;True&amp;quot; : &amp;quot;False&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select==&lt;br /&gt;
&#039;&#039;Select&#039;&#039; is simply a (arguably) more readable version of an if-elseif-else statement.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Select &lt;br /&gt;
     Case $var = 1&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case $var = 2&lt;br /&gt;
         ;Code block&lt;br /&gt;
     Case Else&lt;br /&gt;
         ;Code block&lt;br /&gt;
 EndSelect&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switch==&lt;br /&gt;
The Switch statement contains an interesting difference to most languages. In AutoIt&#039;s case, it is equivalent to the Select statement. Once a block of code is executed the Switch statement exits. Unlike most other languages, a &#039;&#039;break&#039;&#039; is not required at the end of each case to avoid trickle-down. This may be considered disadvantageous due to the lack of multi-conditional executions that the Switch statement is generally used for.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Switch $var&lt;br /&gt;
    Case 1&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case 2&lt;br /&gt;
        ;Code block&lt;br /&gt;
    Case Else&lt;br /&gt;
        ;Code block&lt;br /&gt;
EndSwitch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Loops=&lt;br /&gt;
A loop is used on a code block that we want to execute several times. In the codebloc we can have variables changing state for each iteration in the loop.&lt;br /&gt;
AutoIt has four types of loops. For...Next, For Each, While...Wend and Do ... Until&lt;br /&gt;
==For ... Next==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 For $i = 1 to 10 Step 2; in a For..Next loop, the For variable is automatically declared locally&lt;br /&gt;
     ConsoleWrite($i &amp;amp; @LF)&lt;br /&gt;
 Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While ... WEnd==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $var&lt;br /&gt;
 While $var &amp;lt; 100&lt;br /&gt;
     Sleep(100)&lt;br /&gt;
     $var += 1&lt;br /&gt;
 WEnd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do ... Until==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;A Do .. Until block will run at least once as the conditional check is done at the bottom of the block.&lt;br /&gt;
Local $var&lt;br /&gt;
Do&lt;br /&gt;
    Sleep(100)&lt;br /&gt;
    $var += 1&lt;br /&gt;
Until $var = 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The code inside this Do ... Until block should only run once&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample will run until we forcefully us a ExitLoop command to escape the loop&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
     $c += 1&lt;br /&gt;
     ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
     If $c = 2 Then ExitLoop&lt;br /&gt;
Until False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sample should run until $c equals 3&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $c&lt;br /&gt;
Do&lt;br /&gt;
    $c += 1&lt;br /&gt;
    ConsoleWrite(&amp;quot;Run nr &amp;quot; &amp;amp; $c &amp;amp; @crlf)&lt;br /&gt;
Until $c=3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==For Each==&lt;br /&gt;
The For Each loop is often used for associative arrays however it is often handy when you don&#039;t know the size of your current array. In this case, the syntax and implementation is very similar to javascript which is slightly off the standard.&lt;br /&gt;
Assume we have an array $arr of undetermined size:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $str = &amp;quot;&amp;quot;&lt;br /&gt;
for $stuff in $arr  ; for each item in our array&lt;br /&gt;
  $str &amp;amp;= $stuff    ; copy the item into our string&lt;br /&gt;
Next&lt;br /&gt;
MsgBox(1,&amp;quot;&amp;quot;,$str)   ; displays the contents of our string&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User defined functions=&lt;br /&gt;
A function is a code block encapsulated by the keywords Func and EndFunc. Everytime you find yourselfe writing the same code again you can do three things. Write the code. Copy and paste the previously written code or wrap the code up in a function and call the function by name in your code.&lt;br /&gt;
==Defining==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func MySimplestUDF(); define a simple user defined function&lt;br /&gt;
    ; Your customized code will go in here&lt;br /&gt;
    ; then you can call this function and have your code executed or &amp;quot;run&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Passing data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
MyUDFAcceptingArguments(&amp;quot;Some string&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func MyUDFAcceptingArguments($arg1, $arg2 = &amp;quot;Default Data&amp;quot;)&lt;br /&gt;
    MsgBox(64, $arg1, $arg2)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returning data==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $sReturn = _MyUDF_ReturnResults()&lt;br /&gt;
ConsoleWrite($sReturn &amp;amp; @CR); Display what was returned, we add @CR or @LF to drop down a line break, remove to see what happens&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _MyUDF_ReturnResults()&lt;br /&gt;
	Local $sTest = &amp;quot;Some information&amp;quot;; this will be returned&lt;br /&gt;
        ; The Return statement will tell the function to return the information in the $Is variable&lt;br /&gt;
	Return $sTest&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=File I/O=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INI Files==&lt;br /&gt;
&lt;br /&gt;
Using IniWrite &amp;amp; IniRead to store values. Useful for scripts that run from independent source (network, USB Drive, etc..).&lt;br /&gt;
&lt;br /&gt;
Write:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     IniWrite(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Read:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
     $MyVar = IniRead(&amp;quot;FileName.INI&amp;quot;, &amp;quot;Section&amp;quot;, &amp;quot;Key&amp;quot;, &amp;quot;Default&amp;quot;); If INI data missing, $MyVar set to &amp;quot;Default&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;FileName.INI&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
[Section]&lt;br /&gt;
Key=Value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***TODO: File I/O stuffs***&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12656</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12656"/>
		<updated>2014-10-20T16:16:36Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* What is proper forum etiquette?  What rules are there for the forum? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;Func dbg($msg)&lt;br /&gt;
	 DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $msg)&lt;br /&gt;
 EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;dbg(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox(16, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox(0, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is &lt;br /&gt;
&lt;br /&gt;
done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox(0, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox(0, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/forum-2/announcement-15-forum-rules-7-nov-2012/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox(262144, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox(48,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the forum rules&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/forum-6/announcement-13-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3]&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=AutoIt_Introduction&amp;diff=12655</id>
		<title>AutoIt Introduction</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=AutoIt_Introduction&amp;diff=12655"/>
		<updated>2014-10-20T16:03:57Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: Updated OS compatibility&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;[[Image:logo2.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
©1999-2012 Jonathan Bennett &amp;amp; [[AutoIt_Team | AutoIt Team]]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.autoitscript.com/autoit3/index.php AutoIt v3 Homepage]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;runtimes&amp;quot; required! &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; AutoIt was initially designed for PC &amp;quot;roll out&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
&lt;br /&gt;
* Easy to learn BASIC-like syntax&lt;br /&gt;
* Simulate keystrokes and mouse movements&lt;br /&gt;
* Manipulate windows and processes&lt;br /&gt;
* Interact with all standard windows controls&lt;br /&gt;
* Scripts can be compiled into standalone executables&lt;br /&gt;
* Create Graphical User Interfaces (GUIs)&lt;br /&gt;
* COM support&lt;br /&gt;
* Regular expressions&lt;br /&gt;
* Directly call external DLL and Windows API functions&lt;br /&gt;
* Scriptable RunAs functions&lt;br /&gt;
* Detailed helpfile and large community-based support forums&lt;br /&gt;
* Compatible with Windows XP / Server 2003 / Vista / Server 2008 / Windows 7 / Windows 8&lt;br /&gt;
* Unicode and x64 support&lt;br /&gt;
* Digitally signed for peace of mind&lt;br /&gt;
* Works with the User Account Control (UAC) found in Windows beginning with Vista&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;Aut2Exe&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
Best of all, AutoIt continues to be &#039;&#039;&#039;FREE&#039;&#039;&#039; - 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 [http://www.autoitscript.com/autoit3/ homepage].&lt;br /&gt;
&lt;br /&gt;
=Features in Detail=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Basic-like Syntax and Rich Function Set&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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. Language features include:&lt;br /&gt;
&lt;br /&gt;
* The usual high-level elements for functions, loops and expression parsing&lt;br /&gt;
* A staggering amount of string handling functions &#039;&#039;&#039;and&#039;&#039;&#039; a Perl compatible regular expression engine (using the [http://www.pcre.org/ PCRE] library).&lt;br /&gt;
* COM support&lt;br /&gt;
* Call Win32 and third-party DLL APIs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Built-in Editor with Syntax Highlighting&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AutoIt comes with a customised &amp;quot;lite&amp;quot; version of SciTE that makes editing scripts easy. Users can also [http://www.autoitscript.com/autoit3/scite/ download a complete version of SciTE] that includes additional tools to make things even easier.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standalone and Small&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;Aut2Exe&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;International and 64-bit Support&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Key and Mouse Simulation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;speed&amp;quot; and functionality.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Window Management&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Controls&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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 are not active!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Graphical User Interfaces (GUIs)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
AutoIt v3 will also allow you to create some complex GUIs - just like those below!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:gui_eg1.png|284px|GUI Example 1]] [[Image:gui_eg2.png|274px|GUI Example 2]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And much, much more...&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12619</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12619"/>
		<updated>2014-08-12T17:36:43Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;Func dbg($msg)&lt;br /&gt;
	 DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $msg)&lt;br /&gt;
 EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;dbg(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox(16, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox(0, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is &lt;br /&gt;
&lt;br /&gt;
done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox(0, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox(0, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/forum-2/announcement-15-forum-rules-7-nov-2012/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox(262144, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox(48,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the forum rules&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that.   Most of us would rather that you learn rather than just having a script written for you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the likes of [SOLVED] into the title, and redirecting people to the answer that helped you.  It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/forum-6/announcement-13-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12618</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12618"/>
		<updated>2014-08-12T17:35:46Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser? */ Removed reference to Windows 2000, as support has been dropped.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;Func dbg($msg)&lt;br /&gt;
	 DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $msg)&lt;br /&gt;
 EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;dbg(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows (BETA ONLY):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox(16, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox(0, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is &lt;br /&gt;
&lt;br /&gt;
done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox(0, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox(0, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/forum-2/announcement-15-forum-rules-7-nov-2012/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox(262144, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox(48,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the forum rules&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that.   Most of us would rather that you learn rather than just having a script written for you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the likes of [SOLVED] into the title, and redirecting people to the answer that helped you.  It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/forum-6/announcement-13-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12617</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12617"/>
		<updated>2014-08-12T17:32:24Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Where can I learn AutoIt? Are there any tutorials? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;Func dbg($msg)&lt;br /&gt;
	 DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $msg)&lt;br /&gt;
 EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;dbg(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows (BETA ONLY):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used (except on Windows 2000).&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox(16, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox(0, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is &lt;br /&gt;
&lt;br /&gt;
done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox(0, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox(0, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/forum-2/announcement-15-forum-rules-7-nov-2012/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox(262144, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox(48,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the forum rules&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that.   Most of us would rather that you learn rather than just having a script written for you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the likes of [SOLVED] into the title, and redirecting people to the answer that helped you.  It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/forum-6/announcement-13-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12616</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=12616"/>
		<updated>2014-08-12T17:31:44Z</updated>

		<summary type="html">&lt;p&gt;JLogan3o13: /* Where can I learn AutoIt? Are there any tutorials? */ Modified verbiage to point users to the forum as best source for questions and tutorials&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;Func dbg($msg)&lt;br /&gt;
	 DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $msg)&lt;br /&gt;
 EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;dbg(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows (BETA ONLY):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used (except on Windows 2000).&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once / detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox(16, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox(64, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox(0, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox(0, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows 2000 or Windows XP Pro system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is &lt;br /&gt;
&lt;br /&gt;
done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox(0, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox(0, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox(0, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the english language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will look like a doofus.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark -- not three!!! Writing a sentance without simple punctuation such as commas or other punctuation is considered lazy, which is considered a good judge of the poster&#039;s coding style. If you cannot summon the strength to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common Sense ===&lt;br /&gt;
Make sure you are not giving the impression of breaking forum rules, http://www.autoitscript.com/forum/forum-2/announcement-15-forum-rules-7-nov-2012/. Make sure you are not doing anything that can be perceived as breaking the law.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox(262144, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox(48,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox(0, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  This way you may have your script resistive against another active windows.  It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. The official forum will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the forum rules&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic, but search the forums for more information.  Posting topics like this will usually get the topic locked.&lt;br /&gt;
&lt;br /&gt;
Also posting the source (if a hacked decompiler was used) of other compiled scripts, or otherwise mentioning these hacked decompilers will probably get you banned.  It is also in violation of the AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox (0, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
If you wish to simulate decompilation for your script, you can do this using the following simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the exe with the following command line parameters your source will be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** AutoIt Specific&lt;br /&gt;
*#*** General Help and Support (Most support questions)&lt;br /&gt;
*#*** GUI Support (Support for the Graphical User Interface)&lt;br /&gt;
*#** Non-AutoIT&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat (Usually for C++ questions.)&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that.   Most of us would rather that you learn rather than just having a script written for you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the likes of [SOLVED] into the title, and redirecting people to the answer that helped you.  It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/forum-6/announcement-13-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;/div&gt;</summary>
		<author><name>JLogan3o13</name></author>
	</entry>
</feed>