<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.autoitscript.com/w/index.php?action=history&amp;feed=atom&amp;title=User%3ATrids</id>
	<title>User:Trids - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.autoitscript.com/w/index.php?action=history&amp;feed=atom&amp;title=User%3ATrids"/>
	<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User:Trids&amp;action=history"/>
	<updated>2026-04-06T00:50:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User:Trids&amp;diff=11404&amp;oldid=prev</id>
		<title>IEvKI3gv9Wrkd41u: BrokenLinks(FunctionList): ...</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User:Trids&amp;diff=11404&amp;oldid=prev"/>
		<updated>2012-11-17T13:47:20Z</updated>

		<summary type="html">&lt;p&gt;BrokenLinks(FunctionList): ...&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:47, 17 November 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Illustrates Run, RunWait, WinSetTitle, MsgBox, SplashTextOn, SplashOff&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Illustrates Run, RunWait, WinSetTitle, MsgBox, SplashTextOn, SplashOff&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We&#039;re going to automate MSPaint to play Hangman. So lets start by launching &#039;&#039;&#039;mspaint.exe&#039;&#039;&#039;. According to the AU3 helpfile, we can use either &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;Run&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/del&gt;or &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;RunWait&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;. The difference lies in when we get control back from the command.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We&#039;re going to automate MSPaint to play Hangman. So lets start by launching &#039;&#039;&#039;mspaint.exe&#039;&#039;&#039;. According to the AU3 helpfile, we can use either &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Help File|&lt;/ins&gt;Run&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}} &lt;/ins&gt;or &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Help File|&lt;/ins&gt;RunWait&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/ins&gt;. The difference lies in when we get control back from the command.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Lets see this in action. Create a file called &amp;#039;&amp;#039;&amp;#039;Hangman.au3&amp;#039;&amp;#039;&amp;#039; and copy in the following lines:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Lets see this in action. Create a file called &amp;#039;&amp;#039;&amp;#039;Hangman.au3&amp;#039;&amp;#039;&amp;#039; and copy in the following lines:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot;&gt;Line 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      MsgBox (0,&amp;quot;&amp;quot;,&amp;quot;Script continues&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      MsgBox (0,&amp;quot;&amp;quot;,&amp;quot;Script continues&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When you run this, notice that the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;MsgBox&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/del&gt;pops up only &#039;&#039;after&#039;&#039; we shutdown mspaint. This won&#039;t do, because the MsgBox is standing in for the rest of the code that we still need to write. Lets see what happens if we use &#039;&#039;&#039;Run&#039;&#039;&#039; instead, so that the MsgBox comes up &#039;&#039;while mspaint is still running&#039;&#039;. Also, notice that the title of the mspaint window says &quot;untitled - Paint&quot;: we&#039;ll change this to show that we&#039;re playing Hangman, and display a splash page for the same reason. We&#039;ll also maximise the mspaint window (see the change to the &#039;&#039;&#039;Run&#039;&#039;&#039; command).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When you run this, notice that the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Help File|&lt;/ins&gt;MsgBox&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}} &lt;/ins&gt;pops up only &#039;&#039;after&#039;&#039; we shutdown mspaint. This won&#039;t do, because the MsgBox is standing in for the rest of the code that we still need to write. Lets see what happens if we use &#039;&#039;&#039;Run&#039;&#039;&#039; instead, so that the MsgBox comes up &#039;&#039;while mspaint is still running&#039;&#039;. Also, notice that the title of the mspaint window says &quot;untitled - Paint&quot;: we&#039;ll change this to show that we&#039;re playing Hangman, and display a splash page for the same reason. We&#039;ll also maximise the mspaint window (see the change to the &#039;&#039;&#039;Run&#039;&#039;&#039; command).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We&amp;#039;ll be using the title in some further commands, so lets create a variable for it instead of typing it out each time (and possibly misspelling it!):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We&amp;#039;ll be using the title in some further commands, so lets create a variable for it instead of typing it out each time (and possibly misspelling it!):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l42&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      MsgBox (0,&amp;quot;&amp;quot;,&amp;quot;Waiting&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      MsgBox (0,&amp;quot;&amp;quot;,&amp;quot;Waiting&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;But when we run this, we see that something is wrong: the title hasn&#039;t changed! And according to the helpfile, our syntax is correct. The problem is that mspaint takes a little longer to create the window that says &quot;untitled - Paint&quot; than the script takes to get to the point where it wants to change it. So lets just make sure with &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;WinWait&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/del&gt;that the &#039;&#039;window exists&#039;&#039; before we change it with &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;WinSetTitle&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;But when we run this, we see that something is wrong: the title hasn&#039;t changed! And according to the helpfile, our syntax is correct. The problem is that mspaint takes a little longer to create the window that says &quot;untitled - Paint&quot; than the script takes to get to the point where it wants to change it. So lets just make sure with &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Help File|&lt;/ins&gt;WinWait&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}} &lt;/ins&gt;that the &#039;&#039;window exists&#039;&#039; before we change it with &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Help File|&lt;/ins&gt;WinSetTitle&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/ins&gt;.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;At the same time, we&#039;ll change the dimensions of the splash page from the defaults, by altering the parameters to the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;SplashTextOn&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/del&gt;statement.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;At the same time, we&#039;ll change the dimensions of the splash page from the defaults, by altering the parameters to the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Help File|&lt;/ins&gt;SplashTextOn&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}} &lt;/ins&gt;statement.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One last step for this lesson - if you&#039;ve been running the scripts at each step as we&#039;ve tested our changes (which is the best way to learn), you&#039;ll have several instances of mspaint hanging around unless you&#039;ve closed them manually. So lets also add a feature that closes mspaint when the script terminates, using &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;ProcessClose&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/del&gt;and capturing the Process ID for it from the &#039;&#039;&#039;Run&#039;&#039;&#039; command. Here&#039;s the final script for this stage:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One last step for this lesson - if you&#039;ve been running the scripts at each step as we&#039;ve tested our changes (which is the best way to learn), you&#039;ll have several instances of mspaint hanging around unless you&#039;ve closed them manually. So lets also add a feature that closes mspaint when the script terminates, using &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Help File|&lt;/ins&gt;ProcessClose&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}} &lt;/ins&gt;and capturing the Process ID for it from the &#039;&#039;&#039;Run&#039;&#039;&#039; command. Here&#039;s the final script for this stage:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>IEvKI3gv9Wrkd41u</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User:Trids&amp;diff=6219&amp;oldid=prev</id>
		<title>Trids at 07:28, 25 January 2005</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User:Trids&amp;diff=6219&amp;oldid=prev"/>
		<updated>2005-01-25T07:28:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Just an avid AU3 fan ;o)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
experimenting with layout etc.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Tutorials|Back to Tutorials index]]&lt;br /&gt;
&lt;br /&gt;
=Tutorial: Automating MSPaint to play Hangman=&lt;br /&gt;
==Lesson 1: Starting an application==&lt;br /&gt;
* Starts MSPaint, displays a welcome message.&lt;br /&gt;
* Illustrates Run, RunWait, WinSetTitle, MsgBox, SplashTextOn, SplashOff&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;re going to automate MSPaint to play Hangman. So lets start by launching &amp;#039;&amp;#039;&amp;#039;mspaint.exe&amp;#039;&amp;#039;&amp;#039;. According to the AU3 helpfile, we can use either [[Run]] or [[RunWait]]. The difference lies in when we get control back from the command.&lt;br /&gt;
&lt;br /&gt;
Lets see this in action. Create a file called &amp;#039;&amp;#039;&amp;#039;Hangman.au3&amp;#039;&amp;#039;&amp;#039; and copy in the following lines:&lt;br /&gt;
    &lt;br /&gt;
 ;&lt;br /&gt;
 ; Hangman with MSPaint&lt;br /&gt;
 ;&lt;br /&gt;
    ;we don&amp;#039;t need to specify the path if the exe is in the system directory..&lt;br /&gt;
     RunWait (&amp;quot;MSPAINT.EXE&amp;quot;) &lt;br /&gt;
    &lt;br /&gt;
     MsgBox (0,&amp;quot;&amp;quot;,&amp;quot;Script continues&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
When you run this, notice that the [[MsgBox]] pops up only &amp;#039;&amp;#039;after&amp;#039;&amp;#039; we shutdown mspaint. This won&amp;#039;t do, because the MsgBox is standing in for the rest of the code that we still need to write. Lets see what happens if we use &amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039; instead, so that the MsgBox comes up &amp;#039;&amp;#039;while mspaint is still running&amp;#039;&amp;#039;. Also, notice that the title of the mspaint window says &amp;quot;untitled - Paint&amp;quot;: we&amp;#039;ll change this to show that we&amp;#039;re playing Hangman, and display a splash page for the same reason. We&amp;#039;ll also maximise the mspaint window (see the change to the &amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039; command).&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ll be using the title in some further commands, so lets create a variable for it instead of typing it out each time (and possibly misspelling it!):&lt;br /&gt;
&lt;br /&gt;
 ;&lt;br /&gt;
 ; Hangman with MSPaint&lt;br /&gt;
 ;&lt;br /&gt;
 Dim $sTitle = &amp;quot;Hangman by AutoIt&amp;quot;&lt;br /&gt;
     &lt;br /&gt;
     ;Get things going&lt;br /&gt;
     SplashTextOn(&amp;quot;Hangman&amp;quot;, &amp;quot;This is a tutorial on how to use AutoIt v3&amp;quot;,-1,-1,-1,-1,16)&lt;br /&gt;
     Run (&amp;quot;MSPAINT.EXE&amp;quot;, &amp;quot;&amp;quot;, @SW_MAXIMIZE) &lt;br /&gt;
     WinSetTitle (&amp;quot;untitled - Paint&amp;quot;, &amp;quot;&amp;quot;, $sTitle)&lt;br /&gt;
     Sleep (2000)&lt;br /&gt;
     SplashOff ()&lt;br /&gt;
     &lt;br /&gt;
     MsgBox (0,&amp;quot;&amp;quot;,&amp;quot;Waiting&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
But when we run this, we see that something is wrong: the title hasn&amp;#039;t changed! And according to the helpfile, our syntax is correct. The problem is that mspaint takes a little longer to create the window that says &amp;quot;untitled - Paint&amp;quot; than the script takes to get to the point where it wants to change it. So lets just make sure with [[WinWait]] that the &amp;#039;&amp;#039;window exists&amp;#039;&amp;#039; before we change it with [[WinSetTitle]]. &lt;br /&gt;
&lt;br /&gt;
At the same time, we&amp;#039;ll change the dimensions of the splash page from the defaults, by altering the parameters to the [[SplashTextOn]] statement. &lt;br /&gt;
&lt;br /&gt;
One last step for this lesson - if you&amp;#039;ve been running the scripts at each step as we&amp;#039;ve tested our changes (which is the best way to learn), you&amp;#039;ll have several instances of mspaint hanging around unless you&amp;#039;ve closed them manually. So lets also add a feature that closes mspaint when the script terminates, using [[ProcessClose]] and capturing the Process ID for it from the &amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039; command. Here&amp;#039;s the final script for this stage:&lt;br /&gt;
&lt;br /&gt;
 ;&lt;br /&gt;
 ; Hangman with MSPaint&lt;br /&gt;
 ;&lt;br /&gt;
 Dim $sTitle = &amp;quot;Hangman by AutoIt&amp;quot;&lt;br /&gt;
     &lt;br /&gt;
     ;Get things going&lt;br /&gt;
     SplashTextOn (&amp;quot;Hangman&amp;quot;, &amp;quot;This is a tutorial on how to use AutoIt v3&amp;quot;,400,100,-1,-1,16)&lt;br /&gt;
     $nPID = Run (&amp;quot;MSPAINT.EXE&amp;quot;, &amp;quot;&amp;quot;, @SW_MAXIMIZE) &lt;br /&gt;
     WinWait (&amp;quot;untitled - Paint&amp;quot;)&lt;br /&gt;
     WinSetTitle (&amp;quot;untitled - Paint&amp;quot;, &amp;quot;&amp;quot;, $sTitle)&lt;br /&gt;
     Sleep (2000)&lt;br /&gt;
     SplashOff ()&lt;br /&gt;
     &lt;br /&gt;
     MsgBox (0,&amp;quot;&amp;quot;,&amp;quot;Waiting&amp;quot;)&lt;br /&gt;
     ProcessClose ($nPID)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lesson 2: Navigating a menu==&lt;br /&gt;
&lt;br /&gt;
* Sets Image size, saves/opens a file.&lt;br /&gt;
* Illustrates &amp;lt;Various way of navigating a menu&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion&lt;br /&gt;
&lt;br /&gt;
 code &lt;br /&gt;
 code &lt;br /&gt;
 code &lt;br /&gt;
&lt;br /&gt;
Discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion&lt;br /&gt;
&lt;br /&gt;
 code &lt;br /&gt;
 code &lt;br /&gt;
 code&lt;br /&gt;
&lt;br /&gt;
==Lesson 3: Clicks and Drags==&lt;br /&gt;
&lt;br /&gt;
* Draws some shapes in different colours, introduces AutoitSpy.&lt;br /&gt;
* Illustrates AutoitSetOption, Opt, MouseCoordMode, MouseMove, MouseClick, MouseClickDrag, MouseDown, MouseUp &lt;br /&gt;
&lt;br /&gt;
Discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion&lt;br /&gt;
&lt;br /&gt;
 code &lt;br /&gt;
 code &lt;br /&gt;
 code &lt;br /&gt;
&lt;br /&gt;
Discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion discussion&lt;br /&gt;
&lt;br /&gt;
 code &lt;br /&gt;
 code &lt;br /&gt;
 code&lt;br /&gt;
&lt;br /&gt;
==Lesson 4: Arrays and ini files==&lt;br /&gt;
&lt;br /&gt;
* Prepares for the game ahead, reads previous game settings from an INI file, loads arrays to be used in the game.&lt;br /&gt;
* Illustrates Dim, INIRead, INIWrite, InputBox &lt;br /&gt;
&lt;br /&gt;
 etc .. you know, that kind of thing .. &lt;br /&gt;
 each lesson building on the previous one, &lt;br /&gt;
 and showing good practice: &lt;br /&gt;
 indentation, naming standards, use of UDFs&lt;br /&gt;
&lt;br /&gt;
[[Tutorials|Back to Tutorials index]]&lt;/div&gt;</summary>
		<author><name>Trids</name></author>
	</entry>
</feed>