1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. DeepRed92

Beiträge von DeepRed92

  • Ini in 3D Array einlesen?

    • DeepRed92
    • 6. September 2009 um 20:35

    Ok. Ich hab es jetzt so gemacht, das Redim immer um die Anzahl der folgenden Einträge vergrößert wird. Code:

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/striponly
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.0.0
    Author: myName

    Script Function:
    Template AutoIt script.

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here

    [/autoit] [autoit][/autoit] [autoit]

    $Timer = TimerInit()
    $Ret = _IniReadToArray("Settings.ini")
    $Read = _IniRead_Array($Ret, "Desktop Radio", "PlayerGUIEnableTrans")
    $Diff = TimerDiff($Timer)

    [/autoit] [autoit][/autoit] [autoit]

    MsgBox(0, "", $Diff)

    [/autoit] [autoit][/autoit] [autoit]

    Func _IniRead_Array($xArray, $xSection, $xKey)
    For $Loop = 0 To UBound($xArray) - 1
    Switch $xArray[$Loop][0]
    Case $xSection
    If $xArray[$Loop][1] = $xKey Then Return $xArray[$Loop][2]
    EndSwitch
    Next
    Return 0
    EndFunc ;==>_IniRead_Array

    [/autoit] [autoit][/autoit] [autoit]

    Func _IniReadToArray($zFile)
    Local $sSectionNames = IniReadSectionNames($zFile)
    Local $VirtIni[1][3]
    Local $Counter = 0
    For $l = 1 To $sSectionNames[0]
    $IRSTA = _IniReadSectionToArray($zFile, $sSectionNames[$l])
    ReDim $VirtIni[$Counter + UBound($IRSTA)][3]
    For $x = 0 To UBound($IRSTA) - 1
    $VirtIni[$Counter][0] = $IRSTA[$x][0]
    $VirtIni[$Counter][1] = $IRSTA[$x][1]
    $VirtIni[$Counter][2] = $IRSTA[$x][2]
    $Counter += 1
    Next
    Next
    Return $VirtIni
    EndFunc ;==>_IniReadToArray

    [/autoit] [autoit][/autoit] [autoit]

    Func _IniReadSectionToArray($iFile, $iSection)
    Local $INI = @ScriptDir & '\' & $iFile
    Local $aSection = IniReadSection($INI, $iSection)
    Local $aIni[$aSection[0][0]][3]
    For $i = 1 To UBound($aSection) - 1
    $aIni[$i - 1][0] = $iSection
    $aIni[$i - 1][1] = $aSection[$i][0]
    $aIni[$i - 1][2] = $aSection[$i][1]
    Next
    Return $aIni
    EndFunc ;==>_IniReadSectionToArray

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]

    Zeit: 3 ms - (-0,8 ms)

  • Ini in 3D Array einlesen?

    • DeepRed92
    • 6. September 2009 um 19:59

    Also auf USB Stick liegen beide um 15 Ms. Auf Festplatte hat das Script mit Dim 4 Ms gebraucht. Das ohne ReDim benötigte nur eine Zeit von -1,34 ms? Komisch :whistling:

  • Ini in 3D Array einlesen?

    • DeepRed92
    • 6. September 2009 um 19:43

    Hmm aber 16 ms sind doch schon sehr gut würd ich mal sagen ^^
    Ohne ReDim ist es genau so schnell! Laut TimerDiff :D

  • Ini in 3D Array einlesen?

    • DeepRed92
    • 6. September 2009 um 19:34
    Zitat

    Spart die Redim-Bremse!

    So viel bremst das doch auch nicht oder?

  • Ini in 3D Array einlesen?

    • DeepRed92
    • 6. September 2009 um 17:50

    Danke BugFix. Hab das gleich mal alles umgesetzt. Hier wer es braucht:

    Spoiler anzeigen
    [autoit]

    $Ret = _IniReadToArray("Settings.ini")
    $Read = _IniRead_Array($Ret, "Inet", "InetConnectionWait")

    [/autoit] [autoit][/autoit] [autoit]

    MsgBox(0, "", $D3D)

    [/autoit] [autoit][/autoit] [autoit]

    Func _IniRead_Array($xArray, $xSection, $xKey) ;Deepred (AutoIt.de)
    For $Loop = 0 To UBound($xArray) -1
    Switch $xArray[$Loop][0]
    Case $xSection
    If $xArray[$Loop][1] = $xKey Then Return $xArray[$Loop][2]
    EndSwitch
    Next
    Return 0
    EndFunc ;==>_IniRead_Array

    [/autoit] [autoit][/autoit] [autoit]

    Func _IniReadToArray($zFile) ;Deepred (AutoIt.de)
    Local $sSectionNames = IniReadSectionNames($zFile)
    Local $VirtIni[1][3]
    Local $Counter = 0
    For $l = 1 To $sSectionNames[0]
    $IRSTA = _IniReadSectionToArray($zFile, $sSectionNames[$l])
    For $x = 0 To UBound($IRSTA) - 1
    ReDim $VirtIni[$Counter + 1][3]
    $VirtIni[$Counter][0] = $IRSTA[$x][0]
    $VirtIni[$Counter][1] = $IRSTA[$x][1]
    $VirtIni[$Counter][2] = $IRSTA[$x][2]
    $Counter += 1
    Next
    Next
    Return $VirtIni
    EndFunc ;==>_IniReadToArray

    [/autoit] [autoit][/autoit] [autoit]

    Func _IniReadSectionToArray($iFile, $iSection) ;Deepred (AutoIt.de)
    Local $INI = @ScriptDir & '\' & $iFile
    Local $aSection = IniReadSection($INI, $iSection)
    Local $aIni[$aSection[0][0]][3]
    For $i = 1 To UBound($aSection) - 1
    $aIni[$i - 1][0] = $iSection
    $aIni[$i - 1][1] = $aSection[$i][0]
    $aIni[$i - 1][2] = $aSection[$i][1]
    Next
    Return $aIni
    EndFunc ;==>_IniReadSectionToArray

    [/autoit]

    Es ist besonders bei ganz vielen Ini-Abfragen von Vorteil, da es glaub ich deutlich schneller ist als einzelne IniRead -Abfragen.

  • Ini in 3D Array einlesen?

    • DeepRed92
    • 6. September 2009 um 16:27
    Zitat

    Meinst du tatsächlich 3D oder eher 2D mit einem zusätzlichen Element in der zweiten Dimension, also einer weiteren Spalte?

    Naja wenn 2D sinnvoller ist... und wo sollen dann die Sectionnames gespeichert werden?

  • Ini in 3D Array einlesen?

    • DeepRed92
    • 6. September 2009 um 13:19

    Hallo,

    ich versuche gerade eine Inidatei in einen 3D Array einlesen zu lassen. Im Moment bin ich so weit:

    Spoiler anzeigen
    [autoit]

    Func _IniReadToArray($i_File)

    [/autoit] [autoit][/autoit] [autoit]

    Dim $i_Array[1][2][1]

    [/autoit] [autoit][/autoit] [autoit]

    $i_IniReadSectionNames = IniReadSectionNames($i_File)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    For $i_Loop = 1 To $i_IniReadSectionNames[0]

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ReDim $i_Array[UBound($i_Array, 1)][UBound($i_Array, 2)][$i_Loop]
    $i_Array[0][0][$i_Loop - 1] = $i_IniReadSectionNames[$i_Loop]

    [/autoit] [autoit][/autoit] [autoit]

    $i_Section = IniReadSection($i_File, $i_IniReadSectionNames[$i_Loop])

    [/autoit] [autoit][/autoit] [autoit]

    For $i_Loop2 = 1 To $i_Section[0][0]

    [/autoit] [autoit][/autoit] [autoit]

    ReDim $i_Array[$i_Loop2 + 1][UBound($i_Array, 2)][UBound($i_Array, 3)]

    [/autoit] [autoit][/autoit] [autoit]

    $i_Array[$i_Loop2 - 1][0][$i_Loop - 1] = $i_Section[$i_Loop2][0]
    $i_Array[$i_Loop2 - 1][1][$i_Loop - 1] = $i_Section[$i_Loop2][1]

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Next
    Next

    [/autoit] [autoit][/autoit] [autoit]

    _ArrayDisplayTree($i_Array, 0, "Array In Array")
    EndFunc ;==>_IniReadToArray

    [/autoit]
    _ArrayDisplayTree.au3
    [autoit]

    #include <GuiImageList.au3>
    #include <TreeViewConstants.au3>
    #include <WindowsConstants.au3>
    #include <GuiTreeView.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Func _ArrayDisplayTree($aArray, $iExpand = 1, $sTitle = "Array: TreeView Display", $sDimension = "", $sElement = "", $iWidth = 380, $iHeight = 640, $iRootColor = 0xCC0000, $iDimensionColor = 0x00AA00, $iElementColor = 0x0000FF)
    ;By Eukalyptus ;)
    If Not IsArray($aArray) Then Return SetError(1, 0, 0)
    Local $iEventMode = Opt("GUIOnEventMode", 0)
    Local $aIndex[UBound($aArray, 0) + 1], $sRoot = "Array "
    $aIndex[0] = 1
    For $i = 1 To UBound($aArray, 0)
    $aIndex[$i] = "0"
    $aIndex[0] *= UBound($aArray, $i)
    $sRoot &= "[" & UBound($aArray, $i) & "]"
    Next
    Local $hGui = GUICreate($sTitle, $iWidth, $iHeight, Default, Default, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU))
    Local $iStyle = BitOR($TVS_DISABLEDRAGDROP, $TVS_HASBUTTONS, $TVS_LINESATROOT)
    Local $hTreeView = GUICtrlCreateTreeView(2, 2, $iWidth - 4, $iHeight - 26, $iStyle)
    Local $hParent = GUICtrlCreateTreeViewItem($sRoot, $hTreeView)
    GUICtrlSetColor(-1, $iRootColor)
    Local $hImageList = _GUIImageList_Create(11, 11)
    _GUIImageList_Add($hImageList, _GUICtrlTreeView_CreateSolidBitMap($hTreeView, 0x666666, 11, 11))
    _GUIImageList_Add($hImageList, _GUICtrlTreeView_CreateSolidBitMap($hTreeView, 0xAA0000, 11, 11))
    _GUIImageList_Add($hImageList, _GUICtrlTreeView_CreateSolidBitMap($hTreeView, 0x00AA00, 11, 11))
    _GUIImageList_Add($hImageList, _GUICtrlTreeView_CreateSolidBitMap($hTreeView, 0x0000CC, 11, 11))
    _GUIImageList_Add($hImageList, _GUICtrlTreeView_CreateSolidBitMap($hTreeView, 0xFFAA00, 11, 11))
    _GUIImageList_Add($hImageList, _GUICtrlTreeView_CreateSolidBitMap($hTreeView, 0xFF00FF, 11, 11))
    _GUICtrlTreeView_SetNormalImageList($hTreeView, $hImageList)
    Local $hProgress = GUICtrlCreateProgress(2, $iHeight - 20, $iWidth - 4, 18, 0x1)
    GUISetState()
    _GUICtrlTreeView_BeginUpdate($hTreeView)
    _ArrayDisplayTreeAddItems($aArray, $hTreeView, $hParent, $aIndex, $hProgress, 0, $iRootColor, $iDimensionColor, $iElementColor, $sDimension, $sElement)
    _GUICtrlTreeView_Expand($hTreeView, $hParent, False)
    _GUICtrlTreeView_EndUpdate($hTreeView)
    Switch $iExpand
    Case 1
    _GUICtrlTreeView_Expand($hTreeView, $hParent)
    Case 2
    Local $sExpand = "#0", $hTree = ControlGetHandle($hGui, "", $hTreeView)
    For $i = 0 To UBound($aIndex) - 1
    ControlTreeView($hGui, "", $hTree, "Expand", $sExpand)
    $sExpand &= "|#0"
    Next
    Case Else
    Local $hTree = ControlGetHandle($hGui, "", $hTreeView)
    ControlTreeView($hGui, "", $hTree, "Expand", "#0")
    EndSwitch
    GUICtrlSetData($hProgress, 0)
    While GUIGetMsg() <> -3
    WEnd
    GUIDelete($hGui)
    Opt("GUIOnEventMode", $iEventMode)
    EndFunc ;==>_ArrayDisplayTree

    [/autoit] [autoit][/autoit] [autoit]

    Func _ArrayDisplayTreeAddItems($aArray, $hTreeView, $hParent, $aIndex, $hProgress, $iStep, $iRootColor, $iDimensionColor, $iElementColor, $sDim, $sEle)
    Local $sExexute = "$aArray", $sElement = $sEle, $sDimension, $Temp, $hItem
    $hItem = $hParent
    For $i = 1 To UBound($aArray, 0) - 1
    $Temp = _GUICtrlTreeView_GetItemByIndex($hTreeView, $hItem, $aIndex[$i])
    If $Temp = 0 Then
    $sDimension = $sDim
    For $j = 1 To UBound($aIndex) - 1
    Switch $j
    Case $i
    $sDimension &= "[" & $aIndex[$i] & "] "
    Case Else
    $sDimension &= "_ "
    EndSwitch
    Next
    $hItem = GUICtrlCreateTreeViewItem($sDimension, $hItem)
    GUICtrlSetColor(-1, $iDimensionColor)
    _GUICtrlTreeView_SetImageIndex($hTreeView, $hItem, Mod($i, 4) + 1)
    Else
    _GUICtrlTreeView_SelectItem($hTreeView, $Temp, $TVGN_CARET)
    $hItem = GUICtrlRead($hTreeView)
    EndIf
    $sExexute &= "[" & $aIndex[$i] & "] "
    $sElement &= "[" & $aIndex[$i] & "] "
    Next
    For $i = 1 To UBound($aArray, UBound($aArray, 0));-1
    $Temp = Execute($sExexute & "[" & $i - 1 & "]")
    If IsArray($Temp) Then
    Local $aElementIndex[UBound($Temp, 0) + 1], $sRoot = "Array ", $hElementItem
    $aElementIndex[0] = 1
    For $j = 1 To UBound($Temp, 0)
    $aElementIndex[$j] = "0"
    $aElementIndex[0] *= UBound($Temp, $j)
    $sRoot &= "[" & UBound($Temp, $j) & "]"
    Next
    $hElementItem = GUICtrlCreateTreeViewItem($sElement & "[" & $i - 1 & "] = <" & $sRoot & ">", $hItem)
    GUICtrlSetColor(-1, $iRootColor)
    _GUICtrlTreeView_SetImageIndex($hTreeView, $hElementItem, 5)
    _ArrayDisplayTreeAddItems($Temp, $hTreeView, $hElementItem, $aElementIndex, $hProgress, 0, $iRootColor, $iDimensionColor, $iElementColor, "SUB " & $sDim, "SUB " & $sEle)
    ContinueLoop
    EndIf
    $Temp = GUICtrlCreateTreeViewItem($sElement & "[" & $i - 1 & "] = <" & $Temp & ">", $hItem)
    GUICtrlSetColor(-1, $iElementColor)
    _GUICtrlTreeView_SetImageIndex($hTreeView, $Temp, 5)
    $iStep += 1
    Next
    GUICtrlSetData($hProgress, $iStep * 100 / $aIndex[0])
    $Temp = UBound($aIndex) - 1
    Switch $Temp
    Case 1
    Return
    Case 2
    $aIndex[$Temp - 1] += 1
    If $aIndex[1] >= UBound($aArray, 1) Then Return
    Case Else
    $aIndex[$Temp - 1] += 1
    For $i = $Temp To 2 Step -1
    Switch 1
    Case $aIndex[$i] >= UBound($aArray, $i)
    $aIndex[$i] = 0
    $aIndex[$i - 1] += 1
    If $aIndex[1] >= UBound($aArray, 1) Then Return
    If $aIndex[$i - 1] >= UBound($aArray, $i - 1) Then ContinueLoop
    EndSwitch
    Next
    EndSwitch
    _ArrayDisplayTreeAddItems($aArray, $hTreeView, $hParent, $aIndex, $hProgress, $iStep, $iRootColor, $iDimensionColor, $iElementColor, $sDim, $sEle)
    EndFunc ;==>_ArrayDisplayTreeAddItems

    [/autoit]

    Ich möchte nämlich einen Array nach folgendem Schema erzeugen:

    $Array[0][0][1] ==> Sectionname
    $Array[0][1][0] ==> 0 = Key, 1 = Value
    $Array[1][0][0] ==> Key oder Value

    Doch irgendwie habe ich da meine Probleme mit 3D Arrays, da ich sie nicht so oft benutze (fast nie).
    Als 2D Array ist es mir nicht übersichtlich genug...

    Ich hoffe jemand kann dieses Problem lösen ich blicke da bei diesen ganzen Array-Dinger nicht mehr durch :wacko:

  • Brauche kleine Hilfe beim Denken

    • DeepRed92
    • 6. September 2009 um 12:27

    Hmmm aber warum funktionierte das vorher und durch die Child-GUIs jetzt nicht mehr? ;(

  • Brauche kleine Hilfe beim Denken

    • DeepRed92
    • 6. September 2009 um 10:26
    Zitat von nuts

    Du kannst da beim Dropevent auslesen was schon im Listview steht und mit den hinzuzufügenden vergleichen.

    Würde das nicht etwas zu lange dauern? ?(

    Zitat von nuts

    Für die Schnittmengenermittlung gibts auch eine UDF von Bugfix (im Skripteforum).

    Ok werde ich mir mal anschauen. ;)

    Zitat von nuts

    Das Design ist übrigens ziemlich cool


    Danke danke :D


    Liegt das jetzt eigentlich an den ChildGUIs? Weil vorher hatte ich dieses Problem noch nicht. :huh:

  • Brauche kleine Hilfe beim Denken

    • DeepRed92
    • 6. September 2009 um 09:22

    Ach so. Das 3. Steuerelement hatte die Zahl 3 was womöglich den GUI_EVENT_CLOSE ausgelöst hat. Vielen Dank!

    Noch eine allerletzte kleine Frage:

    Wenn man das Programm startet, auf Musik klickt, paar Musikordner in die List View zieht ,anschließend auf ein ListViewItem klickt und in die selbe List View zieht tauchen die selben Dateien nochmal auf. Wie kann ich das abstellen?

    Ich denke mal, dass das Problem an Zeile 201 - 233 liegt. Ich hab schon versucht die Variable "$gaDropFiles" nach jedem Drop-Event zu ReDimmen und zu löschen, doch dann taucht ein Objekt-Error auf. :wacko:

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_Run_Au3check=n
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/striponly
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.0.0
    Author: DeepRed (AutoIt.de)

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here

    [/autoit] [autoit][/autoit] [autoit]

    #include <Includes\MessageHandler.au3>
    #include <GuiConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Constants.au3>
    #include <GuiToolBar.au3>
    #include <GuiImageList.au3>
    #include <GuiListView.au3>
    #include <Includes\ModernMenuRaw.au3>
    #include <ListViewConstants.au3>
    #include <GuiStatusBar.au3>
    #include <ProgressConstants.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Global $Width = 712
    Global $Hight = 440
    Global $aParts[4] = [200, 300, 620, -1]
    Global $gaDropFiles[1]
    Global $WM_DROPFILES = 0x233

    [/autoit] [autoit][/autoit] [autoit]

    Global Enum $item1 = 1000, $item2, $item3, $item4, $item5, $item6, $item7, $item8, $item9, $item10, $item11

    [/autoit] [autoit][/autoit] [autoit]

    Switch @OSVersion ;Oscar (http://www.autoit.de)
    Case 'WIN_VISTA', 'WIN_7'
    Global $aID3Index[3] = [21, 13, 28] ; Title, Artists, Bitrate
    Case 'WIN_XP', 'WIN_2003'
    Global $aID3Index[3] = [10, 16, 22] ; Title, Artists, Bitrate
    Case 'WIN_2000'
    Global $aID3Index[3] = [11, 10, 30] ; Title, Artists, Bitrate
    Case Else
    Exit MsgBox(16, "Musik Manager", 'Ihr Betriebssystem wird von diesem Programm nicht unterstützt!')
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $MainGUI = GUICreate("Desktop Radio Music Manager (Beta)", $Width - 1, $Hight + 33, -1, -1, -1, $WS_EX_ACCEPTFILES)
    GUISetIcon(@ScriptDir & "\Img\Icons\Toolbar\Radio2.ico")

    [/autoit] [autoit][/autoit] [autoit]

    ;-----------------------------------------------------------\
    $Menu_File = GUICtrlCreateMenu("Datei")
    $Menu_Item_Exit = _GUICtrlCreateODMenuItem("Beenden", $Menu_File, "shell32.dll", -132)
    $Menu_Edit = GUICtrlCreateMenu("Bearbeiten")

    [/autoit] [autoit][/autoit] [autoit]

    $Menu_Extras = GUICtrlCreateMenu("Extras")

    [/autoit] [autoit][/autoit] [autoit]

    $Menu_Info = GUICtrlCreateMenu("Info")
    $Menu_Item_About = _GUICtrlCreateODMenuItem("Über Music Manager", $Menu_Info, @ScriptDir & "\img\Icons\Radio2.ico", 0)
    $Menu_Item_Infos = _GUICtrlCreateODMenuItem("Versionshinweise", $Menu_Info, "shell32.dll", -91)
    ;-----------------------------------------------------------/
    ;-----------------------------------------------------------\
    $hToolbar = _GUICtrlToolbar_Create($MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ImageListToolbar = _GUIImageList_Create(32, 32, 5, 3, 3)
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Previous.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Next.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\add.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Edit.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Delete.ico")

    [/autoit] [autoit][/autoit] [autoit]

    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Stop.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Play.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Pause.ico")

    [/autoit] [autoit][/autoit] [autoit]

    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Refresh.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Help.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Mail.ico")
    _GUICtrlToolbar_SetImageList($hToolbar, $ImageListToolbar)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlToolbar_AddButton($hToolbar, $item1, 0)
    _GUICtrlToolbar_AddButton($hToolbar, $item2, 1)
    _GUICtrlToolbar_AddButtonSep($hToolbar)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlToolbar_AddButton($hToolbar, $item3, 2)
    _GUICtrlToolbar_AddButton($hToolbar, $item4, 3)
    _GUICtrlToolbar_AddButton($hToolbar, $item5, 4)
    _GUICtrlToolbar_AddButtonSep($hToolbar)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlToolbar_AddButton($hToolbar, $item6, 5)
    _GUICtrlToolbar_AddButton($hToolbar, $item7, 6)
    _GUICtrlToolbar_AddButton($hToolbar, $item8, 7)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlToolbar_AddButtonSep($hToolbar)
    _GUICtrlToolbar_AddButton($hToolbar, $item9, 8)
    _GUICtrlToolbar_AddButton($hToolbar, $item10, 9)
    _GUICtrlToolbar_AddButton($hToolbar, $item11, 10)

    [/autoit] [autoit][/autoit] [autoit]

    ;-----------------------------------------------------------/
    ;-----------------------------------------------------------\
    $Page_Start = GUICreate("", $Width, $Hight - 63 + 10, 0, 44, $WS_CHILD, -1, $MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Start = GUICtrlCreateListView("Navigation", 0, 0, $Width, $Hight - 63 + 10)
    GUICtrlSetStyle($ListView_Start, $LVS_ICON, $LVS_EX_DOUBLEBUFFER)
    GUICtrlSetState($ListView_Start, $GUI_DROPACCEPTED)
    _GUICtrlListView_AddItem($ListView_Start, "Radiosender", 0)
    _GUICtrlListView_AddItem($ListView_Start, "Musik", 1)
    _GUICtrlListView_AddItem($ListView_Start, "Favouriten", 2)
    $ImageListListViewStart = _GUIImageList_Create(48, 48, 5, 1)
    _GUIImageList_AddIconSize($ImageListListViewStart, @ScriptDir & "\Images\Icons\Toolbar\Radio2.ico", 48)
    _GUIImageList_AddIconSize($ImageListListViewStart, @ScriptDir & "\Images\Icons\Toolbar\MP3.ico", 48)
    _GUIImageList_AddIconSize($ImageListListViewStart, @ScriptDir & "\Images\Icons\Toolbar\Favorites.ico", 48)
    _GUICtrlListView_SetImageList($ListView_Start, $ImageListListViewStart, 0)
    ;-----------------------------------------------------------/
    ;-----------------------------------------------------------\
    $Page_Channels = GUICreate("", $Width, $Hight - 63 + 10, 0, 44, $WS_CHILD, -1, $MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Channels = GUICtrlCreateListView("Name des Senders:|Genre|Bewertung|Internetadresse:", 0, 0, $Width, $Hight - 63 + 10)
    _GUICtrlListView_SetColumnWidth($ListView_Channels, 0, 170)
    _GUICtrlListView_SetColumnWidth($ListView_Channels, 1, 100)
    _GUICtrlListView_SetColumnWidth($ListView_Channels, 2, 70)
    _GUICtrlListView_SetColumnWidth($ListView_Channels, 3, 350)
    _GUICtrlListView_RegisterSortCallBack($ListView_Channels)
    ;-----------------------------------------------------------/
    $Page_Musik = GUICreate("", $Width, $Hight - 63 + 10, 0, 44, $WS_CHILD, -1, $MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Musik = GUICtrlCreateListView("Titel|Interpret|Länge|Bewertung|Bitrate|Größe", 0, 0, $Width, $Hight - 63 + 10)
    GUICtrlSetState($ListView_Musik, $GUI_DROPACCEPTED)
    _GUICtrlListView_SetColumnWidth($ListView_Musik, 0, 300)
    _GUICtrlListView_SetColumnWidth($ListView_Musik, 1, 130)
    _GUICtrlListView_SetColumnWidth($ListView_Musik, 2, 60)
    _GUICtrlListView_SetColumnWidth($ListView_Musik, 3, 70)
    _GUICtrlListView_SetColumnWidth($ListView_Musik, 4, 65)
    _GUICtrlListView_SetColumnWidth($ListView_Musik, 5, 65)
    _GUICtrlListView_RegisterSortCallBack($ListView_Musik)
    ;-----------------------------------------------------------\
    ;-----------------------------------------------------------/
    $Page_Favoriten = GUICreate("", $Width, $Hight - 63 + 10, 0, 44, $WS_CHILD, -1, $MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Favoriten = GUICtrlCreateListView("Titel|Interpret|Länge|Bewertung|Bitrate|Größe", 0, 0, $Width, $Hight - 63 + 10)
    GUICtrlSetStyle($ListView_Favoriten, $LVS_ICON + $LVS_EDITLABELS, $LVS_EX_DOUBLEBUFFER)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 0, 312)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 1, 80)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 2, 50)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 3, 70)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 4, 50)
    $ImageListListViewFavoriten = _GUIImageList_Create(32, 32, 5, 3, 3)
    _GUIImageList_AddIconSize($ImageListListViewFavoriten, @ScriptDir & "\Images\Icons\Toolbar\Folder.ico", 48)
    _GUICtrlListView_SetImageList($ListView_Favoriten, $ImageListListViewFavoriten, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Favoriten_Menu = GUICtrlCreateContextMenu($ListView_Favoriten)
    _GUICtrlCreateODMenuItem("Löschen", $ListView_Favoriten_Menu, @ScriptDir & "\Images\Icons\Toolbar\Delete.ico", 0)
    _GUICtrlCreateODMenuItem("Bearbeiten", $ListView_Favoriten_Menu, @ScriptDir & "\Images\Icons\Toolbar\Edit.ico", 0)
    $ListView_Favoriten_Menu_New = _GUICtrlCreateODMenu("Neu", $ListView_Favoriten_Menu, @ScriptDir & "\Images\Icons\Toolbar\New.ico", 0)
    $ListView_Favoriten_Menu_Item_Folder = _GUICtrlCreateODMenuItem("Ordner", _
    $ListView_Favoriten_Menu_New, @ScriptDir & "\Images\Icons\Toolbar\Folder.ico", 0)
    ;-----------------------------------------------------------\
    ;-----------------------------------------------------------/
    $StatusBar = _GUICtrlStatusBar_Create($MainGUI, $aParts)
    _GUICtrlStatusBar_SetParts($StatusBar, $aParts)
    _GUICtrlStatusBar_SetText($StatusBar, " Statusanzeige", 0)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    $StatusBar_Progress = GUICtrlCreateProgress(5, 501, 100, 17, $PBS_SMOOTH)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 7)

    [/autoit] [autoit][/autoit] [autoit]

    $StatusBar_Progress_Handle = GUICtrlGetHandle($StatusBar_Progress)
    _GUICtrlStatusBar_EmbedControl($StatusBar, 3, $StatusBar_Progress_Handle)
    ;-----------------------------------------------------------\

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUISwitch($MainGUI)
    GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY")
    GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_FUNC")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $MainGUI)
    GUISetState(@SW_SHOW, $Page_Start)

    [/autoit] [autoit][/autoit] [autoit]

    ControlClick($MainGUI, "", "SysListView321")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Global Const $LV_START = $Page_Start
    Global Const $LV_CHANNELS = $Page_Channels
    Global Const $LV_MUSIK = $Page_Musik
    Global Const $LV_FAVORITES = $Page_Favoriten
    Global $CurrentPage = $LV_START
    Global $LastPage = $LV_START

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_DROPPED

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To UBound($gaDropFiles) - 1
    _GUICtrlStatusBar_SetText($StatusBar, "Kopiere Dateien " & $i + 1 & " von " & UBound($gaDropFiles), 0)
    If _IsFolder($gaDropFiles[$i]) Then

    [/autoit] [autoit][/autoit] [autoit]

    $Array = _GetAllAudioFiles($gaDropFiles[$i])

    [/autoit] [autoit][/autoit] [autoit]

    For $x = 1 To $Array[0]
    $Arrays = _GetExtProperty($Array[$x], -1)

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateListViewItem($Arrays[0] _
    & "|" & $Arrays[9] _
    & "|" & $Arrays[21] _
    & "|*****|" & $Arrays[22] _
    & "|" & $Arrays[1], $ListView_Musik)

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetData($StatusBar_Progress, $x * 100 / $Array[0])
    _GUICtrlListView_Scroll($ListView_Musik, "", 500)
    Next
    Else

    [/autoit] [autoit][/autoit] [autoit]

    $Arrays = _GetExtProperty($gaDropFiles[$i], -1)

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateListViewItem($Arrays[0] _
    & "|" & $Arrays[9] _
    & "|" & $Arrays[21] _
    & "|*****|" & $Arrays[22] _
    & "|" & $Arrays[1], $ListView_Musik)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    _GUICtrlListView_Scroll($ListView_Musik, "", 500)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Case $ListView_Favoriten_Menu_Item_Folder
    _GUICtrlListView_AddItem($ListView_Favoriten, "Neuer Ordner", 0)
    _GUICtrlListView_EditLabel($ListView_Favoriten, _GUICtrlListView_GetItemCount($ListView_Favoriten) - 1)

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _IsFolder($_Path)
    Local $_Handle
    $_Handle = FileOpen($_Path, 1)
    FileClose($_Handle)
    If $_Handle = -1 Then
    Return 1
    Else
    Return 0
    EndIf
    EndFunc ;==>_IsFolder

    [/autoit] [autoit][/autoit] [autoit]

    Func _WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam)
    Local $tNMHDR, $event, $hwndFrom, $code, $i_idNew, $dwFlags, $lResult, $idFrom, $i_idOld
    Local $tNMTOOLBAR, $tNMTBHOTITEM, $tInfo
    $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
    $hwndFrom = DllStructGetData($tNMHDR, "hWndFrom")
    $idFrom = DllStructGetData($tNMHDR, "IDFrom")
    $code = DllStructGetData($tNMHDR, "Code")
    Switch $hwndFrom
    Case $hToolbar
    Switch $code
    Case $NM_CLICK
    $tNMACTIVE = DllStructCreate($tagNMITEMACTIVATE, $lParam)
    $iItem = DllStructGetData($tNMACTIVE, "Index")
    If $iItem = -1 Then Return $GUI_RUNDEFMSG
    Switch _GUICtrlToolbar_CommandToIndex($hToolbar, $iItem)
    Case 0
    $LastPage = $CurrentPage
    GUISetState(@SW_SHOW, $Page_Start)
    GUISetState(@SW_HIDE, $LastPage)

    [/autoit] [autoit][/autoit] [autoit]

    Case 1
    GUISetState(@SW_HIDE, $Page_Start)
    GUISetState(@SW_SHOW, $LastPage)

    [/autoit] [autoit][/autoit] [autoit]

    Case 3

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Case 4

    [/autoit] [autoit][/autoit] [autoit]

    Case 5

    [/autoit] [autoit][/autoit] [autoit]

    Case 7

    [/autoit] [autoit][/autoit] [autoit]

    Case 8

    [/autoit] [autoit][/autoit] [autoit]

    Case 9

    [/autoit] [autoit][/autoit] [autoit]

    Case 10

    [/autoit] [autoit][/autoit] [autoit]

    Case 11

    [/autoit] [autoit][/autoit] [autoit]

    Case 12

    [/autoit] [autoit][/autoit] [autoit]

    Case 13

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    Case $TBN_HOTITEMCHANGE
    $tNMTBHOTITEM = DllStructCreate($tagNMTBHOTITEM, $lParam)
    $i_idOld = DllStructGetData($tNMTBHOTITEM, "idOld")
    $i_idNew = DllStructGetData($tNMTBHOTITEM, "idNew")
    $iItem = $i_idNew
    $dwFlags = DllStructGetData($tNMTBHOTITEM, "dwFlags")
    EndSwitch
    Case GUICtrlGetHandle($ListView_Start)
    Select
    Case $code = $NM_DBLCLK

    [/autoit] [autoit][/autoit] [autoit]

    $ListViewGetIndex = _GUICtrlListView_GetSelectionMark($ListView_Start)

    [/autoit] [autoit][/autoit] [autoit]

    If $ListViewGetIndex <> -1 Then

    [/autoit] [autoit][/autoit] [autoit]

    Switch $ListViewGetIndex
    Case 0

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $Page_Channels)
    GUISetState(@SW_HIDE, $Page_Start)
    $CurrentPage = $Page_Channels
    Case 1

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $Page_Musik)
    GUISetState(@SW_HIDE, $Page_Start)
    $CurrentPage = $Page_Musik
    Case 2

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $Page_Favoriten)
    GUISetState(@SW_HIDE, $Page_Start)
    $CurrentPage = $Page_Favoriten

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    Case GUICtrlGetHandle($ListView_Channels)
    Select
    Case $code = $NM_DBLCLK

    [/autoit] [autoit][/autoit] [autoit]

    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    Case GUICtrlGetHandle($ListView_Musik)
    Select
    Case $code = $NM_DBLCLK

    [/autoit] [autoit][/autoit] [autoit]

    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    Case GUICtrlGetHandle($ListView_Favoriten)
    Select
    Case $code = $NM_DBLCLK

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndSelect
    Switch $code
    Case $LVN_ENDLABELEDIT, $LVN_ENDLABELEDITW ; The end of label editing for an item
    $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam)
    Switch $code = $LVN_ENDLABELEDITW
    Case True
    Local $tBuffer = DllStructCreate("wchar Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
    Case False
    Local $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
    EndSwitch
    ; If Text is not empty, return True to set the item's label to the edited text, return false to reject it
    ; If Text is empty the return value is ignored
    Return StringLen(DllStructGetData($tBuffer, "Text")) > 0
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    Return $GUI_RUNDEFMSG
    EndFunc ;==>_WM_NOTIFY

    [/autoit] [autoit][/autoit] [autoit]

    Func WM_DROPFILES_FUNC($hWnd, $MsgID, $wParam, $lParam)
    Local $nSize, $pFileName
    Local $nAmt = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255)
    For $i = 0 To $nAmt[0] - 1
    $nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0)
    $nSize = $nSize[0] + 1
    $pFileName = DllStructCreate("char[" & $nSize & "]")
    DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $nSize)
    ReDim $gaDropFiles[$i + 1]
    $gaDropFiles[$i] = DllStructGetData($pFileName, 1)
    $pFileName = 0
    Next
    EndFunc ;==>WM_DROPFILES_FUNC

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _GetExtProperty($sPath, $iProp) ;Simucal ([email='Simucal@gmail.com'][/email])
    Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty
    $iExist = FileExists($sPath)
    If $iExist = 0 Then
    SetError(1)
    Return 0
    Else
    $sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1))
    $sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1)))
    $oShellApp = ObjCreate("shell.application")
    $oDir = $oShellApp.NameSpace($sDir)
    $oFile = $oDir.Parsename($sFile)
    If $iProp = -1 Then
    Local $aProperty[35]
    For $i = 0 To 34
    $aProperty[$i] = $oDir.GetDetailsOf($oFile, $i)
    Next
    Return $aProperty
    Else
    $sProperty = $oDir.GetDetailsOf($oFile, $iProp)
    If $sProperty = "" Then
    Return 0
    Else
    Return $sProperty
    EndIf
    EndIf
    EndIf
    EndFunc ;==>_GetExtProperty

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _GUIImageList_AddIconSize($hWnd, $sFile, $iSize = 32) ;Progandy
    Local $tIcon, $iResult, $hIcon
    $hIcon = _WinAPI_LoadImage(0, $sFile, $IMAGE_ICON, $iSize, $iSize, $LR_LOADFROMFILE)
    _WinAPI_Check("_GUIImageList_AddIcon", ($hIcon = 0), -1)
    $iResult = _GUIImageList_ReplaceIcon($hWnd, -1, $hIcon)
    _WinAPI_Check("_GUIImageList_AddIcon", ($iResult = -1), -2)
    _WinAPI_DestroyIcon($hIcon)
    Return $iResult
    EndFunc ;==>_GUIImageList_AddIconSize

    [/autoit] [autoit][/autoit] [autoit]

    Func _GetAllAudioFiles($i_Path)
    Local $i_Array[1], $Counter = 1
    $i_FileSearch = FileSearch($i_Path)
    $i_Split = StringSplit($i_FileSearch, @CRLF)
    For $i = 1 To $i_Split[0]
    If $i_Split[$i] <> "" Then
    Switch _FileGetType($i_Split[$i])
    Case "mp3", "wmv", "wma"
    ReDim $i_Array[1 + $Counter]
    $i_Array[$Counter] = $i_Split[$i]
    $Counter += 1
    EndSwitch
    EndIf
    Next
    $i_Array[0] = UBound($i_Array) - 1
    Return $i_Array
    EndFunc ;==>_GetAllAudioFiles

    [/autoit] [autoit][/autoit] [autoit]

    Func _FileGetType($Path)
    Local $Split1 = StringSplit($Path, "\")
    Local $Split2 = StringSplit($Split1[$Split1[0]], ".")
    Return $Split2[$Split2[0]]
    EndFunc ;==>_FileGetType

    [/autoit] [autoit][/autoit] [autoit]

    Func FileSearch($i_SearchDir, $i_Type = '*.*', $i_Sep = @CRLF, $i_LastLine = False)
    Local $i_a = '', $i_File, $i_FullFile, $i_CheckFile
    $i_SearchDir = StringReplace($i_SearchDir & '\', '\\', '\')
    Local $i_Search = FileFindFirstFile($i_SearchDir & '*.*')
    While 1
    $i_File = FileFindNextFile($i_Search)
    If $i_File = '' Then ExitLoop
    $i_FullFile = $i_SearchDir & $i_File
    $i_CheckFile = StringInStr(FileGetAttrib($i_FullFile), 'D')
    If $i_CheckFile <> 0 Then $i_a &= FileSearch($i_FullFile, $i_Type, $i_Sep, True)
    If $i_CheckFile = 0 Then
    If $i_Type = '*.*' Then $i_a &= $i_FullFile & $i_Sep
    If $i_Type <> '*.*' And StringTrimLeft($i_Type, 1) = StringRight($i_FullFile, StringLen(StringTrimLeft($i_Type, 1))) Then $i_a &= $i_FullFile & $i_Sep
    EndIf
    WEnd
    FileClose($i_Search)
    If Not $i_LastLine Then $i_a = StringTrimRight($i_a, StringLen($i_Sep))
    Return $i_a
    EndFunc ;==>FileSearch

    [/autoit]
  • Brauche kleine Hilfe beim Denken

    • DeepRed92
    • 6. September 2009 um 01:15

    Na ich hab mal wohl wieder viel zu kompliziert gedacht :pinch: . Danke für die Hilfe.

    Ach so ich habe noch eine Frage. Warum beendet sich das Script, wenn man auf den Toolbar-Button Nr.3 klickt? :huh:

  • Brauche kleine Hilfe beim Denken

    • DeepRed92
    • 5. September 2009 um 23:47

    Guten Abend,

    ich habe gerade ein kleines Problem. Ich habe eine GUI mit einer Rück- und Vorwärtstaste. Doch leider funktioniert das ganze nicht, wenn man auf eine Seite (Radiosender) geht und dann auf die Taste <--, --> und dann wieder auf <-- klickt. Es bleibt irgendwie hängen und die Startseite wird nicht aufgerufen.

    Helft mir bitte ich schaff es irgendwie nicht :wacko:

    Problem ist erst ab Zeile 216 - 228.

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Run_Au3check=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.0.0
    Author: DeepRed (AutoIt.de)

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here

    [/autoit] [autoit][/autoit] [autoit]

    #include <Includes\MessageHandler.au3>
    #include <GuiConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Constants.au3>
    #include <GuiToolBar.au3>
    #include <GuiImageList.au3>
    #include <GuiListView.au3>
    #include <Includes\ModernMenuRaw.au3>
    #include <ListViewConstants.au3>
    #include <GuiStatusBar.au3>
    #include <ProgressConstants.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Global Const $LV_START = 0x1
    Global Const $LV_CHANNELS = 0x2
    Global Const $LV_MUSIK = 0x3
    Global Const $LV_FAVORITES = 0x4

    [/autoit] [autoit][/autoit] [autoit]

    Global $Width = 712
    Global $Hight = 440
    Global $aParts[4] = [200, 300, 620, -1]
    Global $CurrentPage = $LV_START
    Global $LastPage = $LV_START

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Global Enum $item1, $item2, $item3, $item4, $item5, $item6, $item7, $item8, $item9, $item10, $item11

    [/autoit] [autoit][/autoit] [autoit]

    $MainGUI = GUICreate("Desktop Radio Music Manager (Beta)", $Width - 1, $Hight + 33, -1, -1, -1, $WS_EX_ACCEPTFILES)
    GUISetIcon(@ScriptDir & "\Img\Icons\Toolbar\Radio2.ico")

    [/autoit] [autoit][/autoit] [autoit]

    ;-----------------------------------------------------------\
    $Menu_File = GUICtrlCreateMenu("Datei")
    $Menu_Item_Exit = _GUICtrlCreateODMenuItem("Beenden", $Menu_File, "shell32.dll", -132)
    $Menu_Edit = GUICtrlCreateMenu("Bearbeiten")

    [/autoit] [autoit][/autoit] [autoit]

    $Menu_Extras = GUICtrlCreateMenu("Extras")

    [/autoit] [autoit][/autoit] [autoit]

    $Menu_Info = GUICtrlCreateMenu("Info")
    $Menu_Item_About = _GUICtrlCreateODMenuItem("Über Music Manager", $Menu_Info, @ScriptDir & "\img\Icons\Radio2.ico", 0)
    $Menu_Item_Infos = _GUICtrlCreateODMenuItem("Versionshinweise", $Menu_Info, "shell32.dll", -91)
    ;-----------------------------------------------------------/
    ;-----------------------------------------------------------\
    $hToolbar = _GUICtrlToolbar_Create($MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ImageListToolbar = _GUIImageList_Create(32, 32, 5, 3, 3)
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Previous.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Next.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\add.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Edit.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Delete.ico")

    [/autoit] [autoit][/autoit] [autoit]

    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Stop.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Play.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Pause.ico")

    [/autoit] [autoit][/autoit] [autoit]

    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Refresh.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Help.ico")
    _GUIImageList_AddIconSize($ImageListToolbar, @ScriptDir & "\Images\Icons\Toolbar\Mail.ico")
    _GUICtrlToolbar_SetImageList($hToolbar, $ImageListToolbar)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlToolbar_AddButton($hToolbar, $item1, 0)
    _GUICtrlToolbar_AddButton($hToolbar, $item2, 1)
    _GUICtrlToolbar_AddButtonSep($hToolbar)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlToolbar_AddButton($hToolbar, $item3, 2)
    _GUICtrlToolbar_AddButton($hToolbar, $item4, 3)
    _GUICtrlToolbar_AddButton($hToolbar, $item5, 4)
    _GUICtrlToolbar_AddButtonSep($hToolbar)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlToolbar_AddButton($hToolbar, $item6, 5)
    _GUICtrlToolbar_AddButton($hToolbar, $item7, 6)
    _GUICtrlToolbar_AddButton($hToolbar, $item8, 7)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlToolbar_AddButtonSep($hToolbar)
    _GUICtrlToolbar_AddButton($hToolbar, $item9, 8)
    _GUICtrlToolbar_AddButton($hToolbar, $item10, 9)
    _GUICtrlToolbar_AddButton($hToolbar, $item11, 10)

    [/autoit] [autoit][/autoit] [autoit]

    ;-----------------------------------------------------------/
    ;-----------------------------------------------------------\
    $Page_Start = GUICreate("", $Width, $Hight - 63 + 10, 0, 44, $WS_CHILD, -1, $MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Start = GUICtrlCreateListView("Navigation", 0, 0, $Width, $Hight - 63 + 10)
    GUICtrlSetStyle($ListView_Start, $LVS_ICON, $LVS_EX_DOUBLEBUFFER)
    GUICtrlSetState($ListView_Start, $GUI_DROPACCEPTED)
    _GUICtrlListView_AddItem($ListView_Start, "Radiosender", 0)
    _GUICtrlListView_AddItem($ListView_Start, "Musik", 1)
    _GUICtrlListView_AddItem($ListView_Start, "Favouriten", 2)
    $ImageListListViewStart = _GUIImageList_Create(48, 48, 5, 1)
    _GUIImageList_AddIconSize($ImageListListViewStart, @ScriptDir & "\Images\Icons\Toolbar\Radio2.ico", 48)
    _GUIImageList_AddIconSize($ImageListListViewStart, @ScriptDir & "\Images\Icons\Toolbar\MP3.ico", 48)
    _GUIImageList_AddIconSize($ImageListListViewStart, @ScriptDir & "\Images\Icons\Toolbar\Favorites.ico", 48)
    _GUICtrlListView_SetImageList($ListView_Start, $ImageListListViewStart, 0)
    ;-----------------------------------------------------------/
    ;-----------------------------------------------------------\
    $Page_Channels = GUICreate("", $Width, $Hight - 63 + 10, 0, 44, $WS_CHILD, -1, $MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Channels = GUICtrlCreateListView("Name des Senders:|Genre|Bewertung|Internetadresse:", 0, 0, $Width, $Hight - 63 + 10)
    _GUICtrlListView_SetColumnWidth($ListView_Channels, 0, 170)
    _GUICtrlListView_SetColumnWidth($ListView_Channels, 1, 100)
    _GUICtrlListView_SetColumnWidth($ListView_Channels, 2, 70)
    _GUICtrlListView_SetColumnWidth($ListView_Channels, 3, 350)
    _GUICtrlListView_RegisterSortCallBack($ListView_Channels)
    ;-----------------------------------------------------------/
    $Page_Musik = GUICreate("", $Width, $Hight - 63 + 10, 0, 44, $WS_CHILD, -1, $MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Musik = GUICtrlCreateListView("Titel|Interpret|Länge|Bewertung|Bitrate|Größe", 0, 0, $Width, $Hight - 63 + 10)
    GUICtrlSetState($ListView_Musik, $GUI_DROPACCEPTED)
    _GUICtrlListView_RegisterSortCallBack($ListView_Musik)
    ;-----------------------------------------------------------\
    ;-----------------------------------------------------------/
    $Page_Favoriten = GUICreate("", $Width, $Hight - 63 + 10, 0, 44, $WS_CHILD, -1, $MainGUI)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Favoriten = GUICtrlCreateListView("Titel|Interpret|Länge|Bewertung|Bitrate|Größe", 0, 0, $Width, $Hight - 63 + 10)
    GUICtrlSetStyle($ListView_Favoriten, $LVS_ICON + $LVS_EDITLABELS, $LVS_EX_DOUBLEBUFFER)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 0, 312)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 1, 80)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 2, 50)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 3, 70)
    _GUICtrlListView_SetColumnWidth($ListView_Favoriten, 4, 50)
    $ImageListListViewFavoriten = _GUIImageList_Create(32, 32, 5, 3, 3)
    _GUIImageList_AddIconSize($ImageListListViewFavoriten, @ScriptDir & "\Images\Icons\Toolbar\Folder.ico", 48)
    _GUICtrlListView_SetImageList($ListView_Favoriten, $ImageListListViewFavoriten, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView_Favoriten_Menu = GUICtrlCreateContextMenu($ListView_Favoriten)
    _GUICtrlCreateODMenuItem("Löschen", $ListView_Favoriten_Menu, @ScriptDir & "\Images\Icons\Toolbar\Delete.ico", 0)
    _GUICtrlCreateODMenuItem("Bearbeiten", $ListView_Favoriten_Menu, @ScriptDir & "\Images\Icons\Toolbar\Edit.ico", 0)
    $ListView_Favoriten_Menu_New = _GUICtrlCreateODMenu("Neu", $ListView_Favoriten_Menu, @ScriptDir & "\Images\Icons\Toolbar\New.ico", 0)
    $ListView_Favoriten_Menu_Item_Folder = _GUICtrlCreateODMenuItem("Ordner", _
    $ListView_Favoriten_Menu_New, @ScriptDir & "\Images\Icons\Toolbar\Folder.ico", 0)
    ;-----------------------------------------------------------\
    ;-----------------------------------------------------------/
    $StatusBar = _GUICtrlStatusBar_Create($MainGUI, $aParts)
    _GUICtrlStatusBar_SetParts($StatusBar, $aParts)
    _GUICtrlStatusBar_SetText($StatusBar, " Statusanzeige", 0)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    $StatusBar_Progress = GUICtrlCreateProgress(5, 501, 100, 17, $PBS_SMOOTH)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 7)

    [/autoit] [autoit][/autoit] [autoit]

    $StatusBar_Progress_Handle = GUICtrlGetHandle($StatusBar_Progress)
    _GUICtrlStatusBar_EmbedControl($StatusBar, 3, $StatusBar_Progress_Handle)
    ;-----------------------------------------------------------\

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUISwitch($MainGUI)
    GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $MainGUI)
    GUISetState(@SW_SHOW, $Page_Start)

    [/autoit] [autoit][/autoit] [autoit]

    ControlClick($MainGUI, "", "SysListView321")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _BackForward($_Var, $_HideShow)
    If $_HideShow = @SW_SHOW Then
    Local $i_HideShow = @SW_SHOW
    ElseIf $_HideShow = @SW_HIDE Then
    Local $i_HideShow = @SW_HIDE
    EndIf
    Switch $_Var
    Case $LV_START
    GUISetState($i_HideShow, $Page_Start)
    Case $LV_CHANNELS
    GUISetState($i_HideShow, $Page_Channels)
    Case $LV_MUSIK
    GUISetState($i_HideShow, $Page_Musik)
    Case $LV_FAVORITES
    GUISetState($i_HideShow, $Page_Favoriten)
    EndSwitch
    EndFunc ;==>_BackForward

    [/autoit] [autoit][/autoit] [autoit]

    Func _WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam)
    Local $tNMHDR, $event, $hwndFrom, $code, $i_idNew, $dwFlags, $lResult, $idFrom, $i_idOld
    Local $tNMTOOLBAR, $tNMTBHOTITEM, $tInfo
    $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
    $hwndFrom = DllStructGetData($tNMHDR, "hWndFrom")
    $idFrom = DllStructGetData($tNMHDR, "IDFrom")
    $code = DllStructGetData($tNMHDR, "Code")
    Switch $hwndFrom
    Case $hToolbar
    Switch $code
    Case $NM_CLICK
    $tNMACTIVE = DllStructCreate($tagNMITEMACTIVATE, $lParam)
    $iItem = DllStructGetData($tNMACTIVE, "Index")
    If $iItem = -1 Then Return $GUI_RUNDEFMSG
    Switch _GUICtrlToolbar_CommandToIndex($hToolbar, $iItem)
    Case 0
    GUISetState(@SW_SHOW, $Page_Start)

    [/autoit] [autoit][/autoit] [autoit]

    _BackForward($CurrentPage, @SW_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    $LastPage = $CurrentPage
    $CurrentPage = $LV_START

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Case 1

    [/autoit] [autoit][/autoit] [autoit]

    _BackForward($LastPage, @SW_SHOW)
    _BackForward($CurrentPage, @SW_HIDE)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Case 3

    [/autoit] [autoit][/autoit] [autoit]

    Case 4

    [/autoit] [autoit][/autoit] [autoit]

    Case 5

    [/autoit] [autoit][/autoit] [autoit]

    Case 7

    [/autoit] [autoit][/autoit] [autoit]

    Case 8

    [/autoit] [autoit][/autoit] [autoit]

    Case 9

    [/autoit] [autoit][/autoit] [autoit]

    Case 10

    [/autoit] [autoit][/autoit] [autoit]

    Case 11

    [/autoit] [autoit][/autoit] [autoit]

    Case 12

    [/autoit] [autoit][/autoit] [autoit]

    Case 13

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    Case $TBN_HOTITEMCHANGE
    $tNMTBHOTITEM = DllStructCreate($tagNMTBHOTITEM, $lParam)
    $i_idOld = DllStructGetData($tNMTBHOTITEM, "idOld")
    $i_idNew = DllStructGetData($tNMTBHOTITEM, "idNew")
    $iItem = $i_idNew
    $dwFlags = DllStructGetData($tNMTBHOTITEM, "dwFlags")
    EndSwitch
    Case GUICtrlGetHandle($ListView_Start)
    Select
    Case $code = $NM_DBLCLK

    [/autoit] [autoit][/autoit] [autoit]

    $ListViewGetIndex = _GUICtrlListView_GetSelectionMark($ListView_Start)

    [/autoit] [autoit][/autoit] [autoit]

    If $ListViewGetIndex <> -1 Then

    [/autoit] [autoit][/autoit] [autoit]

    Switch $ListViewGetIndex
    Case 0

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $Page_Channels)
    GUISetState(@SW_HIDE, $Page_Start)
    $CurrentPage = $LV_CHANNELS
    Case 1

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $Page_Musik)
    GUISetState(@SW_HIDE, $Page_Start)
    $CurrentPage = $LV_MUSIK
    Case 2

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $Page_Favoriten)
    GUISetState(@SW_HIDE, $Page_Start)
    $CurrentPage = $LV_FAVORITES
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    Case GUICtrlGetHandle($ListView_Channels)
    Select
    Case $code = $NM_DBLCLK

    [/autoit] [autoit][/autoit] [autoit]

    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    Case GUICtrlGetHandle($ListView_Musik)
    Select
    Case $code = $NM_DBLCLK

    [/autoit] [autoit][/autoit] [autoit]

    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    Case GUICtrlGetHandle($ListView_Favoriten)
    Select
    Case $code = $NM_DBLCLK

    [/autoit] [autoit][/autoit] [autoit]

    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    Return $GUI_RUNDEFMSG
    EndFunc ;==>_WM_NOTIFY

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _GUIImageList_AddIconSize($hWnd, $sFile, $iSize = 32)
    Local $tIcon, $iResult, $hIcon
    $hIcon = _WinAPI_LoadImage(0, $sFile, $IMAGE_ICON, $iSize, $iSize, $LR_LOADFROMFILE)
    _WinAPI_Check("_GUIImageList_AddIcon", ($hIcon = 0), -1)
    $iResult = _GUIImageList_ReplaceIcon($hWnd, -1, $hIcon)
    _WinAPI_Check("_GUIImageList_AddIcon", ($iResult = -1), -2)
    _WinAPI_DestroyIcon($hIcon)
    Return $iResult
    EndFunc ;==>_GUIImageList_AddIconSize

    [/autoit]
  • Welchen Internet Browser nutzt ihr - Umfrage ?

    • DeepRed92
    • 5. September 2009 um 17:59

    Ich teste gerade den Browser Iron. Bis jetzt klappt alles super. Es ist schnell und übersichtlich. Es gbit sogar eine Rechtschreibkontrolle ^^
    Ich würde es für Leute empfehlen, die oft Google oder Youtube benutzen, denn da merkt man erst die Geschwindigkeit gegenüber Firefox :)

  • Problem mit Last.FM RadioPlayer

    • DeepRed92
    • 4. September 2009 um 13:53

    Keiner ne Idee ?(

  • Problem mit Last.FM RadioPlayer

    • DeepRed92
    • 3. September 2009 um 22:00

    Hallo,

    ich hatte vor einiger Zeit einen Script geschrieben:

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.1.1 (beta)
    Author: myName

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here

    [/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <String.au3>
    #include <Inet.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Last.FM Player", 800, 800)
    GUIRegisterMsg($WM_ACTIVATE, "_ReDraw")
    $Label1 = GUICtrlCreateLabel("Interpret:", 8, 8, 46, 17)
    $Input1 = GUICtrlCreateInput("Rise Against", 64, 8, 121, 21)
    $Label2 = GUICtrlCreateLabel("Song:", 8, 40, 32, 17)
    $Input2 = GUICtrlCreateInput("Tip the Scales", 64, 40, 121, 21)
    $Button1 = GUICtrlCreateButton("Ok", 208, 40, 75, 25)

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("", 300, 222, 10, 70, $WS_CHILD, -1, $Form1)
    GUISetBkColor(0x000c)

    [/autoit] [autoit][/autoit] [autoit]

    $oIE = ObjCreate("Shell.Explorer.2")
    $GUIActiveX = GUICtrlCreateObj($oIE, -10, -15, 310, 237)

    [/autoit] [autoit][/autoit] [autoit]

    $oIE.navigate(@TempDir & "\Temp.html")
    $oIE.document.body.style.border = "0px"
    $oIE.document.body.scroll = "no"

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $Form1)

    [/autoit] [autoit][/autoit] [autoit]

    _user32_RedrawWindow($Form1, BitOR($RDW_ERASE, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_UPDATENOW))

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    _Anfrage()
    Case $Input2
    _Anfrage()
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Anfrage()
    GUICtrlSetState($Button1, $GUI_Disable)
    $Fopen = FileOpen(@TempDir & "\Temp.html", 2)

    [/autoit] [autoit][/autoit] [autoit]

    $Interpret = GUICtrlRead($Input1)
    $Song = GUICtrlRead($Input2)

    [/autoit] [autoit][/autoit] [autoit]

    $Source = _LastFM_Get_Player_Source(_LastFM_Generate_Url($Interpret, $Song) & "?autostart")
    If $Source <> -1 Then
    FileWrite($Fopen, $Source)
    FileClose($Fopen)
    $oIE.navigate(@TempDir & "\Temp.html")
    $oIE.document.body.style.border = "0px"
    $oIE.document.body.scroll = "no"
    Else
    MsgBox(0, "Fehler", "Musik nicht gefunden!")
    EndIf
    GUICtrlSetState($Button1, $GUI_Enable)
    EndFunc ;==>_Anfrage

    [/autoit] [autoit][/autoit] [autoit]

    Func _user32_RedrawWindow($hWnd, $Flag)
    $Ret = DllCall("User32.dll", "int", "RedrawWindow", "hwnd", $hWnd, "int", 0, "int", 0, "uint", $Flag)
    Return $Ret[0]
    EndFunc ;==>_user32_RedrawWindow

    [/autoit] [autoit][/autoit] [autoit]

    Func _LastFM_Generate_Url($LF_Interpret, $LF_Song)
    Local $LF_URL = "http://www.lastfm.de/music/" & $LF_Interpret & "/_/" & $LF_Song
    Return StringReplace($LF_URL, " ", "+")
    EndFunc ;==>_LastFM_Generate_Url

    [/autoit] [autoit][/autoit] [autoit]

    Func _LastFM_Get_Player_Source($LF_URL)
    Local $LF_Source = _INetGetSource($LF_URL), $Loop
    Local $LF_S_Bet = _StringBetween($LF_Source, '<object type="application/x-shockwave-flash"', '</object>')
    For $Loop = 0 To UBound($LF_S_Bet)
    If IsArray($LF_S_Bet) Then
    If StringInStr($LF_S_Bet[$Loop], "lfmPlayer.swf") Then
    Return '<object type="application/x-shockwave-flash"' & $LF_S_Bet[$Loop] & '</object>'
    EndIf
    EndIf
    Next
    Return -1
    EndFunc ;==>_LastFM_Get_Player_Source

    [/autoit] [autoit][/autoit] [autoit]

    Func _ReDraw($hWnd, $Msg, $wParam, $lParam)
    _user32_RedrawWindow($Form1, BitOR($RDW_ERASE, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_UPDATENOW))
    EndFunc ;==>_ReDraw

    [/autoit]

    mit der man einzelne Songs von Last.FM hören kann. Jetzt versuche ich gerade auch, diesen Playereinzufügen. Doch irgendwie wird kein Player angezeigt. Warum nicht?

    Code
    <object type="application/x-shockwave-flash" data=" http://cdn.last.fm/webclient/slideshow/11/Slideshow.swf " codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
        	id="lfmSlideshow" name="lfmSlideshow" style="visibility:hidden;"
        	width="568" height="320">
    	<param name="movie" value=" http://cdn.last.fm/webclient/slideshow/11/Slideshow.swf " />
    	<param name="flashvars" value="animation=1" />
    	<param name="allowScriptAccess" value="always" />
    	<param name="allowNetworking" value="all" />
    	<param name="allowFullScreen" value="true" />
    	<param name="quality" value="high" />
    	<param name="bgcolor" value="000" />
    	<param name="wmode" value="opaque" />
    	<param name="menu" value="true" />
    </object>
    Alles anzeigen
  • Mit GDI+ um einen Punkt Striche Zeichnen

    • DeepRed92
    • 3. September 2009 um 18:35

    Hallo,

    ich habe gerade einen Script geschrieben. Es erstellt eine GUI mit einem Punkt in der Mitte. Vom Punkt aus sollen dann Striche bis zum Rand gezogen werden und das einmal ganz rundherum.
    Doch irgendwie macht der nur 1/4 statt alles. Woran kann das genau liegen? Ich blicke da nicht mehr ganz durch :wacko:

    Code:

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.0.0
    Author: myName

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here

    [/autoit] [autoit][/autoit] [autoit]

    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $index, $hPen
    Global $x1, $y1, $x2, $y2
    Global Const $Pi = 4 * ATan(1)
    Global $radians = 180 * 2.50
    Global $x = 1024
    Global $i

    [/autoit] [autoit][/autoit] [autoit]

    $GUI_Handle = GUICreate("GDI+", 1024, 768)
    GUISetBkColor(0x000000)
    GUISetState(@SW_SHOW)
    $hWnd = WinGetHandle($GUI_Handle)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 4) ; AntiAlias

    [/autoit] [autoit][/autoit] [autoit]

    Line_Color()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Quit()

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsDrawLine($hGraphic, $x1, $y1, $x2, $y2, $hPen) ;draw line
    _GDIPlus_PenDispose($hPen)
    _Test()
    Line_Color()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $i += 1

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Sleep(10)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Test()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $x1 = 1024 / 2
    $y1 = 768 / 2
    $x2 = $i
    $y2 = 0

    [/autoit] [autoit][/autoit] [autoit]

    TrayTip("", $x2, 5, 1)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_Test

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func Line_Color() ;thanks to monoceres for the code
    Local $RedM = 1, $BlueM = 1.25, $GreenM = 1.50
    $index += 0.0075
    $color = "0x2F" & Hex(255 * ((Sin($index * $RedM) + 1) / 2), 2) & Hex(255 * ((Sin($index * $GreenM) + 1) / 2), 2) & Hex(255 * ((Sin($index * $BlueM) + 1) / 2), 2)
    $hPen = _GDIPlus_PenCreate($color)
    EndFunc ;==>Line_Color

    [/autoit] [autoit][/autoit] [autoit]

    Func Quit() ; exit program
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>Quit

    [/autoit]
  • Die Länge einer Linie anhand 2 Koordinaten herausfinden

    • DeepRed92
    • 3. September 2009 um 17:12

    Hallo,

    weiß jemand, wie ich die Länge einer Linie anhand 2 Koordinaten wie S1(5|8) S2(78|52) herausfinden kann?

  • C#-DLL in AutoIt einbinden

    • DeepRed92
    • 2. September 2009 um 22:21

    Oh das ist aber echt nett von dir. Es funktioniert. Endlich kann ich Vb.Net Dlls mit AutoIt verwenden. 1000x Danke. :rock:

    Eine Frage noch. Kann man die Dlls auch ohne Net.framework nutzen?

    Nochmal danke für dein Programm. :rock: :D

  • Labels in zufälliger X-Position erstellen Probleme

    • DeepRed92
    • 2. September 2009 um 17:19

    Ohh das sieht auch ganz gut aus. Dann versuche ich mal damit meinen Script zusammenzubasteln. Wenn ich weitere Fragen habe werde ich es dann hier posten.

    Danke für den Link ;)

  • Labels in zufälliger X-Position erstellen Probleme

    • DeepRed92
    • 2. September 2009 um 17:03

    Hallo,

    ich schreibe gerade einen Script, mit der man Feedback senden kann. Bin gerade dabei, einen Captcha dafür zu programmieren, doch irgendwie bleibt mein Script an der Schleife (siehe makierung) hängen. Ich versuche es schon die ganze Zeit, aber irgendwie...funzt es nicht. Es soll ein Array mit zufälligen Positionen erstellt werden.

    Script:

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.0.0
    Author: myName

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here

    [/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $CHECK_NUMBER = Random(1000000, 9999999, 1)
    Global $CHECK_LABELS[7]

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Form1", 474, 434)
    $Label2 = GUICtrlCreateLabel("Hier können Sie ihren Feedback an mich senden.", 8, 8, 238, 17)
    $Label1 = GUICtrlCreateLabel("Name:", 8, 40, 35, 17)
    $Input1 = GUICtrlCreateInput("", 48, 32, 417, 21)
    $Label3 = GUICtrlCreateLabel("Email:", 8, 64, 32, 17)
    $Input2 = GUICtrlCreateInput("", 48, 56, 417, 21)
    $Label4 = GUICtrlCreateLabel("Betreff:", 8, 88, 38, 17)
    $Input3 = GUICtrlCreateInput("", 48, 80, 417, 21)
    $Edit1 = GUICtrlCreateEdit("", 48, 104, 417, 209)
    GUICtrlSetData(-1, "Edit1")
    $Label5 = GUICtrlCreateLabel("Alle Informationen, die Sie hier angeben, werden nicht Veröffentlicht oder weitergegeben.", 8, 320, 423, 17)
    $Button1 = GUICtrlCreateButton("Feedback senden", 8, 400, 107, 25, $WS_GROUP)
    $Label7 = GUICtrlCreateLabel("Geben Sie bitte die Zahl ein:", 8, 376, 138, 17)
    $Input4 = GUICtrlCreateInput("", 152, 376, 121, 21)

    [/autoit] [autoit][/autoit] [autoit]

    $Code = _GenLabelCode()

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button1

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _GenLabelCode($Stellen = 7)
    Local $Positions[$Stellen]
    ;Geordnete Positionen
    For $i = 0 To $Stellen - 1
    $Positions[$i] = 8 + ($i + 1) * 13
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Local $RandomPositions[$Stellen]
    Local $Random[$Stellen]
    Local $Numbers

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;Problemzone

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $Stellen - 1
    $Ran = Random(0, $Stellen -1, 1)
    If Not _Search($Random, $Ran) Then
    $RandomPositions[$i] = $Positions[$Ran]
    $Random[$i] = $Ran
    Else
    $i -= 1
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    _ArrayDisplay($Random)

    [/autoit] [autoit][/autoit] [autoit]

    Exit

    [/autoit] [autoit][/autoit] [autoit]

    ;Problemzone ende

    [/autoit] [autoit][/autoit] [autoit]

    Local $Split = StringSplit($CHECK_NUMBER, "")
    Local $String = ""
    Local $Counter = 0
    For $i = 1 To 7
    $Ran = Random(1, 7, 1)
    If Not StringInStr($String, $Ran) Then
    $CHECK_LABELS[$i - 1] = GUICtrlCreateLabel($Ran, $RandomPositions[$Counter], 344, 15, 26)
    GUICtrlSetFont(-1, 14, 800, 0, "Arial")
    $String &= $Ran
    $Counter += 1
    Else
    $i -= 1
    EndIf
    Next
    $Split = ""
    Return $String
    EndFunc ;==>_GenLabelCode

    [/autoit] [autoit][/autoit] [autoit]

    Func _Search($i_a, $i_Str)
    For $a = 0 To UBound($i_a) - 1
    If $i_a[$a] = $i_Str Then Return 1
    Next
    Return 0
    EndFunc ;==>_Search

    [/autoit]

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™