Jump to content

Listview integer ?


Wheebo
 Share

Recommended Posts

Hi im workin on a AutoInstall Script for Mainboard drivers, Graficcards, Webcams ....

Now i got the following problem :

I got a program which installs a WIN32 Tap adapter to connect to the server. This Adapter has to be at first place over lan-connection adapter.

( network-connections-options)

I know that in Delphi you can programm an integer which reads out the list entrys in the listview and declares which entry is at what position.

I now have a button in my script named "Network position" which shellexecutes C:\ and sends the lines in the window edit field to get to the network options.

( probably wont work on english machienes , because the send lines are in german )

So far i can get to the network position for all LAN adapters and then the script exits.

How can i read out the entrys of a listbox (listview) find out what adapter is at what positions and set the adapter of my programm at first place and the LAN-connection adapter at second place ? - i know its possible ( well "LoL" what is not possible in AutoIT ^^ )

il give you my source code just to look at and to realize what i mean , you wont get it working because i linked several other scripts i wrote to it + pictures sound files and Driver files which i cant upload because its way to much .

Here the source :

#comments-start
####################################################
###      [AutoInstaller]                                                                          ###
### Dieses Script wählt und installiert                                                       ###
### selbstständig den gewünschten Treiber.                                              ###
###                                                                                                     ###
####################################################
#comments-end

;Includes
#include <GUIConstants.au3>
#include <Array.au3>
#include <File.au3>
#Include <GuiListBox.au3>



SoundPlay(@ScriptDir & "\sound\Nam.wav")

;Variablen
$SetupFolderMain = @ScriptDir & "\install-exe\"
$curSelect = ""
Dim $arrFolders[1];Array für die Unterordner
$arrFolders[0] = 0
LeseOrdner()
Dim $arrFiles[$arrFolders[0]+ 1];Array für die Installationsdateien
$arrFiles[0] = $arrFolders[0]
For $i = 1 To $arrFolders[0]
      $arrFiles[$i] = LeseSetupDateien($SetupFolderMain & $arrFolders[$i] & "\")
Next

#region GUI erstellen
Dim $font
$font ="Comic Sans MS"


GUICreate("Login [AutoInstaller] Beta 2.0", 300, 310,-1,-1,-1,$WS_EX_TOOLWINDOW)
$togglebutton = GUICtrlCreateButton("Board-Erkennung", 10, 19, 120, 30)
$togglebutton2 = GUICtrlCreateButton("Treiber Installieren", 10, 50, 120, 30)
$togglebutton3 = GUICtrlCreateButton("Computername" ,10 , 80 , 120 , 30)
$togglebutton4 = GUICtrlCreateButton("Drucker",10 , 110, 120, 30)
$togglebutton5 = GUICtrlCreateButton("Anzeige TFT",10 , 140, 120 ,30)
$togglebutton6 = GUICtrlCreateButton("Anzeige Röhre",10 , 170, 120, 30)
$togglebutton7 = GUICtrlCreateButton("Network position",10 , 200, 120, 30)
$togglebutton8 = GUICtrlCreateButton("Readme/-Hilfe",10 , 230, 120, 30)
$togglebutton9 = GUICtrlCreateButton("Board nicht gefunden?",140, 120,120,30)
GUISetBkColor(00000)
GUICtrlCreatePic(@ScriptDir & "\img\login.bmp",130,180, 165,50) 
GUICtrlCreatePic(@ScriptDir & "\img\login2.bmp",10,275, 40,30)
GUICtrlCreatePic(@ScriptDir & "\img\login2.bmp",250,275, 40,30)
GUICtrlCreateLabel("Copyright Login-Lanstation © 2008",68,282) 
GUICtrlSetColor(15,0xff0000)
$statuslist   = GUICtrlCreateList("", 140, 20, 120, 109)
For $i = 1 To $arrFiles[0]
   $strItem = $arrFolders[$i]
   GUICtrlSetData($statuslist,$strItem)
Next

GUISetState(@SW_SHOW)
#endregion 
    
    
    
While 1
    $nMsg = GUIGetMsg()
  Switch $nMsg
    Case $GUI_EVENT_CLOSE
    SoundPlay(@ScriptDir & "\sound\mkiv.wav")
    Sleep(1000)
    Exit
    
        Case $statuslist
      $curSelect = $arrFiles[_GUICtrlListBox_GetCurSel($statuslist) + 1]
     
        Case $togglebutton8
            ShellExecute(@ScriptDir & "\readme.txt")
            Sleep(1000)
            SoundPlay(@ScriptDir & "\sound\readme.wav")
            WinSetState("","",@SW_MAXIMIZE)
     
        Case $togglebutton9
            Run(@ScriptDir & "\Script-AutoIns-exen\ldg-sys\ldg-sys-error.exe")
            Sleep(1000)
            Run(@ScriptDir & "\read-sys\info.exe")
            BlockInput(1)
            Sleep(1000)
            WinSetTrans("CW-Sysinfo 1.3.1.0 Freeware","",1)
            Sleep(3000)
            Send("{TAB 2}")
            Sleep(1000)
            Send("{ENTER}")
            Sleep(15000)
            Send("{TAB}")
            Sleep(1000)
            Send("{DOWN}")
            Sleep(1000)
            Send("{TAB}")   
            Sleep(1000)
            Send("{DOWN}")
            Sleep(1000)
            Send("{APPSKEY}")
            Sleep(2000)
            Send("{DOWN 3}")
            Sleep(1000)
            Send("{ENTER}")
            WinClose("CW-Sysinfo 1.3.1.0 Freeware")
            BlockInput(0)
            Sleep(1000) 
            IniWrite(@ScriptDir & "\notfound.ini", "NotFound", ClipGet ( ),"Board : " & ClipGet( ))
            Sleep(2000)
            $var = IniRead(@ScriptDir & "\notfound.ini", "NotFound", ClipGet ( ),"")    
        MsgBox(64, "Board :", $var & @CRLF & "No matching data." & @CRLF & "Please select from hand.")
        
        Case $togglebutton7
            BlockInput(1)
            WinMinimizeAll( )
            Sleep(1000)
            ShellExecute("C:\")
            Sleep(1000)
            Send("{TAB}")
            Sleep(1000)
            Send("{END}")
        Sleep(1000)
            Send("{BS 40}")
            Sleep(1000)
            Send("Systemsteuerung")
            Sleep(1000)
            Send("{ENTER}")
            Sleep(1000)
            Send("{END}")
            Sleep(1000)
            Send("{BS 40}")
            Sleep(1000)
            Send("Netzwerkverbindungen")
            Sleep(1000)
            Send("{ENTER}")
            BlockInput(0)
            Sleep(1000)
            Send("{F10}")
            Sleep(1000)
            Send("{RIGHT 5}")
            Sleep(1000)
            Send("{DOWN 5}")
            Sleep(1000)
            Send("{ENTER}")
        ;INTEGER MACHEN FÜR LAN ADAPTER - NOCH NICHT FUNKTIONS FÄHIG
     
     
        Case $togglebutton5
            WinMinimizeAll()
            Sleep(3000)
            Send("{APPSKEY}")
            Sleep(1000)
            Send("{UP}")
            Sleep(1000)
            Send("{ENTER}")
            Sleep(1000)
            Send("{TAB 4}")
            Sleep(1000)
            Send("{RIGHT 4}")
            Sleep(2000)
            Send("{TAB 1}")
            Sleep(1000)
            Send("{HOME}")
            Sleep(1000)
            Send("{RIGHT 3}")
            Sleep(1000)
            Send("{TAB 6}")
            Sleep(1000)
            Send("{ENTER}")
            Sleep(1000)
            WinClose("Eigenschaften von Anzeige")
            MsgBox(64,"Finish","Die Anzeige Einstellungen ( TFT ) wurden übernommen.")
     
        Case $togglebutton4
            Sleep(3000)
            Send("{LWIN}")
            Sleep(2000)
            Send("{LEFT 2}")
            Sleep(2000)
            Send("{ENTER}")
            Sleep(2000)
            Send("{DOWN 5}")
            Sleep(2000)
            Send("{ENTER 2}")
            Sleep(2000)
            Send("{DOWN 2}")
            Sleep(2000)
            Send("{ENTER}")
            Sleep(2000)
            Send("{RIGHT}")
            Sleep(2000)
            Send("{LEFT}")
            Sleep(2000)
            Send("{ENTER}")
            Sleep(2000)
            Send("{ENTER}")
            Sleep(2000)
            Send("{DOWN}")
            Sleep(2000)
            Send("{TAB 2}")
            Sleep(2000)
            Send("{DOWN}")
            Sleep(2000)
            Send("\\kassen-server\")
            Sleep(1000)
            Send("{DOWN}")
            Sleep(2000)
            Send("{ENTER}")
            Sleep(2000)
            Send("{DOWN}")
            Send("{TAB}")
            Send("{ENTER 2}")
            Sleep(4000)
            MsgBox(0,"Und?","End")  

        Case $togglebutton6
            WinMinimizeAll( )
            Sleep(1000)
            Send("{APPSKEY}")
            Sleep(1000)
            Send("{UP}")
            Sleep(1000)
            Send("{ENTER}")
            Sleep(1000)
            Send("{TAB 4}")
            Sleep(1000)
            Send("{RIGHT 4}")
            Sleep(1000)
            Send("{TAB}")
            Sleep(1000)
            Send("{HOME}")
            Sleep(1000)
            Send("{RIGHT 2}")
            Sleep(1000)
            Send("{TAB 6}")
            Sleep(1000)
            WinClose("Eigenschaften von Anzeige")
            MsgBox(64,"Finish","Die Anzeige Einstellungen ( Röhre ) wurden übernommen.")
    
        Case $togglebutton
            Run(@ScriptDir & "\Script-AutoIns-exen\ldg-sys\ldg-sys.exe")
            Sleep(1000)
            Run(@ScriptDir & "\read-sys\info.exe")
        BlockInput(1)
        Sleep(1000)
            WinSetTrans("CW-Sysinfo 1.3.1.0 Freeware","",1)
            Sleep(3000)
            Send("{TAB 2}")
            Sleep(1000)
            Send("{ENTER}")
            Sleep(15000)
            Send("{TAB}")
            Sleep(1000)
            Send("{DOWN}")
            Sleep(1000)
            Send("{TAB}")   
            Sleep(1000)
            Send("{DOWN}")
            Sleep(1000)
        Send("{APPSKEY}")
            Sleep(2000)
            Send("{DOWN 3}")
            Sleep(1000)
            Send("{ENTER}")
            WinClose("CW-Sysinfo 1.3.1.0 Freeware")
            BlockInput(0)
            Sleep(1000)     
    
          If ClipGet( ) = "MS-6566E" then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (Drecksboard)")
            EndIf
          
          If ClipGet ( ) ="nForce4 DDR: 9NPA+" Then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (NForce4)")
            EndIf
           
          If ClipGet ( ) ="9NPA+Ultra" Then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (NForce4)")
          EndIf
           
          If ClipGet ( ) ="9NPAJ" Then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (NForce4)")
          EndIf
           
          If ClipGet ( ) ="9NPA Ultra Series" Then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet( ), ClipGet( ) & " (NForce4)")
            EndIf
           
          If ClipGet ( ) ="nForce4 DDR: 9NPA+ / 9NPA+Ultra / 9NPAJ / 9NPA Ultra Series" Then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (NForce4)")
            EndIf
           
          If ClipGet ( ) ="GA-N650SLI-DS4L" Then
              IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (650 SLI)")
          EndIf
           
          If ClipGet ( ) ="GA-K8N Pro-SLI" Then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (NForce4)")
          EndIf
           
          If ClipGet ( ) ="MS-6570" Then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (NForce2)")
          EndIf
           
          If ClipGet ( ) ="P5N-E SLI" Then
                IniWrite(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), ClipGet( ) & " (650 SLI)")
            EndIf
           
            sleep(1000)
            $var = IniRead(@ScriptDir & "\board.ini", "Boards", ClipGet ( ), "")    
        MsgBox(64, "Board :", $var & @CRLF & "closing MsgBox in 3 seconds",3)
        
          If @error Then
              ControlClick("Login [AutoInstaller] Beta 2.0","",11)
          endif
                  
         ;NICHT VERGESSEN FENSTER TITEL ZU ÄNDERN BEI DER LITE VERSION !!!!!!!! ( WinActivate) !!!!!!
                If ClipGet ( ) ="MS-6566E" then
                    WinActivate("Login [AutoInstaller] Beta 2.0")
                EndIf
                
                Sleep(3000)
                
                If ClipGet ( ) ="MS-6566E" then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    send("{DOWN}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf
                
                If ClipGet ( )="GA-K8N Pro-SLI" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    Send("{DOWN}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf
                
                If ClipGet ( )="nForce4 DDR: 9NPA+" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    Send("{DOWN}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf
                
                If ClipGet ( )="9NPA+Ultra" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    Send("{DOWN}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf       

                If ClipGet ( )="9NPAJ" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    Send("{DOWN}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf
                
                If ClipGet ( )="9NPA Ultra Series" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    Send("{DOWN}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf   

                If ClipGet ( )="nForce4 DDR: 9NPA+ / 9NPA+Ultra / 9NPAJ / 9NPA Ultra Series" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    Send("{DOWN}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf
                
                If ClipGet ( )="GA-N650SLI-DS4L" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    Send("{UP 2}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf

                If ClipGet ( )="GA-K8N Pro-SLI" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    send("{DOWN}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf
                
                If ClipGet ( )="MS-6570" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf   

                If ClipGet ( )="P5N-E SLI" Then
                    ControlClick("Login [AutoInstaller] Beta 2.0","",16)
                    Sleep(1000)
                    Send("{UP 2}")
                    Sleep(2000)
                    Send("{TAB 2}")
                    Sleep(1000)
                    ControlClick("Login [AutoInstaller] Beta 2.0","",12)
                    Sleep(1000)
                    Send("{ENTER 1}")
                EndIf
                
                $curSelect = $arrFiles[_GUICtrlListBox_GetCurSel($statuslist) + 1]
                
                Run($curSelect)
           
            While 1
                
                If ProcessExists("6.86_nforce_win2kxp_international_whql.exe") Then 
                    Run(@ScriptDir & "\Script-AutoIns-exen\NForce4.exe")
                    ExitLoop
                EndIf

                If ProcessExists("nForce_5.10_WinXP2K_WHQL_international.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\NForce2.exe")
                    ExitLoop
                EndIf

                If ProcessExists("9.16_nforce_winxp_international_whql.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\AM2.exe")
                    ExitLoop
                EndIf

                If ProcessExists("8.43_nforce_650i_winxp32_international.exe") Then
                    run(@ScriptDir & "\Script-AutoIns-exen\SLI.exe")
                    ExitLoop
                EndIf

                If ProcessExists("setup.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\Grafik.exe")
                    ExitLoop
                EndIf

                If ProcessExists("setup.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\Wheel.exe")
                    ExitLoop
                EndIf

                If ProcessExists("STD 3_75E.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\SLICAM.exe")
                    ExitLoop
                EndIf
            WEnd
          
        Case $togglebutton3 
            MsgBox(0,"","Computername: " & @computername)
            
        Case $togglebutton2
            While 1
                If ProcessExists("6.86_nforce_win2kxp_international_whql.exe") Then 
                    Run(@ScriptDir & "\Script-AutoIns-exen\NForce4.exe")
                    ExitLoop                
                EndIf

                If ProcessExists("nForce_5.10_WinXP2K_WHQL_international.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\NForce2.exe")
                    ExitLoop
                EndIf
                
                If ProcessExists("9.16_nforce_winxp_international_whql.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\AM2.exe")
                    ExitLoop
                EndIf

                If ProcessExists("8.43_nforce_650i_winxp32_international.exe") Then
                    run(@ScriptDir & "\Script-AutoIns-exen\SLI.exe")
                    ExitLoop
                EndIf

                If ProcessExists("setup.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\Grafik.exe")
                    ExitLoop
                 Endif

                If ProcessExists("setup.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\Wheel.exe")
                    ExitLoop
                EndIf

                If ProcessExists("STD 3_75E.exe") Then
                    Run(@ScriptDir & "\Script-AutoIns-exen\SLICAM.exe")
                    ExitLoop
                EndIf
            Run($curSelect)
            WEnd
            
    EndSwitch
WEnd 
 
#region FUNKTIONEN

;Unterordner einlesen
Func LeseOrdner()
   $arrFolders = _FileListToArray($SetupFolderMain,"*",2)
EndFunc

Func LeseSetupDateien($pfad)
   $search = FileFindFirstFile($pfad & "*.exe")
   If $search <> -1 Then
      Return $pfad & FileFindNextFile($search)
   Else
      Return "nv"
    EndIf
EndFunc

#endregion

This is the part where i want to have an "integer" or what ever to read out the adapter position :

Case $togglebutton7
            BlockInput(1)
            WinMinimizeAll( )
            Sleep(1000)
            ShellExecute("C:\")
            Sleep(1000)
            Send("{TAB}")
            Sleep(1000)
            Send("{END}")
        Sleep(1000)
            Send("{BS 40}")
            Sleep(1000)
            Send("Systemsteuerung")
            Sleep(1000)
            Send("{ENTER}")
            Sleep(1000)
            Send("{END}")
            Sleep(1000)
            Send("{BS 40}")
            Sleep(1000)
            Send("Netzwerkverbindungen")
            Sleep(1000)
            Send("{ENTER}")
            BlockInput(0)
            Sleep(1000)
            Send("{F10}")
            Sleep(1000)
            Send("{RIGHT 5}")
            Sleep(1000)
            Send("{DOWN 5}")
            Sleep(1000)
            Send("{ENTER}")
        ;INTEGER MACHEN FÜR LAN ADAPTER - NOCH NICHT FUNKTIONS FÄHIG

Thanks for your support.

Link to comment
Share on other sites

I suspect that you will find what you want in the include file GUILISTVIEW.AU3

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...