Jump to content
31290

Combine 32 & 64 Reg values

Recommended Posts

31290

Hi everyone, 

I'm currently writing a script that allow me to list all currently installed software on a computer but some of the are listed in the HKLM64 hive of the registry whereas 95% of all others are in the HKLM "normal" one.

Thing is, I'd like to combine these two reg key into one single ListView item.

Here's my code so far, knowing that it's working on both cases (changing to HKLM64 or HKLM short)

Spoiler
#include <GuiListView.au3>
Opt("TrayAutoPause", 0)
Opt('GUIOnEventMode', 1)
Opt('GUICloseOnEsc' , 1)

Global $i
Local $sSft
Global $sGui = GUICreate('Currently Installed Software', 810, 650, -1, -1)
Global $sLvw = GUICtrlCreateListView('#|Installed Software|Display Version|Publisher|Uninstall String', 5, 5, 800, 600)
_ComputerGetSoftware($sSft)

For $i = 1 To ubound($sSft) - 1
    GUICtrlCreateListViewItem($i & '|' & $sSft[$i][0] & '|' & $sSft[$i][1] & '|' & $sSft[$i][2] & '|' & $sSft[$i][3], $sLvw)
Next

GUICtrlSendMsg($sLvw, 0x101E, 1, 175)
GUICtrlSendMsg($sLvw, 0x101E, 2, 65)
GUICtrlSendMsg($sLvw, 0x101E, 3, 150)
GUICtrlSendMsg($sLvw, 0x101E, 4, 350)
Local $mMen = GUICtrlCreateContextMenu($sLvw)
Local $Uninstall = GUICtrlCreateMenuItem('Proceed to Software uninstallation', $mMen)
GUICtrlSetOnEvent($Uninstall, '_Uninstall')
Local $exp = GUICtrlCreateButton('  Expand  ', 720, 615)
GUICtrlSetOnEvent($exp, '_Expand')
GUISetOnEvent(-3, '_AllExit')
GUISetState(@SW_SHOW, $sGui)

While 1
    Sleep(10)
WEnd
;
Func _AllExit()
    GUIDelete($sGui)
    Exit
EndFunc

Func _Uninstall()
   Local $proc = StringSplit(GUICtrlRead(GUICtrlRead($sLvw)), '|', 1)
   If $proc[1] == 0 Then Return -1
   ShellExecuteWait ($proc[5])
EndFunc

Func _ComputerGetSoftware(ByRef $aSoftwareInfo)
    Local Const $UnInstKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
    Local $i = 1
    Dim $aSoftwareInfo[1][4]
        For $j = 1 To 500
            $AppKey = RegEnumKey($UnInstKey, $j)
            If @error <> 0 Then Exitloop
            If RegRead($UnInstKey & "\" & $AppKey, "DisplayName") = '' Then ContinueLoop
            ReDim $aSoftwareInfo[UBound($aSoftwareInfo) + 1][4]
            $aSoftwareInfo[$i][0] = StringStripWS(StringReplace(RegRead($UnInstKey & "\" & $AppKey, "DisplayName"), " (remove only)", ""), 3)
            $aSoftwareInfo[$i][1] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "DisplayVersion"), 3)
            $aSoftwareInfo[$i][2] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "Publisher"), 3)
            $aSoftwareInfo[$i][3] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "UninstallString"), 3)
            $i = $i + 1
        Next
        $aSoftwareInfo[0][0] = UBound($aSoftwareInfo, 1) - 1
        If $aSoftwareInfo[0][0] < 1 Then SetError(1, 1, 0)
        Return _ArraySort($aSoftwareInfo,0,1)
        For $j = 1 To 500
            $AppKey = RegEnumKey($UnInstKey, $j)
            If @error <> 0 Then Exitloop
            $Reg = RegRead($UnInstKey & "\" & $AppKey, "DisplayName")
            $string = stringinstr($Reg, $input)
            If $string = 0 Then Continueloop
            ReDim $aSoftwareInfo[UBound($aSoftwareInfo) + 1][4]
            $aSoftwareInfo[$i][0] = StringStripWS(StringReplace(RegRead($UnInstKey & "\" & $AppKey, "DisplayName"), " (remove only)", ""), 3)
            $aSoftwareInfo[$i][1] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "DisplayVersion"), 3)
            $aSoftwareInfo[$i][2] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "Publisher"), 3)
            $aSoftwareInfo[$i][3] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "UninstallString"), 3)
            $i = $i + 1
        Next
        $aSoftwareInfo[0][0] = UBound($aSoftwareInfo, 1) - 1
        If $aSoftwareInfo[0][0] < 1 Then SetError(1, 1, 0)
        Return _ArraySort($aSoftwareInfo,0,1)
EndFunc
;
Func _Expand()
    _GUICtrlListView_SetColumnWidth($sLvw, 1, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($sLvw, 2, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($sLvw, 3, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($sLvw, 4, $LVSCW_AUTOSIZE)
EndFunc

 

Thanks in advance for the help :)

-31290-


~~~ Doom Shall Never Die, Only The Players ~~~

Share this post


Link to post
Share on other sites
Earthshine
Posted (edited)

change your function that reads the reg. pass it the key once for 32 bit, once for 64 in main loop

Func _ComputerGetSoftware(ByRef $aSoftwareInfo, $UnInstKey)

then don;t do this, remark that out.

 Local Const $UnInstKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

pass that key to your function 2 times, 32 and 64 values and add them to the one array.

Edited by Earthshine
  • Like 1

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Earthshine

by the way, your code doesn't compile so i'm not going to test it.


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
31290
12 minutes ago, Earthshine said:

by the way, your code doesn't compile so i'm not going to test it.

What do you mean by that? I've just compiled it and ran just fine.

Thanks for your info above, I'll test that.

-31290-


~~~ Doom Shall Never Die, Only The Players ~~~

Share this post


Link to post
Share on other sites
Subz

Maybe something like:

#include <GuiListView.au3>
Opt("TrayAutoPause", 0)
Opt('GUIOnEventMode', 1)
Opt('GUICloseOnEsc' , 1)

Global $aSoftwareInfo[0][5]
    _SoftwareInfo("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
    _SoftwareInfo("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")

Global $hGui = GUICreate('Currently Installed Software', 810, 650, -1, -1)
Global $idListView = GUICtrlCreateListView('#|Installed Software|Display Version|Publisher|Uninstall String', 5, 5, 800, 600)
_GUICtrlListView_AddArray($idListView, $aSoftwareInfo)

GUICtrlSendMsg($idListView, 0x101E, 1, 175)
GUICtrlSendMsg($idListView, 0x101E, 2, 65)
GUICtrlSendMsg($idListView, 0x101E, 3, 150)
GUICtrlSendMsg($idListView, 0x101E, 4, 350)
Local $mMen = GUICtrlCreateContextMenu($idListView)
Local $Uninstall = GUICtrlCreateMenuItem('Proceed to Software uninstallation', $mMen)
GUICtrlSetOnEvent($Uninstall, '_Uninstall')
Local $exp = GUICtrlCreateButton('  Expand  ', 720, 615)
GUICtrlSetOnEvent($exp, '_Expand')
GUISetOnEvent(-3, '_AllExit')
GUISetState(@SW_SHOW, $hGui)

While 1
    Sleep(10)
WEnd
;
Func _AllExit()
    GUIDelete($hGui)
    Exit
EndFunc

Func _Uninstall()
   Local $proc = StringSplit(GUICtrlRead(GUICtrlRead($idListView)), '|', 1)
   If $proc[1] == 0 Then Return -1
   ShellExecuteWait ($proc[5])
EndFunc

Func _SoftwareInfo($_sHKLMUninstall)
    Local $i = 1
    While 1
        $sRegKey = RegEnumKey($_sHKLMUninstall, $i)
        If @error Then Exitloop
        If RegRead($_sHKLMUninstall & "\" & $sRegKey, "DisplayName") = '' Then
            $i += 1
            ContinueLoop
        EndIf
        $sDisplayName = StringStripWS(StringReplace(RegRead($_sHKLMUninstall & "\" & $sRegKey, "DisplayName"), " (remove only)", ""), 3)
        $sDisplayVersion = StringStripWS(RegRead($_sHKLMUninstall & "\" & $sRegKey, "DisplayVersion"), 3)
        $sPublisher = StringStripWS(RegRead($_sHKLMUninstall & "\" & $sRegKey, "Publisher"), 3)
        $sUninstallString = StringStripWS(RegRead($_sHKLMUninstall & "\" & $sRegKey, "UninstallString"), 3)
        _ArrayAdd($aSoftwareInfo, "|" & $sDisplayName & "|" & $sDisplayVersion & "|" & $sPublisher & "|" & $sUninstallString)
        $i += 1
    WEnd
    _ArraySort($aSoftwareInfo,0,1)
    For $i = 0 To UBound($aSoftwareInfo) - 1
        $aSoftwareInfo[$i][0] = $i
    Next
EndFunc
;
Func _Expand()
    _GUICtrlListView_SetColumnWidth($idListView, 1, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($idListView, 2, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($idListView, 3, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($idListView, 4, $LVSCW_AUTOSIZE)
EndFunc

 

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
VIP
Posted (edited)

"HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

 

AutoItScript List installed programs and system information:

#include <GuiListView.au3>
Opt("TrayAutoPause", 0)
Opt('GUIOnEventMode', 1)
Opt('GUICloseOnEsc', 1)
;Opt("MustDeclareVars", 1)
;
Global $SoftwList = 'ALL', $iAskSoftName = 0, $sSft[1][0]
Global $sGui = GUICreate('Currently Installed Software', 810, 650, -1, -1)
Global $sLvw = GUICtrlCreateListView('#|Installed Software|Display Version|Publisher|Uninstall String', 5, 5, 800, 600)
_ComputerGetSoftware($sSft)
For $i = 1 To UBound($sSft) - 1
    GUICtrlCreateListViewItem($i & '|' & $sSft[$i][0] & '|' & $sSft[$i][1] & '|' & $sSft[$i][2] & '|' & $sSft[$i][3], $sLvw)
Next
GUICtrlSendMsg($sLvw, 0x101E, 1, 175)
GUICtrlSendMsg($sLvw, 0x101E, 2, 65)
GUICtrlSendMsg($sLvw, 0x101E, 3, 150)
GUICtrlSendMsg($sLvw, 0x101E, 4, 350)
Global $mMen = GUICtrlCreateContextMenu($sLvw)
Global $CopI = GUICtrlCreateMenuItem('Uninstall Current Selection', $mMen)
GUICtrlSetOnEvent($CopI, '_Uninstall')
Global $exp = GUICtrlCreateButton('  Expand  ', 720, 615)
GUICtrlSetOnEvent($exp, '_Expand')
GUISetOnEvent(-3, '_AllExit')
GUISetState(@SW_SHOW, $sGui)
;
While 1
    Sleep(10)
WEnd
;
Func _AllExit()
    GUIDelete($sGui)
    Exit
EndFunc   ;==>_AllExit
;
Func _Uninstall()
    Local $proc = StringSplit(GUICtrlRead(GUICtrlRead($sLvw)), '|', 1)
    If $proc[1] == 0 Then Return -1
    If $proc[5] Then RunWait($proc[5])
    Exit
EndFunc   ;==>_Uninstall
;
Func _Copy2Clip()
    Local $proc = StringSplit(GUICtrlRead(GUICtrlRead($sLvw)), '|', 1)
    If $proc[1] == 0 Then Return -1
    If $proc[5] Then ClipPut($proc[5])
EndFunc   ;==>_Copy2Clip
;
; Author JSThePatriot - Modified June 20, 2010 by ripdad - Modified 2018/29/05 by Dao Van Trong - Trong.LIVE
Func _ComputerGetSoftware(ByRef $aSoftwareInfo)
    Local Const $UnInstKey = "HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
    Local $i = 1, $Reg, $string, $AppKey
    ReDim $aSoftwareInfo[1][4]
    If ($iAskSoftName) Then $SoftwList = InputBox("Which Software", "You are running " & @OSVersion & " " & @OSArch & @CRLF & @CRLF & "Which Software would you like to view?", 'ALL')
    If @error = 1 Then Exit
    If $SoftwList = 'ALL' Then
        For $j = 1 To 500
            $AppKey = RegEnumKey($UnInstKey, $j)
            If @error <> 0 Then ExitLoop
            If RegRead($UnInstKey & "\" & $AppKey, "DisplayName") = '' Then ContinueLoop
            ReDim $aSoftwareInfo[UBound($aSoftwareInfo) + 1][4]
            $aSoftwareInfo[$i][0] = StringStripWS(StringReplace(RegRead($UnInstKey & "\" & $AppKey, "DisplayName"), " (remove only)", ""), 3)
            $aSoftwareInfo[$i][1] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "DisplayVersion"), 3)
            $aSoftwareInfo[$i][2] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "Publisher"), 3)
            $aSoftwareInfo[$i][3] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "UninstallString"), 3)
            $i = $i + 1
        Next
        $aSoftwareInfo[0][0] = UBound($aSoftwareInfo, 1) - 1
        If $aSoftwareInfo[0][0] < 1 Then SetError(1, 1, 0)
        Return _ArraySort($aSoftwareInfo, 0, 1)
    Else
        For $j = 1 To 500
            $AppKey = RegEnumKey($UnInstKey, $j)
            If @error <> 0 Then ExitLoop
            Local $Reg = RegRead($UnInstKey & "\" & $AppKey, "DisplayName")
            $string = StringInStr($Reg, $SoftwList)
            If $string = 0 Then ContinueLoop
            ReDim $aSoftwareInfo[UBound($aSoftwareInfo) + 1][4]
            $aSoftwareInfo[$i][0] = StringStripWS(StringReplace(RegRead($UnInstKey & "\" & $AppKey, "DisplayName"), " (remove only)", ""), 3)
            $aSoftwareInfo[$i][1] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "DisplayVersion"), 3)
            $aSoftwareInfo[$i][2] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "Publisher"), 3)
            $aSoftwareInfo[$i][3] = StringStripWS(RegRead($UnInstKey & "\" & $AppKey, "UninstallString"), 3)
            $i = $i + 1
        Next
        $aSoftwareInfo[0][0] = UBound($aSoftwareInfo, 1) - 1
        If $aSoftwareInfo[0][0] < 1 Then SetError(1, 1, 0)
        Return _ArraySort($aSoftwareInfo, 0, 1)
    EndIf
EndFunc   ;==>_ComputerGetSoftware
;
Func _Expand()
    _GUICtrlListView_SetColumnWidth($sLvw, 1, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($sLvw, 2, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($sLvw, 3, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($sLvw, 4, $LVSCW_AUTOSIZE)
EndFunc   ;==>_Expand

 

Edited by VIP
;
  • Haha 1

Regards,
 

Share this post


Link to post
Share on other sites
Earthshine

look at subz example

  • Thanks 1

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
31290
Posted (edited)

@VIP > Thanks for your input but I was talking about combining HKLM64 & HKLM ;) 

@Subz > Your example is just what I've expected! thanks a lot. Now I can figure out how to achieve that!

@Earthshine > Thanks again for your help!

Edited by 31290

~~~ Doom Shall Never Die, Only The Players ~~~

Share this post


Link to post
Share on other sites
VIP

You can not combine it! You need to read or write it 2 times!
For examples (List installed programs) just add "64" is enough!


Regards,
 

Share this post


Link to post
Share on other sites
31290
1 minute ago, VIP said:

You can not combine it! You need to read or write it 2 times!
For examples (List installed programs) just add "64" is enough!

Here I meant combining the 2 reg. keys in the same array :P 
But no worries, question has been answered by subz and I can go on with the tool I'm writing :) 


~~~ Doom Shall Never Die, Only The Players ~~~

Share this post


Link to post
Share on other sites
31290

@Subz and others

Sorry to bother again but I need you help again.

I'm now facing another thing which is that I cannot retrieve the uninstall key string.

I just don't understand why my _Uninstall() function is not working:
 

Func _Uninstall()
   Local $proc = StringSplit(GUICtrlRead(GUICtrlRead($idListView)), '|', 1)
   If $proc[1] == 0 Then Return -1
   Msgbox (0, "", $proc[5])
EndFunc

Nothing simply happens.
When displaying the $proc array, I just have two values, 0 & 1 :/

Then main goal here is to retrieve the uninstall sting displayed in the ListView.

Full code so far:

 

Spoiler
#include <GuiListView.au3>
Opt("TrayAutoPause", 0)
Opt('GUIOnEventMode', 1)
Opt('GUICloseOnEsc' , 1)

Global $aSoftwareInfo[0][5]
    _SoftwareInfo("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
    _SoftwareInfo("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")

Global $hGui = GUICreate('Currently Installed Software', 810, 650, -1, -1)
Global $idListView = GUICtrlCreateListView('#|Installed Software|Display Version|Publisher|Uninstall String', 5, 5, 800, 600)
_GUICtrlListView_AddArray($idListView, $aSoftwareInfo)

GUICtrlSendMsg($idListView, 0x101E, 1, 175)
GUICtrlSendMsg($idListView, 0x101E, 2, 65)
GUICtrlSendMsg($idListView, 0x101E, 3, 150)
GUICtrlSendMsg($idListView, 0x101E, 4, 350)
Local $mMen = GUICtrlCreateContextMenu($idListView)
Local $Uninstall = GUICtrlCreateMenuItem('Proceed to Software uninstallation', $mMen)
GUICtrlSetOnEvent($Uninstall, '_Uninstall')
Local $exp = GUICtrlCreateButton('  Expand  ', 720, 615)
GUICtrlSetOnEvent($exp, '_Expand')
GUISetOnEvent(-3, '_AllExit')
GUISetState(@SW_SHOW, $hGui)

While 1
    Sleep(10)
WEnd
;
Func _AllExit()
    GUIDelete($hGui)
    Exit
EndFunc

Func _Uninstall()
   Local $proc = StringSplit((GUICtrlRead($aSoftwareInfo)), '|', 1)
   _arraydisplay ($proc)
   ; Msgbox (0, "", $proc[5])
EndFunc

Func _SoftwareInfo($_sHKLMUninstall)
    Local $i = 1
    While 1
        $sRegKey = RegEnumKey($_sHKLMUninstall, $i)
        If @error Then Exitloop
        If RegRead($_sHKLMUninstall & "\" & $sRegKey, "DisplayName") = '' Then
            $i += 1
            ContinueLoop
        EndIf
        $sDisplayName = StringStripWS(StringReplace(RegRead($_sHKLMUninstall & "\" & $sRegKey, "DisplayName"), " (remove only)", ""), 3)
        $sDisplayVersion = StringStripWS(RegRead($_sHKLMUninstall & "\" & $sRegKey, "DisplayVersion"), 3)
        $sPublisher = StringStripWS(RegRead($_sHKLMUninstall & "\" & $sRegKey, "Publisher"), 3)
        $sUninstallString = StringStripWS(RegRead($_sHKLMUninstall & "\" & $sRegKey, "UninstallString"), 3)
        _ArrayAdd($aSoftwareInfo, "|" & $sDisplayName & "|" & $sDisplayVersion & "|" & $sPublisher & "|" & $sUninstallString)
        $i += 1
    WEnd
    _ArraySort($aSoftwareInfo,0,1)
    For $i = 0 To UBound($aSoftwareInfo) - 1
        $aSoftwareInfo[$i][0] = $i
    Next
EndFunc
;
Func _Expand()
    _GUICtrlListView_SetColumnWidth($idListView, 1, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($idListView, 2, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($idListView, 3, $LVSCW_AUTOSIZE)
    _GUICtrlListView_SetColumnWidth($idListView, 4, $LVSCW_AUTOSIZE)
EndFunc

 

Thanks in advance :)

-31290-


~~~ Doom Shall Never Die, Only The Players ~~~

Share this post


Link to post
Share on other sites
31290

Well, thanks again Subz.

I was beginning playing around with _GUICtrlListView_XXX functions.

But yours is faster and efficient.

You have a good day Sir :) 


~~~ Doom Shall Never Die, Only The Players ~~~

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Dzenan03
      By Dzenan03
      I want to make a while loop, that creates variables based on a array. For thist I created the array $iDsO with the number and the name of folders in an other folder. Every folder has a different name an I want to create variables(arrays) for each folder that show me all the files in that folder. For example: I have the Folder \Folder1. In it there are the Folders \1, \2, \3. In 1, 2 and 3 there are some files(.png). The array for Folder1 is $iDsO and now I want to crate the arrays $iDsO1, $iDsO2 and $iDsO3 with the files in them can I make something like this:
      While $iDs > 0 ;$iDs is the number of files in Folder1>> $iDsO[0] $iDs#here should come the Foldername for example '1'# = _FileListtoArray(@ProgramFilesDir&"\Folder1\"&$iDsO[$iDs]) $iDs = $iDs - 1 Wend So that in the End I have three variabels ($iDs1, $iDs2 and $iDs3)
       
      Is this posible or if not what could I do instead ( I don´t know the number of folders in Folder1 in the begining).
    • liagason
      By liagason
      Hello everyone,
      How can I display in ascending  sequence some numbers stored in a string variable?
      $str = "18,03,48,23" MsgBox(0,"test",$str) I would like it to display "03,18,23,48"
    • rm4453
      By rm4453
      I have a table I am parsing, to find specific vehicle information. I am unable to get _ArrayFindAll to return the only valid result with my test data.
      Below is a sample of the table's HTML:
      <td class="textCenter">2010</td> <td>TOYOTA</td> <td>TACOMA 4X4 DB</td> <td></td> <td>BLACK</td> <td class="textCenter">C</td> <td class="textCenter">6</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">80,975</td> <td class="textRight" nowrap="nowrap">$16,800</td> </tr> <tr><!-- 308 --> <td class="textCenter">2010</td> <td>TOYOTA</td> <td>TACOMA 4X4 RG</td> <td></td> <td>BLACK</td> <td class="textCenter">R</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">5</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">95,224</td> <td class="textRight" nowrap="nowrap">$9,500</td> </tr> <tr><!-- 309 --> <td class="textCenter">2011</td> <td>BUICK</td> <td>REGAL</td> <td>CXL RL4</td> <td>BLACK</td> <td class="textCenter">4</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter"></td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">SR</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">102,694</td> <td class="textRight" nowrap="nowrap">$5,000</td> </tr> <tr><!-- 310 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>AVALANCH 4X4 CR</td> <td>LS</td> <td>GRAY</td> <td class="textCenter">C</td> <td class="textCenter">8</td> <td>E</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">64,759</td> <td class="textRight" nowrap="nowrap">$16,300</td> </tr> <tr><!-- 311 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>EQUINOX AWD 4C</td> <td>LT W/2LT</td> <td>BLACK</td> <td class="textCenter">S</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">AWD</td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">SR</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">91,896</td> <td class="textRight" nowrap="nowrap">$4,400</td> </tr> <tr><!-- 312 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>TAHOE 4X4 V8</td> <td>LTZ</td> <td>WHITE</td> <td class="textCenter">S</td> <td class="textCenter">8</td> <td>C</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>N</td> <td class="textCenter">MR</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">126,982</td> <td class="textRight" nowrap="nowrap">$17,800</td> </tr> <tr><!-- 313 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>1500 SLV 4X4 EX</td> <td>LT</td> <td>GRAY</td> <td class="textCenter">X</td> <td class="textCenter">8</td> <td>GAS</td> <td class="textCenter">O</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">60,303</td> <td class="textRight" nowrap="nowrap">$18,100</td> </tr> <tr><!-- 314 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>1500 SLV 4X4 EX</td> <td>LT</td> <td>SILVER</td> <td class="textCenter">X</td> <td class="textCenter">8</td> <td>E</td> <td class="textCenter">O</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">89,403</td> <td class="textRight" nowrap="nowrap">$15,900</td> </tr> <tr><!-- 315 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>1500 SLV 4X4 EX</td> <td>LTZ</td> <td>BLUE</td> <td class="textCenter">X</td> <td class="textCenter">8</td> <td>E</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">53,087</td> <td class="textRight" nowrap="nowrap">$17,700</td> </tr> <tr><!-- 316 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>3500 CUTAWAY</td> <td>WORK VAN</td> <td>WHITE</td> <td class="textCenter">S</td> <td class="textCenter"></td> <td></td> <td class="textCenter">A</td> <td class="textCenter">4X2</td> <td class="textCenter"></td> <td>N</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">202,477</td> <td class="textRight" nowrap="nowrap">$2,700</td> </tr> <tr><!-- 317 --> <td class="textCenter">2011</td> <td>CHRYSLER</td> <td>TOWN &amp; COUNTRY</td> <td>TOURING</td> <td>BLACK</td> <td class="textCenter">4</td> <td class="textCenter">6</td> <td>E</td> <td class="textCenter">A</td> <td class="textCenter">4X2</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter"></td> <td class="textRight" nowrap="nowrap">198,541</td> <td class="textRight" nowrap="nowrap">$1,900</td> </tr> <tr><!-- 318 --> <td class="textCenter">2011</td> <td>DODGE</td> <td>DURANGO AWD V6</td> <td>CREW</td> <td>BLUE</td> <td class="textCenter">S</td> <td class="textCenter">6</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">AWD</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">SR</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">176,036</td> <td class="textRight" nowrap="nowrap">$2,800</td> </tr> <tr><!-- 319 --> <td class="textCenter">2011</td> <td>FORD</td> <td>FOCUS</td> <td>SE</td> <td>SILVER</td> <td class="textCenter">4</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter"></td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">101,929</td> <td class="textRight" nowrap="nowrap">$3,100</td> </tr> <tr><!-- 320 --> <td class="textCenter">2011</td> <td>FORD</td> <td>FUSION FWD 4C</td> <td>SEL</td> <td>WHITE</td> <td class="textCenter">4</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter"></td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">SR</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">78,290</td> <td class="textRight" nowrap="nowrap">$5,500</td> </tr> <tr><!-- 321 --> <td class="textCenter">2011</td> <td>FORD</td> <td>F150 4X4 CR</td> <td>XLT</td> <td>BLACK</td> <td class="textCenter">C</td> <td class="textCenter">8</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">70,909</td> <td class="textRight" nowrap="nowrap">$16,000</td> </tr> <tr><!-- 322 --> <td class="textCenter">2011</td> <td>FORD</td> <td>MUSTANG V6 CPE</td> <td>V6 PREMIUM</td> <td>BLACK</td> <td class="textCenter">2</td> <td class="textCenter">6</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">4X2</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">92,531</td> <td class="textRight" nowrap="nowrap">$2,700</td> </tr> <tr><!-- 323 --> <td class="textCenter">2011</td> <td>GMC</td> <td>ACADIA FWD</td> <td>SLE</td> <td>RED</td> <td class="textCenter">4</td> <td class="textCenter">6</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter"></td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">79,199</td> <td class="textRight" nowrap="nowrap">$10,700</td> A picture of the table test data is attached here:

      Here is the _query function, and all other relevant code that I can share.
       
      Func _query($aSel, $aUrls) $oIE = _login() If $oIE = "Return" Then Return EndIf $j = 0 While $j < UBound($aSel) - 1 $i = 1 $aucID ;Unable To Share What This Is Other Than Var Name. _IENavigate($oIE, "Something" & $aucID[0] & "Something") _IELoadWait($oIE, 100, 2000) $oObj = _IETableGetCollection($oIE, 3) $cars = _IETableWriteToArray_ProgressBar($oObj, True, "Processing Requested Information!") ;<---- Modified Version See Post For It: https://www.autoitscript.com/forum/topic/195335-solved-how-to-add-a-progress-bar-to-_ietablewritetoarray/?tab=comments#comment-1400699 $carsYear = _filter($cars, 0, 0, GUICtrlRead($year)) $carsMake = _filter($carsYear, 0, 1, GUICtrlRead($make)) Global $carsModel = _filter($carsMake, 0, 2, GUICtrlRead($model)) $i = 0 $engine = GUICtrlRead($engine) If $engine <> "" Then While $i < StringLen($engine) $carsEngine = _filter($carsModel, 0, 6 + $i, StringLeft($engine, 1)) ;_ArrayDisplay($carsModel, "Cars Model Before Array Delete") $x = 1 While $x <= UBound($carsModel) _ArrayDelete($carsModel, $x) $x += 1 WEnd ;_ArrayDisplay($carsModel, "Cars Model After Array Delete") ;_ArrayConcatenate($carsModel, $carsEngine) ;_ArrayDisplay($carsModel, "Cars Model After Concatenate") $engine = StringTrimLeft($engine, 1) $i += 1 WEnd Else Dim $carsEngine[1][16] EndIf _ArrayConcatenate($carsEngine, $carsModel) _ArrayDisplay($carsEngine, "Cars Engine") Dim $carsDriveTrain[1][16] Dim $carsDriveTrain2[1][16] $driveTrainVal = GUICtrlRead($driveTrain) If $driveTrainVal = "4x4" Or $driveTrainVal = "awd" Then $carsDriveTrain = _filter($carsEngine, 0, 9, "4") $carsDriveTrain2 = _filter($carsEngine, 0, 9, "a") ;~ _ArrayDisplay($carsDriveTrain, "Drive Train Before") ;~ If @error Then ;~ MsgBox("", "", "Cars Drive Train Error: " & @error) ;~ EndIf ;~ _ArrayDisplay($carsDriveTrain2, "Drive Train2 Before") ;~ If @error Then ;~ MsgBox("", "", "Cars Drive Train 2 Error: " & @error) ;~ EndIf _ArrayConcatenate($carsDriveTrain, $carsDriveTrain2) _ArrayDisplay($carsDriveTrain, "Drive Train After Concat") ElseIf $driveTrainVal = "" Then _ArrayConcatenate($carsDriveTrain, $carsEngine) Else $carsDriveTrain = _filter($carsEngine, 0, 9, $driveTrain) EndIf Dim $carsOdom[1][16] $min = GUICtrlRead($odomMin) $max = GUICtrlRead($odomMax) For $i = 0 To UBound($carsDriveTrain) - 1 If $carsDriveTrain[$i][14] > $min And $carsDriveTrain[$i][14] < $max Then _ArrayAdd($carsOdom, $carsDriveTrain[$i]) MsgBox("", "", "ADDED!") EndIf Next _ArrayDisplay($carsOdom, "Cars Odom") $j += 1 WEnd _IEQuit($oIE) EndFunc ;==>_query Func _filter($tofilter, $xpos1, $ypos1, $str) ;~ If UBound($tofilter, 1) <= 1 Then ;~ $endx = 0 ;~ Else ;~ $endx = UBound($tofilter, 1) - 1 ;~ EndIf ;~ $cars = _ArrayFindAll($tofilter, $str, $tofilter[$xpos1][$ypos1], $tofilter[$endx][$ypos1], 0, 1, $ypos1, False) $cars = _ArrayFindAll($tofilter, $str, Default, Default, 0, 1, $ypos1) Dim $carsFiltered[1][16] = [["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"]] ;_ArrayDisplay($carsFiltered) $i = 0 $uBound = UBound($cars) - 1 While $i < $uBound $filtered = _ArrayExtract($tofilter, $cars[$i], $cars[$i], 0, 15) ;_ArrayDisplay($filtered, "_filter Array of Filtered") _ArrayConcatenate($carsFiltered, $filtered) $i += 1 WEnd _ArrayDelete($carsFiltered, 0) Return $carsFiltered EndFunc ;==>_filter  
      If you know of a more efficient way of doing this please let me know would be more than happy to chew down my inefficiency while learning! (It's like my grandpa used to say, "The only criticism I can't use is that which is not given to me.")
       
      The Item an I am using to test the filter is:

       
    • rm4453
      By rm4453
      Hello,
       
      I am currently writing a program that parses a massive table from a website, and need a way to add a progress bar while parsing.
      I am currently using the function _IETableWriteToArray($oObj, True) to parse the array. I need the progress bar to update as the table is parsed, not just at the end of the parsing.
      Any help at all would be very much appreciated!
       
      *EDIT --> The array I am left with after parsing is $array[0-50000][16]
    • TrashBoat
      By TrashBoat
      So Im trying to make a simple 2d game and make some sort of collision detection so why not to make a 2 dimensional array but i have no clue how  to write it in multiple lines
      Global $map[5,5] = [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0] something like this but it doesn't work
×