ReFran Posted August 16, 2008 Share Posted August 16, 2008 (edited) use -1 for subitem of _GUICtrlListView_SetItemText, see the note in the help.Great. That it is. Didn't notice it. ThanksOnly 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 August 16, 2008 by ReFran Link to comment Share on other sites More sharing options...
hessebou Posted August 21, 2008 Share Posted August 21, 2008 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) #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 Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 24, 2008 Share Posted September 24, 2008 Is this thread only belonging to fixing the constants ? Mega Scripts & functions Organize Includes Let Scite organize the include files 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 Link to comment Share on other sites More sharing options...
KegRaider Posted October 22, 2008 Share Posted October 22, 2008 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) #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. Link to comment Share on other sites More sharing options...
Jikoo Posted November 4, 2008 Share Posted November 4, 2008 (edited) Hello,I added this excellent script to my open-source program. Thank you Monoceres and AutoIt forum members for this excellent script. And, I added UDF Renaming and Global Const cleaning.It's here, on this forum Edited December 30, 2009 by Jikoo 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). Link to comment Share on other sites More sharing options...
timistar Posted January 8, 2009 Share Posted January 8, 2009 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 Link to comment Share on other sites More sharing options...
Dolemite50 Posted January 16, 2009 Share Posted January 16, 2009 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. expandcollapse popup#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! Link to comment Share on other sites More sharing options...
jefhal Posted November 4, 2011 Share Posted November 4, 2011 <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,"$out",$out)<br /> ~~~~~~~~~~~~~~~~~~~~^<br /> U:\bin\AutoIt3\Examples\IsInstalled.au3(205,22) : ERROR: $out: undeclared global variable.<br /> MsgBox(1,"$out",$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>expandcollapse popup</span></p> <p><span>#include <WindowsConstants.au3><br /> #include <GUIConstantsEx.au3><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 <array.au3><br /> #include <DellRelatedFunctions.au3><br /> #include <constants.au3><br /> #include <GUIConstants.au3><br /> #include <GetADAllComputersInNode.au3><br /> #include <GuiList.au3><br /> #include <INet.au3><br /> ;Make Active Directory Name<br /> Dim $system, $arComputers, $rightou, $leftou, $outou, $fullname, $shortname<br /> Global $var<br /> Dim $pingreply[4] = ["is offline", "is unreachable", "is a bad destination", "has an unknown error"]<br /> Global $strComputer ;= @ComputerName<br /> _GetStrComputer()<br /> ;ToolTip("Starting")<br /> HotKeySet("{ESC}", "_terminate")<br /> Opt("TrayIconDebug", 1)<br /> If FileExists(@TempDir & "\IsInstalled.ini") Then $shortname = FileReadLine(@TempDir & "\IsInstalled.ini", 1)<br /> ;MsgBox(1,"$target",$var)<br /> GUICreate("Check If Installed", 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("Change Target File", 10, 10, 150, 35)<br /> $currenttarget = GUICtrlCreateLabel("Target computer(s) = ", 10, 60, 150, 25)<br /> $system = GUICtrlCreateInput("", 10, 75, 150, 300, 0x0004)<br /> $checkexists = GUICtrlCreateButton("Check if software exists", 170, 340, 150, 35)<br /> $allinnode = GUICtrlCreateCheckbox("All machines in node?", 170, 310, 150, 25)<br /> $emailself = GUICtrlCreateRadio("Email results to yourself?", 175, 80, 200, 15)<br /> $emaileveryone = GUICtrlCreateRadio("Email results to everyone?", 175, 98, 200, 15)</span></p> <p><span>GUISetState(@SW_SHOW) ; will display an empty dialog box<br /> ;MsgBox(1,"GUI $system",GUICtrlRead($system))<br /> GUICtrlSetData(6, $strComputer)<br /> GUICtrlSetState(6, $GUI_FOCUS)<br /> $fullname = GUICtrlRead(3)<br /> $shortname = StringTrimLeft($fullname, StringInStr($fullname, "\c$") - 1)<br /> ;MsgBox(1, "Shortname", $shortname)<br /> ; Run the GUI until the dialog is closed<br /> _GetOU($strComputer)<br /> Global $output = "Location: " & $outou<br /> ;MsgBox(1,"$outOU:",$outou)<br /> While 1<br /> $msg = GUIGetMsg()</span></p> <p><span> If $msg = $allinnode Then<br /> ;MsgBox(1,"$allinnode=",$allinnode)<br /> If GUICtrlRead($allinnode) = 1 Then<br /> _GetStrComputer()<br /> _GetAllComputersInNode ($strComputer)<br /> ToolTip("Please wait while computer list is being compiled")<br /> ;_ArrayDisplay($arComputers,"List of all computers")<br /> _ArraySort($arComputers,0,1)<br /> $list = _ArrayToString($arComputers, @LF, 1, $arComputers[0])<br /> ;MsgBox(1,"$list",StringStripCR($list))<br /> GUICtrlSetData($system, StringTrimRight($list, 1))<br /> ToolTip("")<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 = ""<br /> _GetStrComputer()<br /> $ping = Ping($strComputer, 500)<br /> ToolTip("Pinging strcomputer")<br /> If $ping Then; if $var was not equal to zero --- also possible: If @error = 0 Then ...<br /> ToolTip("")<br /> $targetname = FileOpenDialog("Choose target file", "\\" & $strComputer & "\c$", "All Files (*;*.lnk)")<br /> ;MsgBox(1, "targetfile", $targetname)<br /> $fullname = "\\" & $strComputer & "\c$" & StringTrimLeft($targetname, StringInStr($targetname, "c:") + 1)<br /> ;MsgBox(1, "fullname", $fullname)<br /> $shortname = StringTrimLeft($targetname, StringInStr($targetname, "c$") - 2)<br /> ;MsgBox(1, "shortname", $shortname)<br /> GUICtrlSetData(3, $shortname)<br /> If @error Then<br /> MsgBox(4096, "", "No File(s) chosen")<br /> Else<br /> ;MsgBox(4096,"","You chose: " & $fullname)<br /> $file = FileOpen(@TempDir & "\IsInstalled.ini", 2) ;open temp file for writing in d&s/jhall/local/temp<br /> FileWrite($file, $shortname)<br /> EndIf<br /> Else<br /> MsgBox(0, "Status", $strComputer & " " & $pingreply[@error], 2)<br /> ;GUICtrlSetData(6, "")<br /> $strComputer = ""<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) <> 1 Then<br /> ;MsgBox(1,"Check this file","\\" & $strComputer & "\c$\" & StringTrimLeft($var,3))<br /> _GetStrComputer()<br /> $output = ""<br /> $shortname = GUICtrlRead(3)<br /> ;$fullname = StringTrimLeft($chosen,StringInStr($chosen,"You chose:")-1)<br /> $ping = Ping($strComputer, 500)<br /> ToolTip("Pinging strcomputer")<br /> ;MsgBox(1,"",$var)<br /> ;MsgBox(1,"Ready to ping",$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("")<br /> If FileExists("\\" & $strComputer & $shortname) Then<br /> ;MsgBox(1,"full file name",$fullname)<br /> $ver = FileGetVersion("\\" & $strComputer & $shortname)<br /> MsgBox(64, "SUCCESS!", "Software is installed on " & $strComputer, 1)<br /> $output = $output & @CRLF & $strComputer & " has version " & $ver & " installed"<br /> GUICtrlSetState(6, $GUI_FOCUS)<br /> Else<br /> MsgBox(17, "FAILED", "Software not found on " & $strComputer, 2)<br /> $output = $output & @CRLF & $strComputer & " software not installed"<br /> GUICtrlSetState(6, $GUI_FOCUS)<br /> EndIf<br /> Else<br /> MsgBox(0, "Status", $strComputer & " " & $pingreply[@error], 2)<br /> GUICtrlSetData(6, "")<br /> $strComputer = ""<br /> GUICtrlSetState(6, $GUI_FOCUS)<br /> ;ExitLoop<br /> EndIf<br /> ToolTip("")<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("Please wait while computer list is being compiled")<br /> ;_ArrayDisplay($arComputers,"List of all computers")<br /> _ArraySort($arComputers,0,1)<br /> $list = _ArrayToString($arComputers, @LF, 1, $arComputers[0])<br /> ;MsgBox(1,"$list",StringStripCR($list))<br /> GUICtrlSetData($system, StringTrimRight($list, 1))<br /> ToolTip("")<br /> EndIf</span></p> <p><span> $output = ""<br /> For $i = 1 To $arComputers[0]<br /> $strComputer = StringStripCR($arComputers[$i])<br /> $shortname = GUICtrlRead(3)<br /> $fullname = "\\" & $strComputer & $shortname<br /> $ping = Ping($strComputer, 500)<br /> ToolTip("Pinging strcomputer")<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,"full file name",StringTrimLeft($var,StringInStr($var,"<a href="file://\\")-1">\\")-1</a>))<br /> $ver = FileGetVersion($fullname)<br /> MsgBox(64, "SUCCESS!", "Software is installed on " & $strComputer, 1)<br /> $output = $output & @CRLF & $strComputer & " has version " & $ver & " installed"<br /> ;GUICtrlSetState(6, $GUI_FOCUS)<br /> Else<br /> MsgBox(17, "FAILED", "Software not found on " & $strComputer, 2)<br /> $output = $output & @CRLF & $strComputer & " software not installed"<br /> ;GUICtrlSetState(6, $GUI_FOCUS)<br /> EndIf<br /> Else<br /> MsgBox(0, "Status", $strComputer & " " & $pingreply[@error], 2)<br /> ;GUICtrlSetData(6,"")<br /> $output = $output & @CRLF & StringStripCR($strComputer) & " was not online"<br /> $strComputer = ""<br /> ;GUICtrlSetState(6,$GUI_FOCUS)<br /> ;ExitLoop<br /> EndIf<br /> ToolTip("")<br /> Next<br /> _mailreport()<br /> EndIf<br /> WEnd<br /> $arComputers = ""<br /> FileClose(@TempDir & "\IsInstalled.ini")</span></p> <p><span>Func _GetStrComputer()<br /> If $CmdLine[0] <> "" And GUICtrlRead($system) = "" Then<br /> $strComputer = $CmdLine[1]<br /> Return $strComputer<br /> ElseIf GUICtrlRead($system) <> "" Then<br /> $strComputer = GUICtrlRead($system)<br /> Return $strComputer<br /> Else<br /> $strComputer = InputBox("Please enter system name","Please enter target computer",@ComputerName)<br /> ;MsgBox(1, "Error", "Please enter computer name")<br /> EndIf<br /> EndFunc ;==>_GetStrComputer</span></p> <p><span>Func _terminate()<br /> Exit 0<br /> EndFunc ;==>_terminate</span></p> <p><span>Func _GetOU($strComputer)<br /> Dim $scope = '"ou=Souhegan High School",dc=SAU-39,dc=sprise,dc=com'<br /> RunWait(@ComSpec & " /c <a href="file://\\shsfilesrv\apps$\_bin\utils\AdFind.exe">\\shsfilesrv\apps$\_bin\utils\AdFind.exe</a> -b " & $scope & ' -dn -f name=' & $strComputer & " | <a href="file://\\student2\apps$\_bin\utils\clipboard.exe">\\student2\apps$\_bin\utils\clipboard.exe</a>", @TempDir, @SW_HIDE)<br /> ;Sleep(1000)<br /> $ou = ClipGet()<br /> MsgBox(1,"$out",$out)<br /> $rightou = StringTrimLeft($ou, StringInStr($ou, "OU=") + 2)<br /> ;ToolTip("$rightout" & $rightout)<br /> ;Sleep(1000)<br /> $outou = StringLeft($rightou, StringInStr($rightou, ",", 0, 1) - 1)<br /> ToolTip($outou)<br /> ;Sleep(1000)<br /> Return $outou<br /> EndFunc ;==>_GetOU</span></p> <p><span>Func _mailreport()<br /> ClipPut("Installation report for " & $shortname & ":" & @CRLF & $output)<br /> If $output <> "" Then MsgBox(64, "Installation report for " & $shortname & ":", $output, 25)<br /> If GUICtrlRead($emailself) = 1 Or GUICtrlRead($emaileveryone) = 1 Then<br /> $chose = MsgBox(33, "EMAIL Notice", "Send results via email now?")<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 & "@sprise.com"<br /> If GUICtrlRead($emaileveryone) = 1 Then $Address = "<a href="mailto:shs-support@sprise.com">shs-support@sprise.com</a>"<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! ' & _INetMail($Address, "Locations of: " & $Subject, $Body))<br /> EndIf<br /> EndIf<br /> EndFunc ;==>_mailreport</span></p> <span></span> <p> </p> <p><span>Here is the guilist include file:</span></p> <p><span>expandcollapse popup</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 "Drives" 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=""]) Add names to the list displayed by the list box (required: <GuiList.au3>)<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 = "")<br /> Dim $i, $v_Attributes = "", $i_drives = 0<br /> Dim $a_Attributes = StringSplit($s_Attributes, ",")<br /> For $i = 1 To $a_Attributes[0]<br /> Select<br /> Case StringUpper($a_Attributes[$i]) = "A"<br /> If (StringLen($v_Attributes) > 0) Then<br /> $v_Attributes = $v_Attributes + $DDL_ARCHIVE<br /> Else<br /> $v_Attributes = $DDL_ARCHIVE<br /> EndIf<br /> Case StringUpper($a_Attributes[$i]) = "D"<br /> If (StringLen($v_Attributes) > 0) Then<br /> $v_Attributes = $v_Attributes + $DDL_DIRECTORY<br /> Else<br /> $v_Attributes = $DDL_DIRECTORY<br /> EndIf<br /> Case StringUpper($a_Attributes[$i]) = "H"<br /> If (StringLen($v_Attributes) > 0) Then<br /> $v_Attributes = $v_Attributes + $DDL_HIDDEN<br /> Else<br /> $v_Attributes = $DDL_HIDDEN<br /> EndIf<br /> Case StringUpper($a_Attributes[$i]) = "RO"<br /> If (StringLen($v_Attributes) > 0) Then<br /> $v_Attributes = $v_Attributes + $DDL_READONLY<br /> Else<br /> $v_Attributes = $DDL_READONLY<br /> EndIf<br /> Case StringUpper($a_Attributes[$i]) = "RW"<br /> If (StringLen($v_Attributes) > 0) Then<br /> $v_Attributes = $v_Attributes + $DDL_READWRITE<br /> Else<br /> $v_Attributes = $DDL_READWRITE<br /> EndIf<br /> Case StringUpper($a_Attributes[$i]) = "S"<br /> If (StringLen($v_Attributes) > 0) Then<br /> $v_Attributes = $v_Attributes + $DDL_SYSTEM<br /> Else<br /> $v_Attributes = $DDL_SYSTEM<br /> EndIf<br /> Case StringUpper($a_Attributes[$i]) = "DRIVES"<br /> $i_drives = 1<br /> $s_file = ""<br /> If (StringLen($v_Attributes) > 0) Then<br /> $v_Attributes = $v_Attributes + $DDL_DRIVES<br /> Else<br /> $v_Attributes = $DDL_DRIVES<br /> EndIf<br /> Case StringUpper($a_Attributes[$i]) = "E"<br /> If (StringLen($v_Attributes) > 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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 = "int;int;int;int"<br /> Local $left = 1, $top = 2, $right = 3, $bottom = 4<br /> Local $p = DllStructCreate ($RECT)<br /> If @error Then<br /> MsgBox(0, "", "Error in DllStructCreate " & @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) & "," & DllStructGetData ($p, $top) & "," & DllStructGetData ($p, $right) & "," & DllStructGetData ($p, $bottom), ",")<br /> DllStructDelete ($p)<br /> Return $array<br /> EndFunc ;==>_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: <GuiList.au3>)<br /> ; Author(s): CyberSlug<br /> ; Note(s): "0409" for U.S. English<br /> ;<br /> ;===============================================================================<br /> Func _GUICtrlListGetLocale($h_listbox)<br /> Return Hex( GUICtrlSendMsg($h_listbox, $LB_GETLOCALE, 0, 0), 4)<br /> EndFunc ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 &= "int;"<br /> Next<br /> $struct = StringTrimRight($struct, 1)<br /> Local $p = DllStructCreate ($struct)<br /> If @error Then<br /> ;~ MsgBox(0,"","Error in DllStructCreate " & @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 &= DllStructGetData ($p, $i) & ","<br /> Next<br /> $array = StringTrimRight($array, 1)<br /> Local $a_items = StringSplit($array, ",")<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 ;==>_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: <GuiList.au3>)<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 = "", $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 > 0) Then<br /> ;~ If (StringLen($s_list) > 0) Then<br /> ;~ $s_list = $s_list & ',' & $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) > 0) Then<br /> ;~ Return StringSplit($s_list, ",")<br /> ;~ Else<br /> ;~ Return $LB_ERR<br /> ;~ EndIf<br /> ;~ EndFunc ;==>_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: <GuiList.au3>)<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 = "", $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 > 0) Then<br /> If (StringLen($s_list) > 0) Then<br /> $s_list = $s_list & ',' & $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) > 0) Then<br /> Local $a_text = StringSplit($s_list, ",")<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<br /> ; Author(s): CyberSlug<br /> ; Note(s): DOES NOT WORK WITH SINGLE-SELECTION LIST BOXES<br /> ; If $i_start > $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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<br /> ; Author(s): CyberSlug<br /> ; Note(s): "0409" 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 ;==>_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: <GuiList.au3>)<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 > 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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_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: <GuiList.au3>)<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 ;==>_GUICtrlListSwapString</span></p> <p><span></span></p> </div> ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
jefhal Posted November 4, 2011 Share Posted November 4, 2011 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 Link to comment Share on other sites More sharing options...
BrewManNH Posted November 4, 2011 Share Posted November 4, 2011 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 XP, 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 GudeHow to ask questions the smart way! 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. 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 editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now