Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

How to convert GUI scripts to v3.2.12.0


  • Please log in to reply
69 replies to this topic

#61 ReFran

ReFran

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 554 posts

Posted 16 August 2008 - 08:43 PM

use -1 for subitem of _GUICtrlListView_SetItemText, see the note in the help.


Great. That it is. Didn't notice it. Thanks

Only as hint for other.
In direct translation (find/replace - only word-old to word-new) I stumbled across
_GUICtrlListViewInsertItem ( $h_listview, $i_index, $s_text )
to
_GUICtrlListView_InsertItem($hWnd, $sText, $iIndex)
(changed position - should be changed in the new helpfile pos desription by time).

Is that right, that - in a multicol listview - I've to use after
_GUICtrlListView_InsertItem($hWnd, $sText, $iIndex)
_GUICtrlListView_SetItemText($hWnd, $iIndex, $sText ,-1)
to insert the text for the total row. Or is there a shorter way.

Best regards, Reinhard

Edited by ReFran, 16 August 2008 - 08:49 PM.








#62 hessebou

hessebou

    Seeker

  • Active Members
  • 40 posts

Posted 21 August 2008 - 08:25 AM

I just made a small "updater" which will search through your scripts and add appropriate includes.
Feel free to change it since it's not very optimized and it could have some problems (Tested on one of my old projects with 400+ lines and worked flawless though)

AutoIt         
#include <Array.au3> #include <File.au3> $script=FileOpenDialog("Choose script that will be fixed",@ScriptDir,"au3 (*.au3)") $autoitdir=FileSelectFolder("Autoit Include folder","") If $autoitdir="" Then Exit If $script="" Then Exit Global  $includelines, $scriptdata Global $includestoadd[1], $count=0 $scriptdata=FileRead($script) $includes=_FileListToArray($autoitdir,"*Constants*.au3") For $i=1 To Ubound($includes)-1     _FileReadToArray($autoitdir&"\"&$includes[$i],$includelines)     For $j=1 To Ubound($includelines)-1         If StringLeft($includelines[$j],12)="Global Const" Then             $const=StringMid($includelines[$j],StringInStr($includelines[$j],"$"),StringInStr($includelines[$j],'=')-StringInStr($includelines[$j],"$")-1)             If StringInStr($scriptdata,$const) Then                 _ArrayAdd($includestoadd,$includes[$i])                 ExitLoop             EndIf                     EndIf     Next Next For $a=1 To UBound($includestoadd)-1     If StringInStr($scriptdata,"#include <"&$includestoadd[$a]&">")=0 And StringInStr($scriptdata,"#include<"&$includestoadd[$a]&">")=0 And $includestoadd[$a]<>"GUIConstants.au3" Then         _FileWriteToLine($script,1,"#include <"&$includestoadd[$a]&">")         $count+=1     EndIf Next MsgBox(0,"Result",$count&" include(s) were added")

works fine, thanks

#63 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,856 posts

Posted 24 September 2008 - 12:26 PM

Is this thread only belonging to fixing the constants ?

Mega

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#64 KegRaider

KegRaider

    Seeker

  • Active Members
  • 40 posts

Posted 22 October 2008 - 12:54 PM

I just made a small "updater" which will search through your scripts and add appropriate includes.
Feel free to change it since it's not very optimized and it could have some problems (Tested on one of my old projects with 400+ lines and worked flawless though)

AutoIt         
#include <Array.au3> #include <File.au3> $script=FileOpenDialog("Choose script that will be fixed",@ScriptDir,"au3 (*.au3)") $autoitdir=FileSelectFolder("Autoit Include folder","") If $autoitdir="" Then Exit If $script="" Then Exit Global  $includelines, $scriptdata Global $includestoadd[1], $count=0 $scriptdata=FileRead($script) $includes=_FileListToArray($autoitdir,"*Constants*.au3") For $i=1 To Ubound($includes)-1     _FileReadToArray($autoitdir&"\"&$includes[$i],$includelines)     For $j=1 To Ubound($includelines)-1         If StringLeft($includelines[$j],12)="Global Const" Then             $const=StringMid($includelines[$j],StringInStr($includelines[$j],"$"),StringInStr($includelines[$j],'=')-StringInStr($includelines[$j],"$")-1)             If StringInStr($scriptdata,$const) Then                 _ArrayAdd($includestoadd,$includes[$i])                 ExitLoop             EndIf                     EndIf     Next Next For $a=1 To UBound($includestoadd)-1     If StringInStr($scriptdata,"#include <"&$includestoadd[$a]&">")=0 And StringInStr($scriptdata,"#include<"&$includestoadd[$a]&">")=0 And $includestoadd[$a]<>"GUIConstants.au3" Then         _FileWriteToLine($script,1,"#include <"&$includestoadd[$a]&">")         $count+=1     EndIf Next MsgBox(0,"Result",$count&" include(s) were added")

Thanks for the nifty little updater monoceres, all my scripts now compile again.

#65 Jikoo

Jikoo

    Wayfarer

  • Active Members
  • Pip
  • 70 posts

Posted 04 November 2008 - 06:52 PM

Hello,

I added this excellent script to my open-source program. Thank you Monoceres and AutoIt forum members for this excellent script. :mellow:

And, I added UDF Renaming and Global Const cleaning.

Posted Image

Posted Image


It's here, on this forum


Edited by Jikoo, 30 December 2009 - 06:03 PM.

My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies).

#66 timistar

timistar

    Seeker

  • Active Members
  • 11 posts

Posted 08 January 2009 - 04:50 PM

sorry but 1 ask

hows works

i complie , and run , selct mi old scripts and appear other windwo with root directot adn aftar taht waht nothing happen


and sorry by mi english

thx

#67 Dolemite50

Dolemite50

    Prodigy

  • Active Members
  • PipPipPip
  • 157 posts

Posted 16 January 2009 - 09:39 PM

Both methods of fixing the includes problem work well. I have made the one by Jos into a little more on-demand version. This way I can open a script, and using Alt+F12 (or what you prefer), simply perform it for the script in question. Added items by Wrapper are at top. Simple.

Here is the script. I compiled it, note the additions to user options. Change paths/names to fit.

Sul.

Plain Text         
#cs Add these lines to SciTEUser.properties: # 43 SG-Script Fix Alt + F12 command.43.*.au3=$(SciteDefaultHome)\SG-ScriptFix\SG-ScriptFix.exe "$(FilePath)" command.name.43.*.au3=SG-ScriptFix using Alt+F12 command.save.before.43.*.au3=1 command.shortcut.43.*.au3=Alt+F12 #ce ; using Alt + F12 in Scite, call this script, passing File Path as parameter #include <misc.au3> #include <File.au3> Global $ScriptFile_In,$INP_AutoitDir,$Lines2Add ; first be sure script is not presently running If _Singleton("SG-ScriptFix", 1) = 0 Then   Exit ; check if paramter is passed If $CMDLINE[0] <> 1 Then Exit; please pass '"' & @ScriptFullPath & '"' for cmdline 1... ; gather script name that was passed $ScriptFile_In = $CMDLINE[1] $INP_AutoitDir = RegRead("HKLM\Software\AutoIt v3\Autoit", 'InstallDir') ; call the fix function by Jos... Fix_Includes() Func Fix_Includes()     ConsoleWrite("+ Check for missing include files:")     Local $includelines, $scriptdata     Local $count = 0, $const     $scriptdata = FileRead($ScriptFile_In)     Local $includes = _FileListToArray($INP_AutoitDir & "\include", "*Constants*.au3")     For $i = 1 To UBound($includes) - 1 ; don't include GUIConstants.au3         If $includes[$i] = "GUIConstants.au3" Then ContinueLoop ; Skip already included Include files         If StringRegExp($scriptdata, "(?s)#include(\s*?)<" & $includes[$i] & ">", 0) Then ContinueLoop ; Get all Constants from include file into Array         Local $ConstArray         $ConstArray = StringRegExp(FileRead($INP_AutoitDir & "\include\" & $includes[$i]), "(?i)Global[\s]Const[\s](.*?) = ", 3); '<(?i)test>(.*?)</(?i)test>'         For $j = 1 To UBound($ConstArray) - 1             If StringRegExp($scriptdata, "(?s)\" & $ConstArray[$j] & "", 0) Then                     $Lines2Add &= "#include <" & $includes[$i] & ">" & @CRLF                     $count += 1                     ExitLoop             EndIf         Next     Next ; Added required Include statements to the Scriptfile plus some commentlines     If $count Then         Local $H_Outf = FileOpen($ScriptFile_In, 2)         FileWriteLine($H_Outf, "; *** Start added by AutoIt3Wrapper ***" )         FileWrite($H_Outf, $Lines2Add)         FileWriteLine($H_Outf, "; *** End added by AutoIt3Wrapper ***")         FileWriteLine($H_Outf, $scriptdata)         FileClose($H_Outf)     EndIf     ConsoleWrite(" " & $count & " include(s) were added" & @CRLF) ; update directive to n to avoid running it each time     $ToTalFile = @CRLF & FileRead($ScriptFile_In)     $ToTalFile = StringRegExpReplace($ToTalFile, '(?i)' & @CRLF & '(\h?)#AutoIt3Wrapper_Fix_Includes(\h*?)=(.*?)' & @CRLF, @CRLF & '#AutoIt3Wrapper_Fix_Includes=n' & @CRLF)     $H_Outf = FileOpen($ScriptFile_In, 2)     FileWrite($H_Outf, StringMid($ToTalFile, 3))     FileClose($H_Outf) EndFunc;==>Fix_Includes

Man, this thing kept me from throwing in the ol' AutoIt towel. I took about a year hiatus and when I came back everything I opened exploded in errors. Thanks so much.

BTW, I there any sort of equivelent for remming out constants that have already been declared in the includes?

Thanks again!

#68 jefhal

jefhal

    Not The Appeaser

  • Active Members
  • PipPipPipPipPipPip
  • 708 posts

Posted 04 November 2011 - 03:25 PM

<p>I'm trying to bring my scripts into the 21st century and am now getting these errors when attempting to compile the script. I ran the include-fixer on this script and it did fix one warning I was getting. However, these all seem to be related to guilist.au3 and I'm not sure what to do to fix it:</p>
<p> </p>
<div>

<p>C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(50,33) : ERROR: $DDL_ARCHIVE previously declared as a 'Const'<br />
Global Const $DDL_ARCHIVE = 0x20<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(51,35) : ERROR: $DDL_DIRECTORY previously declared as a 'Const'<br />
Global Const $DDL_DIRECTORY = 0x10<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(52,34) : ERROR: $DDL_DRIVES previously declared as a 'Const'<br />
Global Const $DDL_DRIVES = 0x4000<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(53,37) : ERROR: $DDL_EXCLUSIVE previously declared as a 'Const'<br />
Global Const $DDL_EXCLUSIVE = 0x8000<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(54,31) : ERROR: $DDL_HIDDEN previously declared as a 'Const'<br />
Global Const $DDL_HIDDEN = 0x2<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(55,33) : ERROR: $DDL_READONLY previously declared as a 'Const'<br />
Global Const $DDL_READONLY = 0x1<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(56,34) : ERROR: $DDL_READWRITE previously declared as a 'Const'<br />
Global Const $DDL_READWRITE = 0x0<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(57,31) : ERROR: $DDL_SYSTEM previously declared as a 'Const'<br />
Global Const $DDL_SYSTEM = 0x4<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
U:\bin\AutoIt3\Examples\IsInstalled.au3(205,22) : WARNING: $out: possibly used before declaration.<br />
MsgBox(1,&quot;$out&quot;,$out)<br />
~~~~~~~~~~~~~~~~~~~~^<br />
U:\bin\AutoIt3\Examples\IsInstalled.au3(205,22) : ERROR: $out: undeclared global variable.<br />
MsgBox(1,&quot;$out&quot;,$out)<br />
~~~~~~~~~~~~~~~~~~~~^<br />
C:\Program Files (x86)\AutoIt3\Include\GuiList.au3(405,26) : ERROR: DllStructDelete(): undefined function.<br />
DllStructDelete ($p)<br />
~~~~~~~~~~~~~~~~~~~~~~~~~^<br />
U:\bin\AutoIt3\Examples\IsInstalled.au3 - 10 error(s), 1 warning(s)<br />
</p>
<p>

</p>
<p> </p>
<p><span>Here is my code:</span></p>
<p><span> </span></p>
<p><span> </span></p>
<p><span>
Plain Text         
 </span></p> <p><span>#include &lt;WindowsConstants.au3&gt;<br /> #include &lt;GUIConstantsEx.au3&gt;<br /> #Region ;**** Directives created by AutoIt3Wrapper_GUI ****<br /> #AutoIt3Wrapper_icon=U:\bin\AutoIt3\Icons\flamingwaste.ico<br /> #AutoIt3Wrapper_outfile=U:\bin\AutoIt3\Examples\IsInstalled.exe<br /> #AutoIt3Wrapper_UseX64=n<br /> #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****<br /> #Region converted Directives from U:\bin\AutoIt3\Examples\IsInstalled.au3.ini<br /> #EndRegion converted Directives from U:\bin\AutoIt3\Examples\IsInstalled.au3.ini<br /> ;<br /> #include &lt;array.au3&gt;<br /> #include &lt;DellRelatedFunctions.au3&gt;<br /> #include &lt;constants.au3&gt;<br /> #include &lt;GUIConstants.au3&gt;<br /> #include &lt;GetADAllComputersInNode.au3&gt;<br /> #include &lt;GuiList.au3&gt;<br /> #include &lt;INet.au3&gt;<br /> ;Make Active Directory Name<br /> Dim $system, $arComputers, $rightou, $leftou, $outou, $fullname, $shortname<br /> Global $var<br /> Dim $pingreply[4] = [&quot;is offline&quot;, &quot;is unreachable&quot;, &quot;is a bad destination&quot;, &quot;has an unknown error&quot;]<br /> Global $strComputer ;= @ComputerName<br /> _GetStrComputer()<br /> ;ToolTip(&quot;Starting&quot;)<br /> HotKeySet(&quot;{ESC}&quot;, &quot;_terminate&quot;)<br /> Opt(&quot;TrayIconDebug&quot;, 1)<br /> If FileExists(@TempDir &amp; &quot;\IsInstalled.ini&quot;) Then $shortname = FileReadLine(@TempDir &amp; &quot;\IsInstalled.ini&quot;, 1)<br /> ;MsgBox(1,&quot;$target&quot;,$var)<br /> GUICreate(&quot;Check If Installed&quot;, 400, 415)  ; will create a dialog box that when displayed is centered<br /> $currenttarget = GUICtrlCreateEdit($shortname, 170, 10, 215, 65, $WS_BORDER)<br /> $chgtarfile = GUICtrlCreateButton(&quot;Change Target File&quot;, 10, 10, 150, 35)<br /> $currenttarget = GUICtrlCreateLabel(&quot;Target computer(s) = &quot;, 10, 60, 150, 25)<br /> $system = GUICtrlCreateInput(&quot;&quot;, 10, 75, 150, 300, 0x0004)<br /> $checkexists = GUICtrlCreateButton(&quot;Check if software exists&quot;, 170, 340, 150, 35)<br /> $allinnode = GUICtrlCreateCheckbox(&quot;All machines in node?&quot;, 170, 310, 150, 25)<br /> $emailself = GUICtrlCreateRadio(&quot;Email results to yourself?&quot;, 175, 80, 200, 15)<br /> $emaileveryone = GUICtrlCreateRadio(&quot;Email results to everyone?&quot;, 175, 98, 200, 15)</span></p> <p><span>GUISetState(@SW_SHOW)       ; will display an empty dialog box<br /> ;MsgBox(1,&quot;GUI $system&quot;,GUICtrlRead($system))<br /> GUICtrlSetData(6, $strComputer)<br /> GUICtrlSetState(6, $GUI_FOCUS)<br /> $fullname = GUICtrlRead(3)<br /> $shortname = StringTrimLeft($fullname, StringInStr($fullname, &quot;\c$&quot;) - 1)<br /> ;MsgBox(1, &quot;Shortname&quot;, $shortname)<br /> ; Run the GUI until the dialog is closed<br /> _GetOU($strComputer)<br /> Global $output = &quot;Location: &quot; &amp; $outou<br /> ;MsgBox(1,&quot;$outOU:&quot;,$outou)<br /> While 1<br />  $msg = GUIGetMsg()</span></p> <p><span> If $msg = $allinnode Then<br />   ;MsgBox(1,&quot;$allinnode=&quot;,$allinnode)<br />   If GUICtrlRead($allinnode) = 1 Then<br />    _GetStrComputer()<br />    _GetAllComputersInNode ($strComputer)<br />    ToolTip(&quot;Please wait while computer list is being compiled&quot;)<br />    ;_ArrayDisplay($arComputers,&quot;List of all computers&quot;)<br />    _ArraySort($arComputers,0,1)<br />    $list = _ArrayToString($arComputers, @LF, 1, $arComputers[0])<br />    ;MsgBox(1,&quot;$list&quot;,StringStripCR($list))<br />    GUICtrlSetData($system, StringTrimRight($list, 1))<br />    ToolTip(&quot;&quot;)<br />   EndIf<br />  EndIf</span></p> <p><span> If $msg = $GUI_EVENT_CLOSE Then ExitLoop</span></p> <p><span> If $msg = $chgtarfile Then<br />   $arComputers = &quot;&quot;<br />   _GetStrComputer()<br />    $ping = Ping($strComputer, 500)<br />    ToolTip(&quot;Pinging strcomputer&quot;)<br />    If $ping Then; if $var was not equal to zero --- also possible: If @error = 0 Then ...<br />     ToolTip(&quot;&quot;)<br />     $targetname = FileOpenDialog(&quot;Choose target file&quot;, &quot;\\&quot; &amp; $strComputer &amp; &quot;\c$&quot;, &quot;All Files (*;*.lnk)&quot;)<br />     ;MsgBox(1, &quot;targetfile&quot;, $targetname)<br />     $fullname = &quot;\\&quot; &amp; $strComputer &amp; &quot;\c$&quot; &amp; StringTrimLeft($targetname, StringInStr($targetname, &quot;c:&quot;) + 1)<br />     ;MsgBox(1, &quot;fullname&quot;, $fullname)<br />     $shortname = StringTrimLeft($targetname, StringInStr($targetname, &quot;c$&quot;) - 2)<br />     ;MsgBox(1, &quot;shortname&quot;, $shortname)<br />     GUICtrlSetData(3, $shortname)<br />     If @error Then<br />      MsgBox(4096, &quot;&quot;, &quot;No File(s) chosen&quot;)<br />     Else<br />      ;MsgBox(4096,&quot;&quot;,&quot;You chose: &quot; &amp; $fullname)<br />      $file = FileOpen(@TempDir &amp; &quot;\IsInstalled.ini&quot;, 2) ;open temp file for writing in d&amp;s/jhall/local/temp<br />      FileWrite($file, $shortname)<br />     EndIf<br />    Else<br />     MsgBox(0, &quot;Status&quot;, $strComputer &amp; &quot; &quot; &amp; $pingreply[@error], 2)<br />     ;GUICtrlSetData(6, &quot;&quot;)<br />     $strComputer = &quot;&quot;<br />     GUICtrlSetState(6, $GUI_FOCUS)<br />     ;ExitLoop<br />    EndIf</span></p> <p><span> EndIf<br />  ; ONLY ONE COMPUTER CHOSEN<br />  If $msg = $checkexists And GUICtrlRead($allinnode) &lt;&gt; 1 Then<br />   ;MsgBox(1,&quot;Check this file&quot;,&quot;\\&quot; &amp; $strComputer &amp; &quot;\c$\&quot; &amp; StringTrimLeft($var,3))<br />   _GetStrComputer()<br />   $output = &quot;&quot;<br />   $shortname = GUICtrlRead(3)<br />   ;$fullname = StringTrimLeft($chosen,StringInStr($chosen,&quot;You chose:&quot;)-1)<br />   $ping = Ping($strComputer, 500)<br />   ToolTip(&quot;Pinging strcomputer&quot;)<br />   ;MsgBox(1,&quot;&quot;,$var)<br />   ;MsgBox(1,&quot;Ready to ping&quot;,$fullname)<br />   ;\\SYS0480\c$\You chose: <a href="file://\\SYS0480\c$\Documents">\\SYS0480\c$\Documents</a> and Settings\All Users\Desktop\AnyDVD.lnk<br />   If $ping Then; if $var was not equal to zero --- also possible: If @error = 0 Then ...<br />    ToolTip(&quot;&quot;)<br />    If FileExists(&quot;\\&quot; &amp; $strComputer &amp; $shortname) Then<br />     ;MsgBox(1,&quot;full file name&quot;,$fullname)<br />     $ver = FileGetVersion(&quot;\\&quot; &amp; $strComputer &amp; $shortname)<br />     MsgBox(64, &quot;SUCCESS!&quot;, &quot;Software is installed on &quot; &amp; $strComputer, 1)<br />     $output = $output &amp; @CRLF &amp; $strComputer &amp; &quot; has version &quot; &amp; $ver &amp; &quot; installed&quot;<br />     GUICtrlSetState(6, $GUI_FOCUS)<br />    Else<br />     MsgBox(17, &quot;FAILED&quot;, &quot;Software not found on &quot; &amp; $strComputer, 2)<br />     $output = $output &amp; @CRLF &amp; $strComputer &amp; &quot; software not installed&quot;<br />     GUICtrlSetState(6, $GUI_FOCUS)<br />    EndIf<br />   Else<br />    MsgBox(0, &quot;Status&quot;, $strComputer &amp; &quot; &quot; &amp; $pingreply[@error], 2)<br />    GUICtrlSetData(6, &quot;&quot;)<br />    $strComputer = &quot;&quot;<br />    GUICtrlSetState(6, $GUI_FOCUS)<br />    ;ExitLoop<br />   EndIf<br />   ToolTip(&quot;&quot;)<br />   _mailreport()<br />   ; ALL COMPUTERS IN AD NODE CHOSEN<br />  ElseIf $msg = $checkexists And GUICtrlRead($allinnode) = 1 Then<br />   If GUICtrlRead($allinnode) = 1 Then<br />    _GetStrComputer()<br />    _GetAllComputersInNode ($strComputer)<br />    ToolTip(&quot;Please wait while computer list is being compiled&quot;)<br />    ;_ArrayDisplay($arComputers,&quot;List of all computers&quot;)<br />    _ArraySort($arComputers,0,1)<br />    $list = _ArrayToString($arComputers, @LF, 1, $arComputers[0])<br />    ;MsgBox(1,&quot;$list&quot;,StringStripCR($list))<br />    GUICtrlSetData($system, StringTrimRight($list, 1))<br />    ToolTip(&quot;&quot;)<br />   EndIf</span></p> <p><span>  $output = &quot;&quot;<br />   For $i = 1 To $arComputers[0]<br />    $strComputer = StringStripCR($arComputers[$i])<br />    $shortname = GUICtrlRead(3)<br />    $fullname = &quot;\\&quot; &amp; $strComputer &amp; $shortname<br />    $ping = Ping($strComputer, 500)<br />    ToolTip(&quot;Pinging strcomputer&quot;)<br />    If $ping Then; if $var was not equal to zero --- also possible: If @error = 0 Then ...<br />     If FileExists($fullname) Then<br />      ;MsgBox(1,&quot;full file name&quot;,StringTrimLeft($var,StringInStr($var,&quot;<a href="file://\\&quot;)-1">\\&quot;)-1</a>))<br />      $ver = FileGetVersion($fullname)<br />      MsgBox(64, &quot;SUCCESS!&quot;, &quot;Software is installed on &quot; &amp; $strComputer, 1)<br />      $output = $output &amp; @CRLF &amp; $strComputer &amp; &quot; has version &quot; &amp; $ver &amp; &quot; installed&quot;<br />      ;GUICtrlSetState(6, $GUI_FOCUS)<br />     Else<br />      MsgBox(17, &quot;FAILED&quot;, &quot;Software not found on &quot; &amp; $strComputer, 2)<br />      $output = $output &amp; @CRLF &amp; $strComputer &amp; &quot; software not installed&quot;<br />      ;GUICtrlSetState(6, $GUI_FOCUS)<br />     EndIf<br />    Else<br />     MsgBox(0, &quot;Status&quot;, $strComputer &amp; &quot; &quot; &amp; $pingreply[@error], 2)<br />     ;GUICtrlSetData(6,&quot;&quot;)<br />     $output = $output &amp; @CRLF &amp; StringStripCR($strComputer) &amp; &quot; was not online&quot;<br />     $strComputer = &quot;&quot;<br />     ;GUICtrlSetState(6,$GUI_FOCUS)<br />     ;ExitLoop<br />    EndIf<br />    ToolTip(&quot;&quot;)<br />   Next<br />   _mailreport()<br />  EndIf<br /> WEnd<br /> $arComputers = &quot;&quot;<br /> FileClose(@TempDir &amp; &quot;\IsInstalled.ini&quot;)</span></p> <p><span>Func _GetStrComputer()<br />  If $CmdLine[0] &lt;&gt; &quot;&quot; And GUICtrlRead($system) = &quot;&quot; Then<br />   $strComputer = $CmdLine[1]<br />   Return $strComputer<br />  ElseIf GUICtrlRead($system) &lt;&gt; &quot;&quot; Then<br />   $strComputer = GUICtrlRead($system)<br />   Return $strComputer<br />  Else<br />   $strComputer = InputBox(&quot;Please enter system name&quot;,&quot;Please enter target computer&quot;,@ComputerName)<br />   ;MsgBox(1, &quot;Error&quot;, &quot;Please enter computer name&quot;)<br />  EndIf<br /> EndFunc   ;==&gt;_GetStrComputer</span></p> <p><span>Func _terminate()<br />  Exit 0<br /> EndFunc   ;==&gt;_terminate</span></p> <p><span>Func _GetOU($strComputer)<br />  Dim $scope = '&quot;ou=Souhegan High School&quot;,dc=SAU-39,dc=sprise,dc=com'<br />  RunWait(@ComSpec &amp; &quot; /c <a href="file://\\shsfilesrv\apps$\_bin\utils\AdFind.exe">\\shsfilesrv\apps$\_bin\utils\AdFind.exe</a> -b &quot; &amp; $scope &amp; ' -dn -f name=' &amp; $strComputer &amp; &quot; | <a href="file://\\student2\apps$\_bin\utils\clipboard.exe">\\student2\apps$\_bin\utils\clipboard.exe</a>&quot;, @TempDir, @SW_HIDE)<br />  ;Sleep(1000)<br />  $ou = ClipGet()<br />  MsgBox(1,&quot;$out&quot;,$out)<br />  $rightou = StringTrimLeft($ou, StringInStr($ou, &quot;OU=&quot;) + 2)<br />  ;ToolTip(&quot;$rightout&quot; &amp; $rightout)<br />  ;Sleep(1000)<br />  $outou = StringLeft($rightou, StringInStr($rightou, &quot;,&quot;, 0, 1) - 1)<br />  ToolTip($outou)<br />  ;Sleep(1000)<br />  Return $outou<br /> EndFunc   ;==&gt;_GetOU</span></p> <p><span>Func _mailreport()<br />  ClipPut(&quot;Installation report for &quot; &amp; $shortname &amp; &quot;:&quot; &amp; @CRLF &amp; $output)<br />  If $output &lt;&gt; &quot;&quot; Then MsgBox(64, &quot;Installation report for &quot; &amp; $shortname &amp; &quot;:&quot;, $output, 25)<br />  If GUICtrlRead($emailself) = 1 Or GUICtrlRead($emaileveryone) = 1 Then<br />   $chose = MsgBox(33, &quot;EMAIL Notice&quot;, &quot;Send results via email now?&quot;)<br />   If $chose = 2 Then<br />    ;Exit<br />   ElseIf GUICtrlRead($emailself) = 1 Or GUICtrlRead($emaileveryone) = 1 Then<br />    If GUICtrlRead($emailself) = 1 Then $Address = @UserName &amp; &quot;@sprise.com&quot;<br />    If GUICtrlRead($emaileveryone) = 1 Then $Address = &quot;<a href="mailto:shs-support@sprise.com">shs-support@sprise.com</a>&quot;<br />    $Subject = InputBox('Sending results as an email.', 'Please enter the name of the software that you are locating')<br />    $Body = ClipGet()<br />    MsgBox(0, 'E-Mail has been opened', 'The results are being sent! ' &amp; _INetMail($Address, &quot;Locations of: &quot; &amp; $Subject, $Body))<br />   EndIf<br />  EndIf<br /> EndFunc   ;==&gt;_mailreport</span></p> <span>
</span>
<p> </p>
<p><span>Here is the guilist include file:</span></p>
<p><span>
Plain Text         
</span></p> <p><span>#include-once</span></p> <p><span>; ------------------------------------------------------------------------------<br /> ;<br /> ; AutoIt Version: 3.1.1++<br /> ; Language:       English<br /> ; Description:    Functions that assist with Listbox.<br /> ;<br /> ; ------------------------------------------------------------------------------<br /> ; Errors<br /> Global Const $LB_ERR = -1<br /> Global Const $LB_ERRATTRIBUTE = -3<br /> Global Const $LB_ERRREQUIRED = -4<br /> Global Const $LB_ERRSPACE = -2</span></p> <p><span>; Messages to send to listbox<br /> Global Const $LB_ADDSTRING = 0x180<br /> Global Const $LB_DELETESTRING = 0x182<br /> Global Const $LB_DIR = 0x18D<br /> Global Const $LB_FINDSTRING = 0x18F<br /> Global Const $LB_FINDSTRINGEXACT = 0x1A2<br /> Global Const $LB_GETANCHORINDEX = 0x019D<br /> Global Const $LB_GETCARETINDEX = 0x019F<br /> Global Const $LB_GETCOUNT = 0x18B<br /> Global Const $LB_GETCURSEL = 0x188<br /> Global Const $LB_GETHORIZONTALEXTENT = 0x193<br /> Global Const $LB_GETITEMRECT = 0x198<br /> Global Const $LB_GETLISTBOXINFO = 0x01B2<br /> Global Const $LB_GETLOCALE = 0x1A6<br /> Global Const $LB_GETSEL = 0x0187<br /> Global Const $LB_GETSELCOUNT = 0x0190<br /> Global Const $LB_GETSELITEMS = 0X191<br /> Global Const $LB_GETTEXT = 0x0189<br /> Global Const $LB_GETTEXTLEN = 0x018A<br /> Global Const $LB_GETTOPINDEX = 0x018E<br /> Global Const $LB_INSERTSTRING = 0x181<br /> Global Const $LB_RESETCONTENT = 0x184<br /> Global Const $LB_SELECTSTRING = 0x18C<br /> Global Const $LB_SETITEMHEIGHT = 0x1A0<br /> Global Const $LB_SELITEMRANGE = 0x19B<br /> Global Const $LB_SELITEMRANGEEX = 0x0183<br /> Global Const $LB_SETANCHORINDEX = 0x19C<br /> Global Const $LB_SETCARETINDEX = 0x19E<br /> Global Const $LB_SETHORIZONTALEXTENT = 0x194<br /> Global Const $LB_SETLOCALE = 0x1A5<br /> Global Const $LB_SETSEL = 0x0185<br /> Global Const $LB_SETTOPINDEX = 0x197</span></p> <p><span>; attributes<br /> Global Const $DDL_ARCHIVE = 0x20<br /> Global Const $DDL_DIRECTORY = 0x10<br /> Global Const $DDL_DRIVES = 0x4000<br /> Global Const $DDL_EXCLUSIVE = 0x8000<br /> Global Const $DDL_HIDDEN = 0x2<br /> Global Const $DDL_READONLY = 0x1<br /> Global Const $DDL_READWRITE = 0x0<br /> Global Const $DDL_SYSTEM = 0x4</span></p> <p><span>; function list<br /> ;===============================================================================<br /> ; _GUICtrlListAddDir<br /> ; _GUICtrlListAddItem<br /> ; _GUICtrlListClear<br /> ; _GUICtrlListCount<br /> ; _GUICtrlListDeleteItem<br /> ; _GUICtrlListFindString<br /> ; _GUICtrlListGetAnchorIndex<br /> ; _GUICtrlListGetCaretIndex<br /> ; _GUICtrlListGetHorizontalExtent<br /> ; _GUICtrlListGetInfo<br /> ; _GUICtrlListGetLocale<br /> ; _GUICtrlListGetSelCount<br /> ; _GUICtrlListGetSelItems<br /> ; _GUICtrlListGetSelItemsText<br /> ; _GUICtrlListGetSelState<br /> ; _GUICtrlListGetText<br /> ; _GUICtrlListGetTextLen<br /> ; _GUICtrlListGetTopIndex<br /> ; _GUICtrlListInsertItem<br /> ; _GUICtrlListReplaceString<br /> ; _GUICtrlListSelectedIndex<br /> ; _GUICtrlListSelectString<br /> ; _GUICtrlListSelItemRange<br /> ; _GUICtrlListSelItemRangeEx<br /> ; _GUICtrlListSetAnchorIndex<br /> ; _GUICtrlListSetCaretIndex<br /> ; _GUICtrlListSetHorizontalExtent<br /> ; _GUICtrlListSetLocale<br /> ; _GUICtrlListSetSel<br /> ; _GUICtrlListSetTopIndex<br /> ; _GUICtrlListSort<br /> ; _GUICtrlListSwapString<br /> ;<br /> ; ************** TODO ******************<br /> ; _GUICtrlListAddFile<br /> ;===============================================================================</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListAddDir<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $s_Attributes - Comma-delimited string<br /> ;       $s_file - Optional for &quot;Drives&quot; only: what to get i.e *.*<br /> ; Requirement:   None<br /> ; Return Value(s): zero-based index of the last name added to the list<br /> ;       If an error occurs, the return value is $LB_ERR.<br /> ;       If there is insufficient space to store the new strings, the return value is $LB_ERRSPACE<br /> ; User CallTip:  _GUICtrlListAddDir($h_listbox, $s_Attributes[, $s_file=&quot;&quot;]) Add names to the list displayed by the list box (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):    $s_Attributes is an comma-delimited string<br /> ;        valid values are any of the following:<br /> ;         A,D,H,RO,RW,S,E,Drives<br /> ;       ARCHIVE<br /> ;        Includes archived files.<br /> ;       DIRECTORY<br /> ;        Includes subdirectories. Subdirectory names are enclosed in square brackets ([ ]).<br /> ;       HIDDEN<br /> ;        Includes hidden files.<br /> ;       READONLY<br /> ;        Includes read-only files.<br /> ;       READWRITE<br /> ;        Includes read-write files with no additional attributes. This is the default setting.<br /> ;       SYSTEM<br /> ;        Includes system files.<br /> ;       EXCLUSIVE<br /> ;        Includes only files with the specified attributes. By default, read-write files are listed even if READWRITE is not specified.<br /> ;       DRIVES<br /> ;        All mapped drives are added to the list. Drives are listed in the form [-x-], where x is the drive letter.<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListAddDir($h_listbox, $s_Attributes, $s_file = &quot;&quot;)<br />  Dim $i, $v_Attributes = &quot;&quot;, $i_drives = 0<br />  Dim $a_Attributes = StringSplit($s_Attributes, &quot;,&quot;)<br />  For $i = 1 To $a_Attributes[0]<br />   Select<br />    Case StringUpper($a_Attributes[$i]) = &quot;A&quot;<br />     If (StringLen($v_Attributes) &gt; 0) Then<br />      $v_Attributes = $v_Attributes + $DDL_ARCHIVE<br />     Else<br />      $v_Attributes = $DDL_ARCHIVE<br />     EndIf<br />    Case StringUpper($a_Attributes[$i]) = &quot;D&quot;<br />     If (StringLen($v_Attributes) &gt; 0) Then<br />      $v_Attributes = $v_Attributes + $DDL_DIRECTORY<br />     Else<br />      $v_Attributes = $DDL_DIRECTORY<br />     EndIf<br />    Case StringUpper($a_Attributes[$i]) = &quot;H&quot;<br />     If (StringLen($v_Attributes) &gt; 0) Then<br />      $v_Attributes = $v_Attributes + $DDL_HIDDEN<br />     Else<br />      $v_Attributes = $DDL_HIDDEN<br />     EndIf<br />    Case StringUpper($a_Attributes[$i]) = &quot;RO&quot;<br />     If (StringLen($v_Attributes) &gt; 0) Then<br />      $v_Attributes = $v_Attributes + $DDL_READONLY<br />     Else<br />      $v_Attributes = $DDL_READONLY<br />     EndIf<br />    Case StringUpper($a_Attributes[$i]) = &quot;RW&quot;<br />     If (StringLen($v_Attributes) &gt; 0) Then<br />      $v_Attributes = $v_Attributes + $DDL_READWRITE<br />     Else<br />      $v_Attributes = $DDL_READWRITE<br />     EndIf<br />    Case StringUpper($a_Attributes[$i]) = &quot;S&quot;<br />     If (StringLen($v_Attributes) &gt; 0) Then<br />      $v_Attributes = $v_Attributes + $DDL_SYSTEM<br />     Else<br />      $v_Attributes = $DDL_SYSTEM<br />     EndIf<br />    Case StringUpper($a_Attributes[$i]) = &quot;DRIVES&quot;<br />     $i_drives = 1<br />     $s_file = &quot;&quot;<br />     If (StringLen($v_Attributes) &gt; 0) Then<br />      $v_Attributes = $v_Attributes + $DDL_DRIVES<br />     Else<br />      $v_Attributes = $DDL_DRIVES<br />     EndIf<br />    Case StringUpper($a_Attributes[$i]) = &quot;E&quot;<br />     If (StringLen($v_Attributes) &gt; 0) Then<br />      $v_Attributes = $v_Attributes + $DDL_EXCLUSIVE<br />     Else<br />      $v_Attributes = $DDL_EXCLUSIVE<br />     EndIf<br />    Case Else<br />     ; invalid attribute<br />     Return $LB_ERRATTRIBUTE<br />   EndSelect<br />  Next<br />  If (Not $i_drives And StringLen($s_file) == 0) Then<br />   Return $LB_ERRREQUIRED<br />  EndIf<br />  Return GUICtrlSendMsg($h_listbox, $LB_DIR, $v_Attributes, $s_file)<br /> EndFunc   ;==&gt;_GUICtrlListAddDir</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListAddFile<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None.<br /> ; Return Value(s): None.<br /> ; User CallTip:<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):<br /> ; this one will require a pointer to a buffer.<br /> ;===============================================================================<br /> ;~ Func _GUICtrlListAddFile($h_listbox, $s_filename)<br /> ;~ EndFunc</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListAddItem<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $s_text - string to add<br /> ; Requirement:   None<br /> ; Return Value(s): The return value is the zero-based index of the string in<br /> ;       the list box. If an error occurs, the return value is $LB_ERR.<br /> ;       If there is insufficient space to store the new string,<br /> ;       the return value is $LB_ERRSPACE.<br /> ; User CallTip:  _GUICtrlListAddItem($h_listbox, $s_text) Add an item to the List (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    If the list box does not have the LBS_SORT style, the string is added to the<br /> ;        end of the list. Otherwise, the string is inserted into the list and the list<br /> ;        is sorted.<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListAddItem($h_listbox, $s_text)<br />  Return GUICtrlSendMsg($h_listbox, $LB_ADDSTRING, 0, $s_text)<br /> EndFunc   ;==&gt;_GUICtrlListAddItem</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListClear<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None<br /> ; Return Value(s): None<br /> ; User CallTip:  _GUICtrlListClear($h_listbox) remove all items from the list box (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListClear($h_listbox)<br />  GUICtrlSendMsg($h_listbox, $LB_RESETCONTENT, 0, 0)<br /> EndFunc   ;==&gt;_GUICtrlListClear</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListCount<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None<br /> ; Return Value(s): The return value is the number of items in the list box<br /> ;       or $LB_ERR if an error occurs<br /> ; User CallTip:  _GUICtrlListCount($h_listbox) return the number of items in the list box (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListCount($h_listbox)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETCOUNT, 0, 0)<br /> EndFunc   ;==&gt;_GUICtrlListCount</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListDeleteItem<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - index of item to delete<br /> ; Requirement:   None<br /> ; Return Value(s): The return value is a count of the strings remaining in the list.<br /> ;       The return value is $LB_ERR if the $i_index parameter specifies an<br /> ;       index greater than the number of items in the list.<br /> ; User CallTip:  _GUICtrlListDeleteItem($h_listbox, $i_index) Delete an Item from the List (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListDeleteItem($h_listbox, $i_index)<br />  Return GUICtrlSendMsg($h_listbox, $LB_DELETESTRING, $i_index, 0)<br /> EndFunc   ;==&gt;_GUICtrlListDeleteItem</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListFindString<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $s_search - string to search for<br /> ;       $i_exact - exact match or not<br /> ; Requirement:   None<br /> ; Return Value(s): The return value is the index of the matching item,<br /> ;       or $LB_ERR if the search was unsuccessful.<br /> ; User CallTip:  _GUICtrlListFind($h_listbox, $s_search[, $i_exact=0]) return the index of matching item (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    find the first string in a list box that begins with the specified string.<br /> ;       if exact is specified find the first list box string that exactly matches<br /> ;                    the specified string, except that the search is not case sensitive<br /> ;===============================================================================<br /> Func _GUICtrlListFindString($h_listbox, $s_search, $i_exact = 0)<br />  If ($i_exact) Then<br />   Return GUICtrlSendMsg($h_listbox, $LB_FINDSTRINGEXACT, -1, $s_search)<br />  Else<br />   Return GUICtrlSendMsg($h_listbox, $LB_FINDSTRING, -1, $s_search)<br />  EndIf<br /> EndFunc   ;==&gt;_GUICtrlListFindString</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetAnchorIndex<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): The return value is the index of the anchor item.<br /> ;       If an error occurs, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListGetAnchorIndex($h_listbox) Get the Anchor Idex (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    DOES NOT WORK WITH SINGLE-SELECTION LIST BOXES<br /> ;             This might not always be the first selected item--especially<br /> ;        if you select every other item via Ctrl+Click...<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetAnchorIndex($h_listbox)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETANCHORINDEX, 0, 0)<br /> EndFunc   ;==&gt;_GUICtrlListGetAnchorIndex</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetCaretIndex<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): The return value is the zero-based index of the selected list box item.<br /> ;       If nothing is selected $LB_ERR can be returned.<br /> ; User CallTip:  _GUICtrlListGetCaretIndex($h_listbox) Return index of item that has the focus rectangle (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    To determine the index of the item that has the focus rectangle in a<br /> ;       multiple-selection list box. The item may or may not be selected<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetCaretIndex($h_listbox)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETCARETINDEX, 0, 0)<br /> EndFunc   ;==&gt;_GUICtrlListGetCaretIndex</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetHorizontalExtent<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None.<br /> ; Return Value(s): The return value is the scrollable width, in pixels, of the list box.<br /> ; User CallTip:  _GUICtrlListGetHorizontalExtent($h_listbox) Retrieve from a list box the the scrollable width (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    To respond to the $LB_GETHORIZONTALEXTENT message,<br /> ;       the list box must have been defined with the $WS_HSCROLL style.<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetHorizontalExtent($h_listbox)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETHORIZONTALEXTENT, 0, 0)<br /> EndFunc   ;==&gt;_GUICtrlListGetHorizontalExtent</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetInfo<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None.<br /> ; Return Value(s): The return value is the number of items per column.<br /> ; User CallTip:  _GUICtrlListGetInfo($h_listbox) Retrieve the number of items per column in a specified list box. (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetInfo($h_listbox)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETLISTBOXINFO, 0, 0)<br /> EndFunc   ;==&gt;_GUICtrlListGetInfo</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetItemRect<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - Specifies the zero-based index of the item.<br /> ; Requirement:   Array containing the RECT, first element ($array[0]) contains the number of elements<br /> ;       If an error occurs, the return value is $LB_ERR.<br /> ; Return Value(s): The return value is the number of items per column.<br /> ; User CallTip:  _GUICtrlListGetItemRect($h_listbox, $i_index) Retrieve the dimensions of the rectangle that bounds a list box item. (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    $array[1] - left<br /> ;       $array[2] - top<br /> ;       $array[3] - right<br /> ;       $array[4] - bottom<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetItemRect($h_listbox, $i_index)<br />    #cs<br />       typedef struct _RECT {<br />       LONG left;<br />       LONG top;<br />       LONG right;<br />       LONG bottom;<br />       } RECT, *PRECT;<br />    #ce<br />    Local $RECT = &quot;int;int;int;int&quot;<br />    Local $left = 1, $top = 2, $right = 3, $bottom = 4<br />    Local $p = DllStructCreate ($RECT)<br />    If @error Then<br />       MsgBox(0, &quot;&quot;, &quot;Error in DllStructCreate &quot; &amp; @error);<br />       Exit<br />    EndIf<br />    Local $ret = GUICtrlSendMsg($h_listbox, $LB_GETITEMRECT, $i_index, DllStructGetPtr ($p))<br />    If ($ret == $LB_ERR) Then<br />       DllStructDelete ($p)<br />       Return $LB_ERR<br />    EndIf<br />    Local $array = StringSplit(DllStructGetData ($p, $left) &amp; &quot;,&quot; &amp; DllStructGetData ($p, $top) &amp; &quot;,&quot; &amp; DllStructGetData ($p, $right) &amp; &quot;,&quot; &amp; DllStructGetData ($p, $bottom), &quot;,&quot;)<br />    DllStructDelete ($p)<br />    Return $array<br /> EndFunc   ;==&gt;_GUICtrlListGetItemRect</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetLocale<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None<br /> ; Return Value(s): Returns the current Local of the listbox<br /> ;        same as @OSLang unless changed<br /> ; User CallTip:  _GUICtrlListGetLocale($h_listbox) current Local of the listbox (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    &quot;0409&quot; for U.S. English<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetLocale($h_listbox)<br />  Return Hex( GUICtrlSendMsg($h_listbox, $LB_GETLOCALE, 0, 0), 4)<br /> EndFunc   ;==&gt;_GUICtrlListGetLocale</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetSelCount<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   multiple-selection list box<br /> ; Return Value(s): The return value is the count of selected items in the list box.<br /> ;       If the list box is a single-selection list box, the return value is $LB_ERR.<br /> ; User CallTip:  _GUICtrlListGetSelCount($h_listbox) Get the number of items selected (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    Retrieve the total number of selected items in a multiple-selection list box.<br /> ;        Number of selected items (for a control with multi-select style)<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetSelCount($h_listbox)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETSELCOUNT, 0, 0)<br /> EndFunc   ;==&gt;_GUICtrlListGetSelCount</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetSelItems<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): Array of selected items indices, first element ($array[0]) contains the number indices returned<br /> ;       If the list box is a single-selection list box, the return value is $LB_ERR.<br /> ;       If no items are selected, the return value is $LB_ERR.<br /> ; User CallTip:  _GUICtrlListGetSelItems($h_listbox) Get item indices of selected items (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetSelItems($h_listbox)<br />    Local $num = _GUICtrlListGetSelCount ($h_listbox)<br />    Local $i, $struct<br />    For $i = 1 To $num<br />       $struct &amp;= &quot;int;&quot;<br />    Next<br />    $struct = StringTrimRight($struct, 1)<br />    Local $p = DllStructCreate ($struct)<br />    If @error Then<br /> ;~    MsgBox(0,&quot;&quot;,&quot;Error in DllStructCreate &quot; &amp; @error);<br />       Return $LB_ERR<br />    EndIf<br />    Local $ret = GUICtrlSendMsg($h_listbox, $LB_GETSELITEMS, $num, DllStructGetPtr ($p))<br />    If ($ret == $LB_ERR Or $ret == 0) Then<br />       DllStructDelete ($p)<br />       Return $LB_ERR<br />    EndIf<br />    Local $array<br />    For $i = 1 To $num<br />       $array &amp;= DllStructGetData ($p, $i) &amp; &quot;,&quot;<br />    Next<br />    $array = StringTrimRight($array, 1)<br />    Local $a_items = StringSplit($array, &quot;,&quot;)<br />    DllStructDelete ($p)<br />  For $i = 1 To $a_items[0]<br />   $a_items[$i] = Int($a_items[$i])<br />  Next<br />    Return $a_items<br /> EndFunc   ;==&gt;_GUICtrlListGetSelItems</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetSelItems<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): Array of selected items indices, first element ($array[0]) contains the number indices returned<br /> ;       If the list box is a single-selection list box, the return value is $LB_ERR.<br /> ;       If no items are selected, the return value is $LB_ERR.<br /> ; User CallTip:  _GUICtrlListGetSelItems($h_listbox) Get item indices of selected items (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):<br /> ;<br /> ;===============================================================================<br /> ;~ Func _GUICtrlListGetSelItems($h_listbox)<br /> ;~  Local $i, $s_list = &quot;&quot;, $i_ret<br /> ;~  For $i = 0 To GUICtrlSendMsg($h_listbox, $LB_GETCOUNT, 0, 0) - 1<br /> ;~   $i_ret = GUICtrlSendMsg($h_listbox, $LB_GETSEL, $i, 0)<br /> ;~   If ($i_ret &gt; 0) Then<br /> ;~    If (StringLen($s_list) &gt; 0) Then<br /> ;~     $s_list = $s_list &amp; ',' &amp; $i<br /> ;~    Else<br /> ;~     $s_list = $i<br /> ;~    EndIf<br /> ;~   ElseIf ($i_ret == $LB_ERR) Then<br /> ;~    Return $LB_ERR<br /> ;~   EndIf<br /> ;~  Next<br /> ;~  If (StringLen($s_list) &gt; 0) Then<br /> ;~   Return StringSplit($s_list, &quot;,&quot;)<br /> ;~  Else<br /> ;~   Return $LB_ERR<br /> ;~  EndIf<br /> ;~ EndFunc   ;==&gt;_GUICtrlListGetSelItems</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetSelItemsText<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): array of selected items text, first element ($array[0]) contains the number items returned<br /> ;       If the list box is a single-selection list box, the return value is $LB_ERR.<br /> ;       If no items are selected, the return value is $LB_ERR.<br /> ; User CallTip:  _GUICtrlListGetSelItemsText($h_listbox) Get the text of selected items (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetSelItemsText($h_listbox)<br />  Local $i, $s_list = &quot;&quot;, $i_ret<br />  For $i = 0 To GUICtrlSendMsg($h_listbox, $LB_GETCOUNT, 0, 0) - 1<br />   $i_ret = GUICtrlSendMsg($h_listbox, $LB_GETSEL, $i, 0)<br />   If ($i_ret &gt; 0) Then<br />    If (StringLen($s_list) &gt; 0) Then<br />     $s_list = $s_list &amp; ',' &amp; $i<br />    Else<br />     $s_list = $i<br />    EndIf<br />   ElseIf ($i_ret == $LB_ERR) Then<br />    Return $LB_ERR<br />   EndIf<br />  Next ;$s_list should now equal the selected items<br />  <br />  If (StringLen($s_list) &gt; 0) Then<br />   Local $a_text = StringSplit($s_list, &quot;,&quot;)<br />   For $i = 1 To $a_text[0]<br />    $a_text[$i] = GUICtrlRecvMsg($h_listbox, $LB_GETTEXT, $a_text[$i], 1)<br />   Next<br />   Return $a_text<br />  Else<br />   Return $LB_ERR<br />  EndIf<br /> EndFunc   ;==&gt;_GUICtrlListGetSelItemsText</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetSelState<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - Specifies the zero-based index of the item<br /> ; Requirement:   None<br /> ; Return Value(s): If an item is selected, the return value is greater than zero<br /> ;        otherwise, it is zero. If an error occurs, the return value is $LB_ERR.<br /> ; User CallTip:  _GUICtrlListGetSelState($h_listbox, $i_index) Get the selection state of item (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetSelState($h_listbox, $i_index)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETSEL, $i_index, 0)<br /> EndFunc   ;==&gt;_GUICtrlListGetSelState</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetText<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - Specifies the zero-based index of the string to retrieve<br /> ; Requirement:   None<br /> ; Return Value(s): The return value is the item string.<br /> ;       If $i_index does not specify a valid index, the return value is $LB_ERR.<br /> ; User CallTip:  _GUICtrlListGetText($h_listbox, $i_index) Returns the item (string) at the specified index (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetText($h_listbox, $i_index)<br />  Return GUICtrlRecvMsg($h_listbox, $LB_GETTEXT, $i_index, 1)<br /> EndFunc   ;==&gt;_GUICtrlListGetText</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetTextLen<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - Zero-based index of item<br /> ; Requirement:   None<br /> ; Return Value(s): The return value is the length of the string<br /> ;       If the wParam parameter does not specify a valid index, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListGetTextLen($h_listbox, $i_index) alternative to StringLen (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetTextLen($h_listbox, $i_index)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETTEXTLEN, $i_index, 0)<br /> EndFunc   ;==&gt;_GUICtrlListGetTextLen</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetTopIndex<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None<br /> ; Return Value(s): The return value is the index of the first visible item in the list box.<br /> ;       If the list is empty then $LB_ERR is returned.<br /> ; User CallTip:  _GUICtrlListGetTopIndex($h_listbox) retrieve the index of the first visible item in a list (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):    Initially the item with index 0 is at the top of the list box, but if<br /> ;        the list box contents have been scrolled another item may be at the top.<br /> ;        Returns index of the first visible item in the list box<br /> ;        useful since contents for a long list will scroll<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetTopIndex($h_listbox)<br />  If (Not GUICtrlSendMsg($h_listbox, $LB_GETCOUNT, 0, 0)) Then<br />   Return $LB_ERR<br />  Else<br />   Return GUICtrlSendMsg($h_listbox, $LB_GETTOPINDEX, 0, 0)<br />  EndIf<br /> EndFunc   ;==&gt;_GUICtrlListGetTopIndex</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListInsertItem<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $s_text - String to insert<br /> ;       $i_index - Optional: index to insert at<br /> ; Requirement:   None<br /> ; Return Value(s): The return value is the index of the position at which the string was inserted.<br /> ;       If an error occurs, the return value is $LB_ERR. If there is insufficient space<br /> ;       to store the new string, the return value is $LB_ERRSPACE.<br /> ; User CallTip:  _GUICtrlListInsertItem($h_listbox, $s_text[, $i_index=-1]) insert a string into the list (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    If this parameter is –1, the string is added to the end of the list.<br /> ;        Unlike the _GUICtrlListAddItem, this function does not cause a list<br /> ;        with the LBS_SORT style to be sorted.<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListInsertItem($h_listbox, $s_text, $i_index = -1)<br />  Return GUICtrlSendMsg($h_listbox, $LB_INSERTSTRING, $i_index, $s_text)<br /> EndFunc   ;==&gt;_GUICtrlListInsertItem</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListReplaceString<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - Zero-based index of the item to replace<br /> ;       $s_newString - String to replace old string<br /> ; Requirement:   None<br /> ; Return Value(s): If an error occurs, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListReplaceString($h_listbox, $i_index, $s_newString) Replaces the text of an item at index (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListReplaceString($h_listbox, $i_index, $s_newString)<br />  If (GUICtrlSendMsg($h_listbox, $LB_DELETESTRING, $i_index, 0) == $LB_ERR) Then Return $LB_ERR<br />  If (GUICtrlSendMsg($h_listbox, $LB_INSERTSTRING, $i_index, $s_newString) == $LB_ERR) Then Return $LB_ERR<br /> EndFunc   ;==&gt;_GUICtrlListReplaceString</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSelectedIndex<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None<br /> ; Return Value(s): In a single-selection list box, the return value is the zero-based<br /> ;       index of the currently selected item. If there is no selection,<br /> ;       the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListSelectedIndex($h_listbox) return the index of selected item (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    Do not use this with a multiple-selection list box.<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSelectedIndex($h_listbox)<br />  Return GUICtrlSendMsg($h_listbox, $LB_GETCURSEL, 0, 0)<br /> EndFunc   ;==&gt;_GUICtrlListSelectedIndex</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSelectString<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $s_text - String to select<br /> ;       $i_index - Optional: Zero-based index of the item before the first item to be searched<br /> ; Requirement:   None<br /> ; Return Value(s): If the search is successful, the return value is the index of the selected item.<br /> ;       If the search is unsuccessful, the return value is $LB_ERR and the current selection is not changed.<br /> ; User CallTip:  _GUICtrlListSelectString($h_listbox, $s_text[, $i_index=-1]) select item using search string (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    If $i_index is –1, the entire list box is searched from the beginning<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSelectString($h_listbox, $s_search, $i_index = -1)<br />  Return GUICtrlSendMsg($h_listbox, $LB_SELECTSTRING, $i_index, $s_search)<br /> EndFunc   ;==&gt;_GUICtrlListSelectString</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSelItemRange<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_flag - Set/Remove select<br /> ;       $i_start - Zero-based index of the first item to select<br /> ;       $i_stop - Zero-based index of the last item to select<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): If an error occurs, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListSelItemRange($h_listbox, $i_flag, $i_start, $i_stop) Select range by index in a multiple-selection list box (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):    DOES NOT WORK WITH SINGLE-SELECTION LIST BOXES<br /> ;        Select items from $i_start to $stop indices (inclusive)<br /> ;       Can select a range only within the first 65,536 items<br /> ;        $i_flag == 1 selects<br /> ;        $i_flag == 0 removes select<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSelItemRange($h_listbox, $i_flag, $i_start, $i_stop)<br />  Return GUICtrlSendMsg($h_listbox, $LB_SELITEMRANGE, $i_flag, $i_stop * 65536 + $i_start)<br /> EndFunc   ;==&gt;_GUICtrlListSelItemRange</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSelItemRangeEx<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_start - Zero-based index of the first item to select<br /> ;       $i_stop - Zero-based index of the last item to select<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): If an error occurs, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListSelItemRangeEx($h_listbox, $i_start, $i_stop) Selects items from $i_start to $i_stop (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    DOES NOT WORK WITH SINGLE-SELECTION LIST BOXES<br /> ;        If $i_start &gt; $i_stop Then items are un-selected<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSelItemRangeEx($h_listbox, $i_start, $i_stop)<br />  Return GUICtrlSendMsg($h_listbox, $LB_SELITEMRANGEEX, $i_start, $i_stop)<br /> EndFunc   ;==&gt;_GUICtrlListSelItemRangeEx</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSetAnchorIndex<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - Specifies the index of the new anchor item.<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): If the message succeeds, the return value is zero.<br /> ;       If the message fails, the return value is $LB_ERR.<br /> ; User CallTip:  _GUICtrlListSetAnchorIndex($h_listbox, $i_index) Set the Anchor Idex (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    DOES NOT WORK WITH SINGLE-SELECTION LIST BOXES<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSetAnchorIndex($h_listbox, $i_index)<br />  Return GUICtrlSendMsg($h_listbox, $LB_SETANCHORINDEX, $i_index, 0)<br /> EndFunc   ;==&gt;_GUICtrlListSetAnchorIndex</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListGetCaretIndex<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - Specifies the zero-based index of the list box item that is to receive the focus rectangle.<br /> ;       $i_bool - Optional: If this value is FALSE, the item is scrolled until it is fully visible; if it is TRUE, the item is scrolled until it is at least partially visible.<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): The return value is the zero-based index of the selected list box item.<br /> ;       If nothing is selected $LB_ERR can be returned.<br /> ; User CallTip:  _GUICtrlListSetCaretIndex($h_listbox, $i_index[, $i_bool=1]) Set the focus rectangle to the item at the specified index (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    DOES NOT WORK WITH SINGLE-SELECTION LIST BOXES<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSetCaretIndex($h_listbox, $i_index, $i_bool = 1)<br />  Return GUICtrlSendMsg($h_listbox, $LB_SETCARETINDEX, $i_index, $i_bool)<br /> EndFunc   ;==&gt;_GUICtrlListSetCaretIndex</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSetHorizontalExtent<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_pixels - Specifies the number of pixels by which the list box can be scrolled.<br /> ; Requirement:   None.<br /> ; Return Value(s): None.<br /> ; User CallTip:  _GUICtrlListSetHorizontalExtent($h_listbox, $i_num) Set the width, in pixels, by which a list box can be scrolled horizontally (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ; Note(s):    To respond to the $LB_SETHORIZONTALEXTENT message,<br /> ;       the list box must have been defined with the $WS_HSCROLL style.<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSetHorizontalExtent($h_listbox, $i_pixels)<br />  GUICtrlSendMsg($h_listbox, $LB_SETHORIZONTALEXTENT, $i_pixels, 0)<br /> EndFunc   ;==&gt;_GUICtrlListSetHorizontalExtent</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSetLocale<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $s_locale - locale<br /> ; Requirement:   None<br /> ; Return Value(s): Returns previous locale or $LB_ERR<br /> ; User CallTip:  _GUICtrlListSetLocale($h_listbox, $s_locale) Set the locale (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    &quot;0409&quot; for U.S. English<br /> ;       see @OSLang for string values<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSetLocale($h_listbox, $s_locale)<br />  Return Hex( GUICtrlSendMsg($h_listbox, $LB_SETLOCALE, Dec($s_locale), 0), 4)<br /> EndFunc   ;==&gt;_GUICtrlListSetLocale</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSetSel<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_flag - Optional: Select/UnSelect<br /> ;       $i_index - Optional: Specifies the zero-based index of the item<br /> ; Requirement:   multi-select style<br /> ; Return Value(s): If an error occurs, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListSetSel($h_listbox [, $i_flag] , $i_index]]) Select string(s) in a multiple-selection list box (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):    DOES NOT WORK WITH SINGLE-SELECTION LIST BOXES<br /> ;        $i_flag == 0 means unselect<br /> ;        $i_flag == 1 means select<br /> ;       $i_flag == -1 means toggle select/unselect of item<br /> ;        An $i_index of -1 means to toggle select/unselect of all items (ignores the $i_flag).<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSetSel($h_listbox, $i_flag = -1, $i_index = -1)<br />  Local $i_ret<br />  If $i_index == -1 Then ; toggle all<br />   For $i_index = 0 To GUICtrlSendMsg($h_listbox, $LB_GETCOUNT, 0, 0) - 1<br />    $i_ret = GUICtrlSendMsg($h_listbox, $LB_GETSEL, $i_index, 0)<br />    If ($i_ret == $LB_ERR) Then Return $LB_ERR<br />    If ($i_ret &gt; 0) Then ;If Selected Then<br />     $i_ret = GUICtrlSendMsg($h_listbox, $LB_SETSEL, 0, $i_index)<br />    Else<br />     $i_ret = GUICtrlSendMsg($h_listbox, $LB_SETSEL, 1, $i_index)<br />    EndIf<br />    If ($i_ret == $LB_ERR) Then Return $LB_ERR<br />   Next<br />  ElseIf $i_flag == -1 Then ; toggle state of index<br />   If GUICtrlSendMsg($h_listbox, $LB_GETSEL, $i_index, 0) Then ;If Selected Then<br />    Return GUICtrlSendMsg($h_listbox, $LB_SETSEL, 0, $i_index)<br />   Else<br />    Return GUICtrlSendMsg($h_listbox, $LB_SETSEL, 1, $i_index)<br />   EndIf<br />  Else<br />   Return GUICtrlSendMsg($h_listbox, $LB_SETSEL, $i_flag, $i_index)<br />  EndIf<br /> EndFunc   ;==&gt;_GUICtrlListSetSel</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSetTopIndex<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_index - Specifies the zero-based index of the item<br /> ; Requirement:   None<br /> ; Return Value(s): If an error occurs, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListSetTopIndex($h_listbox, $i_index) ensure that a particular item in a list box is visible (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   CyberSlug<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSetTopIndex($h_listbox, $i_index)<br />  Return GUICtrlSendMsg($h_listbox, $LB_SETTOPINDEX, $i_index, 0)<br /> EndFunc   ;==&gt;_GUICtrlListSetTopIndex</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSort<br /> ; Parameter(s):  $h_listbox - controlID<br /> ; Requirement:   None<br /> ; Return Value(s): If an error occurs, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListSort($h_listbox) Re-sorts list box if it has the LBS_SORT style (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):    Re-sorts list box if it has the LBS_SORT style<br /> ;        Might be useful if you use InsertString<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSort($h_listbox)<br />  Local $bak = GUICtrlRecvMsg($h_listbox, $LB_GETTEXT, 0, 1)<br />  If ($bak == $LB_ERR) Then Return $LB_ERR<br />  If (GUICtrlSendMsg($h_listbox, $LB_DELETESTRING, 0, 0) == $LB_ERR) Then Return $LB_ERR<br />  Return GUICtrlSendMsg($h_listbox, $LB_ADDSTRING, 0, $bak)<br /> EndFunc   ;==&gt;_GUICtrlListSort</span></p> <p><span>;===============================================================================<br /> ;<br /> ; Description:   _GUICtrlListSwapString<br /> ; Parameter(s):  $h_listbox - controlID<br /> ;       $i_indexA - Zero-based index item to swap<br /> ;       $i_indexB - Zero-based index item to swap<br /> ; Requirement:   None<br /> ; Return Value(s): If an error occurs, the return value is $LB_ERR<br /> ; User CallTip:  _GUICtrlListSwapString($h_listbox, $i_indexA, $i_indexB) Swaps the text of two items at the specified indices (required: &lt;GuiList.au3&gt;)<br /> ; Author(s):   Gary Frost (<a href="mailto:custompcs@charter.net">custompcs@charter.net</a>)<br /> ;                    CyberSlug<br /> ; Note(s):    None<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListSwapString($h_listbox, $i_indexA, $i_indexB)<br />  Local $itemA = GUICtrlRecvMsg($h_listbox, $LB_GETTEXT, $i_indexA, 1)<br />  Local $itemB = GUICtrlRecvMsg($h_listbox, $LB_GETTEXT, $i_indexB, 1)<br />  If ($itemA == $LB_ERR Or $itemB == $LB_ERR) Then Return $LB_ERR<br />  If (GUICtrlSendMsg($h_listbox, $LB_DELETESTRING, $i_indexA, 0) == $LB_ERR) Then Return $LB_ERR<br />  If (GUICtrlSendMsg($h_listbox, $LB_INSERTSTRING, $i_indexA, $itemB) == $LB_ERR) Then Return $LB_ERR<br />  <br />  If (GUICtrlSendMsg($h_listbox, $LB_DELETESTRING, $i_indexB, 0) == $LB_ERR) Then Return $LB_ERR<br />  If (GUICtrlSendMsg($h_listbox, $LB_INSERTSTRING, $i_indexB, $itemA) == $LB_ERR) Then Return $LB_ERR<br /> EndFunc   ;==&gt;_GUICtrlListSwapString</span></p> <p><span>
</span></p>
</div>
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

#69 jefhal

jefhal

    Not The Appeaser

  • Active Members
  • PipPipPipPipPipPip
  • 708 posts

Posted 04 November 2011 - 03:33 PM

Just fixed it myself. The guilist.au3 is gone and is now guilistbox.au3 for my script. I also declared $out so that warning is gone also. Thanks so much for the include fixing script!
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

#70 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,448 posts

Posted 04 November 2011 - 03:35 PM

Don't use GUIList.au3 would be the first thing, second thing I would do is to uninstall whatever version you were running, and update to the latest version from scratch. Then work on the scripts that you currently have and fix them as needed.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users