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. Xenobiologist

Beiträge von Xenobiologist

  • Befehl 'GuiCtrlCreateDate' mit '$DTS_SHOWNONE'

    • Xenobiologist
    • 29. September 2007 um 17:12

    Hi,

    abwarten was bei den neuen UDFs stehen wird.

    P.S.: Ich habe auch etwas suchen müssen, habe dieses Date+CheckboxControl noch nie benutzt :D

    So long,

    Mega

  • hotkeys an minimiertes fenster senden...

    • Xenobiologist
    • 29. September 2007 um 17:11

    Hi,

    was soll es denn konkret werden? Wieso geht es nicht mit ControlSend?

    So long,

    Mega

  • neu auf dem gebiet

    • Xenobiologist
    • 29. September 2007 um 10:32

    HI,

    sieht aber nicht falsch aus. Beschreib doch mal in Worten was du machen willst.

    So long,

    Mega

  • OrganizeIncludes

    • Xenobiologist
    • 28. September 2007 um 22:38

    Hi,

    okay. Am besten abwarten. Ich melde mich, wenn Autoit gefixt ist und es wieder geht.

    So long,

    Mega

  • OrganizeIncludes

    • Xenobiologist
    • 28. September 2007 um 22:24

    Hi,

    wenn du die Zeilen in diese änderst sollte es erstmal wieder gehen

    [autoit]

    ;$Source = ControlGetText('classname=SciTEWindow', '', 350)
    ;MsgBox(0,"", $Source)
    $Source = FileRead(FileOpen(StringLeft(WinGetTitle(''), StringInStr(WinGetTitle(''), '.au3') + 3), 0))

    [/autoit]

    So long,

    Mega

  • OrganizeIncludes

    • Xenobiologist
    • 28. September 2007 um 22:14

    Hi,

    okay. Habe Scite jetzt neuinstalliert und kann dein Problem nun nachstellen.

    Es liegt wieder am ControlGetText.

    Siehe hier:

    Spoiler anzeigen
    [autoit]

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.2.7.0
    ; Author: Thorsten Meger
    ;
    ; Script Function:
    ; Organize Includes Version 2.7
    ;
    ; ----------------------------------------------------------------------------
    ;Opt("TrayIconDebug", 1)
    ;[Includes]
    #include<Array.au3>
    #include<File.au3>
    #include<GuiListView.au3>
    #include<GuiStatusBar.au3>
    #include<GUIConstants.au3>
    Global $start_T = TimerInit()
    #cs
    * Prüfung, dass ein File sich nicht selbst includen darf! - DONE
    * Prüfung der includes in den include files! - TODO
    * RegExp Prüfung auf Wortgrenze beschränken bei Funktionen - DONE
    * Auskommentierungsmöglichkeit für includes (wird analysiert aber nicht gelöscht) - DONE
    * Constants.au3 mit aufnehmen für RUN Befehle - DONE
    * Möglichkeit zusätzliche UDF Pfade anzugeben - DONE
    * Refresh Möglichkeit - DONE
    * GUI Include Pathes füllen und leeren können - TODO
    #ce

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

    ; ScriptVersion
    Global $scriptVersion = 'Version 2.7'
    ; NormalVersion
    Global $InstallPath = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir')
    Global $InstallVersion = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'Version')
    ; BetaVersion
    Global $betaInstallPath = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir')
    Global $betaInstallVersion = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'betaVersion')

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

    ; Variables
    Dim $includesPath[1]
    If $InstallPath <> '' Then _ArrayAdd($includesPath, $InstallPath & '\Include\')
    If $betaInstallPath <> '' Then _ArrayAdd($includesPath, $betaInstallPath & '\Include\')
    Global $includesIni = @ScriptDir & '\includes.ini'
    Global $Source = '', $exit_B = 0, $organize_B = 0, $openIni_B = 0, $autoitVersion_I = 0, $betaVersion_I = 0, $filename_I = 0
    Global $includes_LV = 0, $FileName = '', $GUI = 0, $status_SB = 0, $checkIncludes_B = 0, $ToBeIncluded[1], $B_DESCENDING = 0
    Global $deleteIncludes_CB = 0, $copyToClipBoard_CB = 0, $delAll_R = 0, $delUnneeded_R = 0, $delNothing_R = 0, $keyword_I = 0
    Global $placeAfterKeyWord_R = 0, $placeAtTop_R = 0, $green_A[1], $yellow_A[1], $red_A[1], $LV = 0, $count = 0, $silentMode_CB = 0
    Global $parts_SB[3] = [80, 526, -1], $silentMode = True, $renewIni_B = 0, $addIncludePath_B = 0, $delIncludePath_B = 0, $restart_B = 0
    Global $autoRestart_CB = 0, $udf_LV = 0
    Global $text_SB[3] = [@TAB & $scriptVersion, @TAB & 'Organize includes', '']
    Global $status_A[4] = ['correctly included', 'needed include', 'not needed', 'include itself?']
    ; Read the seetings from the ini file
    Global $neededAndIncluded = IniRead($includesIni, 'Options', 'Green', '0x80FF80')
    Global $neededNotIncluded = IniRead($includesIni, 'Options', 'Yellow', '0xFFFF80')
    Global $notNeededButIncluded = IniRead($includesIni, 'Options', 'Red', '0xEF3D4A')
    Global $selfInclude = IniRead($includesIni, 'Options', 'Selfinclude', '0x0000F9')
    Global $keyword = IniRead($includesIni, 'Options', 'Keyword', ';[Includes]')

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

    ; Operating sequence
    _createGUI()
    _start()
    GUICtrlSetData($autoitVersion_I, $InstallVersion)
    GUICtrlSetData($betaVersion_I, $betaInstallVersion)

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

    ; Setting silent off when 1 parameter = silentOff
    ; Silent mode = no GUI and organize includes automatically with settings from ini file
    If $cmdLine[0] > 0 And $cmdLine[1] = 'silentOff' Then $silentMode = False
    If GUICtrlRead($silentMode_CB) = $GUI_UNCHECKED Or $silentMode = False Then
    GUISetState(@SW_SHOW)
    Else
    _organize()
    Exit (0)
    EndIf

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

    _GUICtrlStatusBarSetText($status_SB, @TAB & Round(TimerDiff($start_T)/1000, 4) & ' sec', 2)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit (0)
    Case $exit_B
    _exit()
    Exit (0)
    Case $organize_B
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Script started ... organizing includes ... ', 1)
    _organize()
    If GUICtrlRead($autoRestart_CB) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'AutoRestart', 1)
    _restart()
    Else
    IniWrite($includesIni, 'Options', 'AutoRestart', 0)
    EndIf
    Case $openIni_B
    If FileExists($includesIni) Then
    ShellExecute($includesIni)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'includes.ini opened', 1)
    Else
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'No ini file found', 1)
    Sleep(1000)
    $re = MsgBox(36, 'Create new ini file', 'Do you want to create a new ini file?', 15)
    If $re = -1 Or $re = 7 Then
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'No ini file available', 1)
    ElseIf $re = 6 Then
    _prepareOrganizeIncludes()
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'New ini file created', 1)
    Sleep(2000)
    If FileExists($includesIni) Then ShellExecute($includesIni)
    EndIf
    EndIf
    Case $renewIni_B
    _renewIni()
    Case $placeAfterKeyWord_R
    GUICtrlSetState($keyword_I, $GUI_SHOW)
    GUICtrlSetState($keyword_I, $GUI_FOCUS)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Enter your keyword ...', 1)
    Case $placeAtTop_R
    GUICtrlSetState($keyword_I, $GUI_HIDE)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Includes will be placed at top of your script', 1)
    Case $copyToClipBoard_CB
    If GUICtrlRead($copyToClipBoard_CB) = $GUI_CHECKED Then
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Copying includes to clipboard activated', 1)
    Else
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Copying includes to clipboard deactivated', 1)
    EndIf
    Case $includes_LV
    _sortLV()
    Case $delAll_R
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'All includes will be removed', 1)
    Case $delUnneeded_R
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Only the not needed includes will be removed', 1)
    Case $delNothing_R
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'No includes will be removed', 1)
    Case $addIncludePath_B
    $path = FileSelectFolder('Choose a folder where "Organize includes" looks for your udfs', '\', 6, StringLeft(@ScriptDir, 3))
    If $path <> '' Then
    _GUICtrlStatusBarSetText($status_SB, @TAB & $path & ' added to include pathes', 1)
    IniWrite($includesIni, 'IncludePath', $path, '')
    Else
    _GUICtrlStatusBarSetText($status_SB, @TAB & $path & ' Cancel - no paths added', 1)
    EndIf
    _renewIni()
    GUICtrlCreateListViewItem($path & '\', $udf_LV)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Ini-Update ready ...', 1)
    Case $delIncludePath_B
    If IniDelete($includesIni, 'IncludePath') Then _GUICtrlStatusBarSetText($status_SB, @TAB & 'Include pathes deleted', 1)
    _renewIni()
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Ini-Update ready ...', 1)
    Case $restart_B
    _restart()
    Case $silentMode_CB
    If GUICtrlRead($silentMode_CB) = $GUI_CHECKED Then
    GUICtrlSetState($autoRestart_CB, $GUI_DISABLE)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Silent Mode activated', 1)
    Else
    GUICtrlSetState($autoRestart_CB, $GUI_ENABLE)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Silent Mode deactivated', 1)
    EndIf
    EndSwitch
    WEnd

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

    ; Start func gets the source and calls all other needed funcs.
    Func _start()
    If Not ProcessExists('SciTE.exe') Then Exit (0)
    Opt('WinTitleMatchMode', 4)
    WinActivate('classname=SciTEWindow')
    WinWaitActive('classname=SciTEWindow')
    $FileName = StringSplit(WinGetTitle(''), '\')
    GUICtrlSetData($filename_I, StringLeft($FileName[UBound($FileName) - 1], StringInStr($FileName[UBound($FileName) - 1], '.au3') + 3))
    $Source = ControlGetText('classname=SciTEWindow', '', 350)
    MsgBox(0,"", $Source)
    ;$Source = FileRead(FileOpen(StringLeft(WinGetTitle(''), StringInStr(WinGetTitle(''), '.au3') + 3), 0))
    If Not FileExists($includesIni) Then
    _prepareOrganizeIncludes()
    _setOptions()
    EndIf
    $ToBeIncluded = getIncludes()
    _ArraySort($ToBeIncluded)
    $re = setIncludes($ToBeIncluded)
    ;_selfInclude()
    If $re = -2 Then _GUICtrlStatusBarSetText($status_SB, @TAB & 'No includes needed!', 1)
    _setUDFs()
    EndFunc ;==>_start

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

    ; Starting action (delete and/or insert)
    Func _organize()
    Local $sourceLine_A = StringSplit($Source, @CR)
    $sourceLine_A = _deleteIncludes($sourceLine_A)
    $sourceLine_A = _insertIncludes($sourceLine_A)
    ControlSetText('classname=SciTEWindow', '', 'Scintilla1', _ArrayToString($sourceLine_A, @CR, 1))
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Includes inserted', 1)
    EndFunc ;==>_organize

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

    ; Insert includes into array of code lines
    Func _insertIncludes($sourceLine_A)
    Local $includes = ''
    If GUICtrlRead($delAll_R) = $GUI_CHECKED Then $includes = _ArrayToString($green_A, @CR, 1)
    $includes &= @CR & _ArrayToString($yellow_A, @CR, 1)
    If StringLeft($includes, 1) = @CR Then $includes = StringTrimLeft($includes, 1)
    If StringRight($includes, 1) = @CR Then $includes = StringTrimRight($includes, 1)
    If Not $includes <> '' Then Return $sourceLine_A

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

    If GUICtrlRead($placeAfterKeyWord_R) = $GUI_CHECKED Then
    Local $keyword = GUICtrlRead($keyword_I)
    For $i = 0 To UBound($sourceLine_A) - 1
    If StringInStr($sourceLine_A[$i], $keyword, 2) Then
    _ArrayInsert($sourceLine_A, $i + 1, $includes)
    ExitLoop
    EndIf
    Next
    Else
    _ArrayInsert($sourceLine_A, 1, $includes)
    EndIf
    If GUICtrlRead($copyToClipBoard_CB) = $GUI_CHECKED Then
    ClipPut('')
    ClipPut($includes)
    EndIf
    Return $sourceLine_A
    EndFunc ;==>_insertIncludes

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

    ; Delete includes from array of code lines
    Func _deleteIncludes($sourceLine_A)
    If GUICtrlRead($delAll_R) = $GUI_CHECKED Then
    For $i = UBound($sourceLine_A) - 1 To 1 Step - 1
    ; Wenn ';' include dann lasse die Zeile aus
    If StringRegExp($sourceLine_A[$i], '(?i)#include[ ]*<[ ]*(.*?\.au3)[ ]*>' , 0) = 1 And _
    StringRegExp($sourceLine_A[$i], '(?i);.*[ ]*#include[ ]*<', 0) = 0 Then
    _ArrayDelete($sourceLine_A, $i)
    EndIf
    Next
    ElseIf GUICtrlRead($delUnneeded_R) = $GUI_CHECKED Then
    For $ii = 1 To UBound($red_A) - 1
    For $i = UBound($sourceLine_A) - 1 To 1 Step - 1
    If StringRegExp($sourceLine_A[$i], '(?i)#include[ ]*<[ ]*(.*?' & $red_A[$ii] & ')[ ]*>', 0) = 1 And _
    StringRegExp($sourceLine_A[$i], '(?i);.*[ ]*#include[ ]*<', 0) = 0 Then
    _ArrayDelete($sourceLine_A, $i)
    EndIf
    Next
    Next
    EndIf
    Return $sourceLine_A
    EndFunc ;==>_deleteIncludes

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

    Func setIncludes($ToBeIncluded)
    If Not IsArray($ToBeIncluded) Then Return -1
    _GUICtrlListViewSetItemCount($includes_LV, UBound($ToBeIncluded))
    Dim $LV[150]
    ; Create a row for every include and set bk to green
    For $i = 1 To UBound($ToBeIncluded) - 1
    $LV[$count] = GUICtrlCreateListViewItem('#include<' & $ToBeIncluded[$i] & '>' & '|' & $status_A[0] , $includes_LV)
    GUICtrlSetBkColor(-1, $neededAndIncluded)
    $count += 1
    ; Is the needed include not in source code then change bk to yellow and delete entry from green array
    If StringRegExp($Source,'(?i)#include[ ]*<[ ]*' & $ToBeIncluded[$i] &'[ ]*>', 0) = 0 Or _
    StringRegExp($Source,'(?i);[ ]*#include[ ]*<[ ]*' & $ToBeIncluded[$i] &'[ ]*>', 0) = 1 Then
    _GUICtrlListViewSetItemText($includes_LV, $i - 1, 1, $status_A[1])
    GUICtrlSetBkColor(-1, $neededNotIncluded)
    _ArrayAdd($yellow_A, $ToBeIncluded[$i])
    _ArrayDelete($green_A, _ArraySearch($green_A, $ToBeIncluded[$i]))
    EndIf
    Next
    ; Find all includes in source code. Bk to red if they are not needed
    $alreadyIncluded = StringRegExp($Source,'(?i)#include[ ]*<[ ]*(.*?\.au3)[ ]*>', 3)
    If Not @error Then
    For $i = 0 To UBound($alreadyIncluded) - 1
    If _ArraySearch($ToBeIncluded, $alreadyIncluded[$i]) = -1 Then
    $LV[$count] = GUICtrlCreateListViewItem('#include<' & $alreadyIncluded[$i] & '>' & '|' & $status_A[2], $includes_LV)
    GUICtrlSetBkColor(-1, $notNeededButIncluded)
    $count += 1
    _ArrayAdd($red_A, $alreadyIncluded[$i])
    EndIf
    Next
    EndIf
    For $i = 1 To UBound($green_A) - 1
    $green_A[$i] = '#include<' & $green_A[$i] & '>'
    Next
    For $i = 1 To UBound($yellow_A) - 1
    $yellow_A[$i] = '#include<' & $yellow_A[$i] & '>'
    Next
    If UBound($ToBeIncluded) = 1 Then Return -2
    EndFunc ;==>setIncludes

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

    ; If version number (normal and beta) changed or ini file doesn't exist then create a new one with _prepareOrganizeIncludes()
    ; Search for needed includes
    Func getIncludes()
    If Not FileExists($includesIni) Or (IniRead($includesIni, 'Version', 'beta', 'Error') <> $betaInstallVersion) Or _
    (IniRead($includesIni, 'Version', 'Normal', 'Error') <> $InstallVersion) Then _prepareOrganizeIncludes()
    ;Local $iniContent = IniReadSection($includesIni, 'Functions')
    ;If @error Then MsgBox(4096, '', 'Error occurred, probably no ini file.')
    ;_ArrayDisplay($iniContent)

    ; ############################## INIReadSection ########################## ausbauen oder die Erweiterung abwarten!!!!

    Local $lines_A
    If Not _FileReadToArray($includesIni, $lines_A) Then
    MsgBox(4096, '', 'Error occurred, probably no ini file.')
    Exit
    EndIf

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

    Local $iniContent[1][2]
    Local $count = 1
    For $i = 1 To $lines_A[0] - 1
    If StringInStr($lines_A[$i], '.au3') Then
    $re = StringSplit($lines_A[$i], '=')
    ReDim $iniContent[$count + 1][2]
    $iniContent[$count][0] = $re[1]
    $iniContent[$count][1] = $re[2]
    $count += 1
    EndIf
    Next
    $iniContent[0][0] = UBound($iniContent) - 1

    Local $Constants_A[3] = ['$STDIN_CHILD', '$STDOUT_CHILD', '$STDERR_CHILD']

    For $i = 1 To $iniContent[0][0]
    Local $functionsInAU3 = StringSplit($iniContent[$i][1], ';')
    If @error Then
    If StringRegExp($Source, '(?i)' & $iniContent[$i][0] & '([ ]+|\()', 0) = 1 Then
    _ArrayAdd($ToBeIncluded, $iniContent[$i][0])
    ExitLoop
    EndIf
    EndIf
    For $ii = 1 To UBound($functionsInAU3) - 1
    If StringRegExp($Source, '(?i)\b' & $functionsInAU3[$ii] & '\b([ ]+|\()', 0) = 1 Then
    _ArrayAdd($ToBeIncluded, $iniContent[$i][0])
    ExitLoop
    EndIf
    Next
    Next
    For $iii = 1 To UBound($Constants_A) - 1
    If StringRegExp($Source, '(?i)\' & $Constants_A[$iii], 0) = 1 And _
    StringRegExp($Source, "(?i)'\" & $Constants_A[$iii] & "'", 0) = 0 Then
    _ArrayAdd($ToBeIncluded, 'Constants.au3')
    ExitLoop
    EndIf
    Next
    $green_A = $ToBeIncluded
    Return $ToBeIncluded
    EndFunc ;==>getIncludes

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

    Func _setOptions()
    ; Version info
    IniWrite($includesIni, 'Version', 'Beta', $betaInstallVersion)
    IniWrite($includesIni, 'Version', 'Normal', $InstallVersion)
    ; Options
    IniWrite($includesIni, 'Options', 'Green', '0x80FF80')
    IniWrite($includesIni, 'Options', 'Yellow', '0xFFFF80')
    IniWrite($includesIni, 'Options', 'Red', '0xEF3D4A')
    IniWrite($includesIni, 'Options', 'Selfinclude', '0x0000F9')
    IniWrite($includesIni, 'Options', 'Keyword', ';[Includes]')
    IniWrite($includesIni, 'Options', 'CopyToCliP', 0)
    IniWrite($includesIni, 'Options', 'Del', 0)
    IniWrite($includesIni, 'Options', 'Place', 0)
    IniWrite($includesIni, 'Options', 'SilentMode', 0)
    IniWrite($includesIni, 'Options', 'AutoRestart', 1)
    IniWrite($includesIni, 'Options', 'Created', @YEAR & '/' & @MON & '/' & @MDAY & ' - ' & @HOUR & ':' & @MIN & ':' & @SEC)
    EndFunc ;==>_setOptions

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

    ; Create new includes.ini with funcs and seetings/options
    Func _prepareOrganizeIncludes()
    ; Includes
    For $ii = 0 To UBound($includesPath) - 1
    $FileList = _FileListToArray($includesPath[$ii], '*.au3', 1)
    If @error = 1 Then ContinueLoop

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

    For $i = 1 To UBound($FileList) - 1
    $functions = StringRegExp(FileRead(FileOpen($includesPath[$ii] & $FileList[$i], 0)), '(?<=Func )[0-9a-zA-Z_]+[ ]{0,}(?=\()', 3)
    If IsArray($functions) And UBound($functions) > 1 Then
    IniWrite($includesIni, 'Functions', $FileList[$i], _ArrayToString($functions, ';'))
    ElseIf IsArray($functions) Then
    IniWrite($includesIni, 'Functions', $FileList[$i], $functions[0])
    EndIf
    Next
    IniWrite($includesIni, 'Functions', 'GUIConstants.au3', 'GUICreate;GUIGetMsg')
    Next
    IniWrite($includesIni, 'Options', 'Created', @YEAR & '/' & @MON & '/' & @MDAY & ' - ' & @HOUR & ':' & @MIN & ':' & @SEC)
    EndFunc ;==>_prepareOrganizeIncludes

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

    ; Create the GUI
    Func _createGUI()
    $GUI = GUICreate('Organize includes for AutoIt by Xenobiologist', 606, 546, 196, 50, $WS_SYSMENU)
    GUICtrlCreateGroup('', 8, 88, 585, 249 + 119)
    $includes_LV = GUICtrlCreateListView('Includes|Status', 24, 112, 553, 201)
    GUICtrlSendMsg($includes_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
    GUICtrlSendMsg($includes_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
    Global $B_DESCENDING[_GUICtrlListViewGetSubItemsCount($includes_LV) ]
    GUICtrlSetFont($includes_LV, 10, 600, '', 'Trebuchet MS')
    _GUICtrlListViewSetColumnWidth($includes_LV, 0, 400)
    _GUICtrlListViewSetColumnWidth($includes_LV, 1, $LVSCW_AUTOSIZE_USEHEADER)
    GUICtrlCreateGroup('', -99, -99, 1, 1)

    $udf_LV = GUICtrlCreateListView('UDF Path', 24, 336, 553, 101)
    GUICtrlSendMsg($udf_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
    GUICtrlSendMsg($udf_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
    GUICtrlSendMsg($udf_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_CHECKBOXES, $LVS_EX_CHECKBOXES)
    _GUICtrlListViewSetColumnWidth($udf_LV, 0, $LVSCW_AUTOSIZE_USEHEADER)

    GUICtrlCreateLabel('Autoit', 8, 16, 100, 21, $SS_SUNKEN)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 700)
    GUICtrlCreateLabel('Autoit Beta', 8, 40, 100, 21, $SS_SUNKEN)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 700)
    GUICtrlCreateLabel('Filename', 8, 64, 100, 21, $SS_SUNKEN)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 700)
    $filename_I = GUICtrlCreateInput('', 112, 64, 481, 21)
    $betaVersion_I = GUICtrlCreateInput('', 112, 40, 81, 21)
    $autoitVersion_I = GUICtrlCreateInput('', 112, 16, 81, 21)
    $organize_B = GUICtrlCreateButton('Organize includes', 8, 462, 187, 25, 0)
    GUICtrlSetTip(-1, 'Start organize includes', 'Start script', 1, 1)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 600)

    $openIni_B = GUICtrlCreateButton('Open ini', 200, 462, 100, 25, 0)
    GUICtrlSetTip(-1, 'Options and settings for the "Organize Includes" script', 'Open ini file', 1, 1)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 600)

    $renewIni_B = GUICtrlCreateButton('Renew ini', 303, 462, 100, 25, 0)
    GUICtrlSetTip(-1, 'New scan for funcs in include folders', 'Renew ini file', 1, 1)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 600)

    $exit_B = GUICtrlCreateButton('Exit', 408, 462, 187, 25, 0)
    GUICtrlSetTip(-1, 'Exit' & @TAB & @TAB & @TAB & '- settings will be saved' & @CRLF & _
    'Exit without saving' & @TAB & '- by leaving with the cross', 'Exit script', 1, 1)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 600)
    $status_SB = _GUICtrlStatusBarCreate($GUI, $parts_SB, $text_SB)
    GUIStartGroup()
    $delAll_R = GUICtrlCreateRadio('Remove all', 210, 16, 120, 15)
    GUICtrlSetTip(-1, 'Remove all' & @TAB & @TAB & ' - remove all includes of your script' & @CRLF & _
    'Remove unneeded ' & @TAB & ' - remove all not needed includes of your script' & @CRLF & _
    'Remove nothing ' & @TAB & ' - do not remove includes of your script', 'Remove includes', 1, 1)
    $delUnneeded_R = GUICtrlCreateRadio('Remove unneeded', 210, 32, 120, 15)
    $delNothing_R = GUICtrlCreateRadio('Remove nothing', 210, 48, 120, 15)
    GUIStartGroup()

    Switch IniRead($includesIni, 'Options', 'Del', '0')
    Case 0
    GUICtrlSetState($delAll_R, $GUI_CHECKED)
    Case 1
    GUICtrlSetState($delUnneeded_R, $GUI_CHECKED)
    Case 2
    GUICtrlSetState($delNothing_R, $GUI_CHECKED)
    EndSwitch

    GUIStartGroup()
    $placeAfterKeyWord_R = GUICtrlCreateRadio('Place after keyword', 355, 16, 120, 15)
    GUICtrlSetTip(-1, 'Insert the inculdes at top of your script or' & @CRLF & _
    'place the includes after a special keyword.', 'Insert includes', 1, 1)
    $placeAtTop_R = GUICtrlCreateRadio('Place at top', 355, 32, 120, 15)
    GUIStartGroup()

    $keyword_I = GUICtrlCreateInput(IniRead($includesIni, 'Options', 'Keyword', ';[includes]'), 480, 10, 113, 21)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 9.5, 800)
    GUICtrlSetTip(-1, 'Keyword to search for. Includes are placed after this line.', 'Keyword', 1, 1)
    If IniRead($includesIni, 'Options', 'Place', '0') = 1 Then
    GUICtrlSetState($placeAtTop_R, $GUI_CHECKED)
    GUICtrlSetState($keyword_I, $GUI_HIDE)
    Else
    GUICtrlSetState($placeAfterKeyWord_R, $GUI_CHECKED)
    GUICtrlSetState($keyword_I, $GUI_SHOW)
    EndIf

    $copyToClipBoard_CB = GUICtrlCreateCheckbox('Copy to clipboard', 355, 48, 120, 15)
    GUICtrlSetTip(-1, 'Copy the includes to clipboard.', 'Copy to clipboard', 1, 1)
    If IniRead($includesIni, 'Options', 'CopyToClip', '0') = 1 Then GUICtrlSetState($copyToClipBoard_CB, $GUI_CHECKED)

    $autoRestart_CB = GUICtrlCreateCheckbox('AutoRestart', 480, 32, 120, 15)
    GUICtrlSetTip(-1, 'AutoRestart ' & @TAB & '- Automatically restarts script after pressing organize includes button', 'AutoRestart', 1, 1)
    If IniRead($includesIni, 'Options', 'AutoRestart', '0') = 1 Then GUICtrlSetState($autoRestart_CB, $GUI_CHECKED)

    $silentMode_CB = GUICtrlCreateCheckbox('Silent Mode', 480, 48, 120, 15)
    GUICtrlSetTip(-1, 'Checked ' & @TAB & '- Next start will do an oragnize includes without GUI.' & @CRLF & _
    'Once checked and restarted you can only deacitvate silent mode by changend value in the ini to SilentMode=0 or ' & @CRLF & _
    'by starting the script with parameter silentOff.', 'Silent Mode', 1, 1)
    If IniRead($includesIni, 'Options', 'SilentMode', '0') = 1 Then GUICtrlSetState($silentMode_CB, $GUI_CHECKED)

    $addIncludePath_B = GUICtrlCreateButton('Add include path', 24, 315, 181, 19)
    GUICtrlSetTip(-1, ' You can add pathes to your udf folder. After adding you need to restart the script.', 'Add include path', 1, 1)
    $delIncludePath_B = GUICtrlCreateButton('Del include path', 210, 315, 181, 19)
    GUICtrlSetTip(-1, ' Will delete all added include pathes. After deleting you need to restart the script.', 'Del include path', 1, 1)
    $restart_B = GUICtrlCreateButton('Restart/Refresh', 396, 315, 181, 19)
    GUICtrlSetTip(-1, 'Restarts "organize includes". Behaves like a refresh.', 'Restart/Refresh', 1, 1)
    EndFunc ;==>_createGUI

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

    ; Save seetings before exit
    Func _exit()
    If GUICtrlRead($placeAfterKeyWord_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Keyword', GUICtrlRead($keyword_I))
    EndIf
    If GUICtrlRead($copyToClipBoard_CB) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'CopyToClip', 1)
    Else
    IniWrite($includesIni, 'Options', 'CopyToClip', 0)
    EndIf

    If GUICtrlRead($delAll_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Del', 0)
    ElseIf GUICtrlRead($delUnneeded_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Del', 1)
    ElseIf GUICtrlRead($delNothing_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Del', 2)
    EndIf

    If GUICtrlRead($placeAfterKeyWord_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Place', 0)
    Else
    IniWrite($includesIni, 'Options', 'Place', 1)
    EndIf

    If GUICtrlRead($silentMode_CB) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'SilentMode', 1)
    Else
    IniWrite($includesIni, 'Options', 'SilentMode', 0)
    EndIf

    If GUICtrlRead($autoRestart_CB) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'AutoRestart', 1)
    Else
    IniWrite($includesIni, 'Options', 'AutoRestart', 0)
    EndIf
    EndFunc ;==>_exit

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

    ; Sort the listview items
    Func _sortLV()
    _GUICtrlListViewSort($includes_LV, $B_DESCENDING, GUICtrlGetState($includes_LV))
    For $i = 0 To $count - 1
    Switch _GUICtrlListViewGetItemText($includes_LV, $i, 1)
    Case $status_A[0]
    GUICtrlSetBkColor($LV[$i], $neededAndIncluded)
    Case $status_A[1]
    GUICtrlSetBkColor($LV[$i], $neededNotIncluded)
    Case $status_A[2]
    GUICtrlSetBkColor($LV[$i], $notNeededButIncluded)
    EndSwitch
    Next
    EndFunc ;==>_sortLV

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

    Func _selfInclude()
    For $i = 0 To $count - 1
    If _GUICtrlListViewGetItemText($includes_LV, $i, 0) = '#include<'&GUICtrlRead($filename_I)&'>' Then
    _GUICtrlListViewSetItemText($includes_LV, $i, 1, $status_A[3])
    If StringRegExp($Source, '(?i)#include[ ]*<[ ]*'&GUICtrlRead($filename_I)&'[ ]*>', 0) = 1 Then
    _ArrayAdd($red_A, '#include<'&GUICtrlRead($filename_I)&'>')
    Local $re = _ArraySearch($green_A, '#include<'&GUICtrlRead($filename_I)&'>')
    If $re <> -1 Then _ArrayDelete($green_A, $re)
    GUICtrlSetBkColor($LV[$i], $selfInclude)
    Else
    ; Wenn nicht im Source, dann löschen aus ListView
    _GUICtrlListViewDeleteItem($includes_LV, $i)
    EndIf
    EndIf
    Next
    EndFunc ;==>_selfInclude

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

    Func _restart()
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Script is restarting ...', 1)
    Run('"' & @AutoItExe & '" ' & '/AutoIt3ExecuteScript "' & @ScriptFullPath & '" ' & @AutoItPID, '', @SW_HIDE)
    Exit (0)
    EndFunc ;==>_restart

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

    Func _renewIni()
    ConsoleWrite('_renewIni() ' & @CRLF)
    If IniDelete($includesIni, 'Functions') Then
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Funcs in includes.ini deleted', 1)
    $includePathSection = IniReadSection($includesIni, 'IncludePath')
    If Not @error Then
    For $i = 1 To $includePathSection[0][0]
    If _ArraySearch($includesPath, $includePathSection[$i][0] & '\') = -1 Then
    _ArrayInsert($includesPath, 0, $includePathSection[$i][0] & '\')
    EndIf
    Next
    EndIf
    _prepareOrganizeIncludes()
    Else
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'includes.ini could not be renewed', 1)
    EndIf
    EndFunc ;==>_renewIni

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

    Func _setUDFs()
    For $i = 1 To UBound($includesPath) - 1
    GUICtrlCreateListViewItem($includesPath[$i], $udf_LV)
    Next
    EndFunc ;==>_setUDFs

    [/autoit]

    So long,

    Mega

    P.S.: Werde mal sehen was da los ist.

  • Link vom Internet Explorer in eine GUI ziehen???

    • Xenobiologist
    • 28. September 2007 um 21:44

    Hi,

    geh doch den Umweg über markieren und dann Copy&paste.

    So long,

    Mega

  • Link vom Internet Explorer in eine GUI ziehen???

    • Xenobiologist
    • 28. September 2007 um 21:18

    Hi,

    seit wann kann man denn in einem IE Links draggen?

    So long,

    Mega

  • Befehl 'GuiCtrlCreateDate' mit '$DTS_SHOWNONE'

    • Xenobiologist
    • 28. September 2007 um 16:55

    HI,

    ich kenne nur diese:

    [autoit]

    #include <GUIConstants.au3>
    #include <A3LDateTimePick.au3>

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

    GUICreate("My GUI get date", 200, 200)
    $Datum = GUICtrlCreateDate("", 1, "test", 190, 20, BitOR($DTS_SHORTDATEFORMAT, $DTS_SHOWNONE))
    $Datum_hwnd = GUICtrlGetHandle($Datum)
    $b = GUICtrlCreateButton('Check', 10, 50, 100, 20)
    GUISetState()

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

    Do
    $msg = GUIGetMsg()
    If $msg = $b Then
    _DTP_GetSystemTimeEx($Datum_hwnd)
    If @error = $GDT_NONE Then
    $state = 'unchecked'
    Else
    $state = 'checked'
    EndIf
    MsgBox(0, GUICtrlRead($Datum, 1), $state)
    EndIf
    Until $msg = $GUI_EVENT_CLOSE

    [/autoit]

    So long,

    Mega

  • get & set ID3 Tags

    • Xenobiologist
    • 28. September 2007 um 14:30

    Hi,

    ja Version 2 lesen würde man hinbekommen. Schreiben habe ich noch nicht gesehen.

    Aber wer braucht das schon :)

    So long,

    Mega

  • OrganizeIncludes

    • Xenobiologist
    • 28. September 2007 um 13:32

    Hi,

    wie sieht denn dein iniFile aus?

    So long,

    Mega

  • GUI-Tab abprüfen

    • Xenobiologist
    • 28. September 2007 um 13:06

    Hi,

    einfach die Funktion in Scite kopieren und dann makieren und F1 drücken.

    So long,

    Mega

  • Mein Avatar

    • Xenobiologist
    • 28. September 2007 um 09:14

    Hi,

    jetzt verstehe ich auch, warum dein Avatar ne 8) - Sonnenbrille trägt. :D

    So long,

    Mega

  • get & set ID3 Tags

    • Xenobiologist
    • 28. September 2007 um 09:13

    HI,

    habe ich mich ehrlich gesagt nicht mit auseinandergesetzt. Aber ein Blick ins Wiki hat mir verraten, dass es sich wohl um version 1 handelt.

    So long,

    Mega

  • OrganizeIncludes

    • Xenobiologist
    • 27. September 2007 um 22:43

    Hi,

    komisch. Ich nutze gerade diese Version. Wenn ich wieder Zeit finde, dann mach ich sie auch fertig. :D

    Spoiler anzeigen
    [autoit]

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.2.7.0
    ; Author: Thorsten Meger
    ;
    ; Script Function:
    ; Organize Includes Version 2.8
    ;
    ; ----------------------------------------------------------------------------
    ;Opt("TrayIconDebug", 1)
    ;[Includes]
    #include<Array.au3>
    #include<File.au3>
    #include<GuiListView.au3>
    #include<GuiStatusBar.au3>
    #include<GUIConstants.au3>
    Global $start_T = TimerInit()
    #cs
    * Prüfung, dass ein File sich nicht selbst includen darf! - DONE
    * Prüfung der includes in den include files! - TODO
    * RegExp Prüfung auf Wortgrenze beschränken bei Funktionen - DONE
    * Auskommentierungsmöglichkeit für includes (wird analysiert aber nicht gelöscht) - DONE
    * Constants.au3 mit aufnehmen für RUN Befehle - DONE
    * Möglichkeit zusätzliche UDF Pfade anzugeben - DONE
    * Refresh Möglichkeit - DONE
    * GUI Include Pathes füllen und leeren können - TODO
    #ce

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

    #cs TEST
    Global $MonItText, $AutoItBetaexePath
    $MonItText = StringReplace($MonItText,"#include <dllcallback.au3>","#include " & "'" & $AutoItBetaexePath & "\Include\dllcallback.au3'")

    #ce

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

    ; ScriptVersion
    Global $scriptVersion = 'Version 2.8'
    ; NormalVersion
    Global $InstallPath = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir')
    Global $InstallVersion = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'Version')
    ; BetaVersion
    Global $betaInstallPath = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir')
    Global $betaInstallVersion = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'betaVersion')

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

    ; Variables
    Dim $includesPath[1]
    If $InstallPath <> '' Then _ArrayAdd($includesPath, $InstallPath & '\Include\')
    If $betaInstallPath <> '' Then _ArrayAdd($includesPath, $betaInstallPath & '\Include\')
    Global $includesIni = @ScriptDir & '\includes.ini'
    Global $source = '', $sourceAnalyse = '', $exit_B = 0, $organize_B = 0, $openIni_B = 0, $autoitVersion_I = 0, $betaVersion_I = 0, $filename_I = 0
    Global $includes_LV = 0, $FileName = '', $GUI = 0, $status_SB = 0, $checkIncludes_B = 0, $ToBeIncluded[1], $B_DESCENDING = 0
    Global $deleteIncludes_CB = 0, $copyToClipBoard_CB = 0, $delAll_R = 0, $delUnneeded_R = 0, $delNothing_R = 0, $keyword_I = 0
    Global $placeAfterKeyWord_R = 0, $placeAtTop_R = 0, $green_A[1], $yellow_A[1], $red_A[1], $LV = 0, $count = 0, $silentMode_CB = 0
    Global $parts_SB[3] = [80, 526, -1], $silentMode = True, $renewIni_B = 0, $addIncludePath_B = 0, $delIncludePath_B = 0, $restart_B = 0
    Global $autoRestart_CB = 0, $udf_LV = 0
    Global $text_SB[3] = [@TAB & $scriptVersion, @TAB & 'Organize includes', '']
    Global $status_A[4] = ['correctly included', 'needed include', 'not needed', 'include itself?']
    ; Read the seetings from the ini file
    Global $neededAndIncluded = IniRead($includesIni, 'Options', 'Green', '0x80FF80')
    Global $neededNotIncluded = IniRead($includesIni, 'Options', 'Yellow', '0xFFFF80')
    Global $notNeededButIncluded = IniRead($includesIni, 'Options', 'Red', '0xEF3D4A')
    Global $selfInclude = IniRead($includesIni, 'Options', 'Selfinclude', '0x0000F9')
    Global $keyword = IniRead($includesIni, 'Options', 'Keyword', ';[Includes]')

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

    ; Operating sequence
    _createGUI()
    _start()
    GUICtrlSetData($autoitVersion_I, $InstallVersion)
    GUICtrlSetData($betaVersion_I, $betaInstallVersion)

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

    ; Setting silent off when 1 parameter = silentOff
    ; Silent mode = no GUI and organize includes automatically with settings from ini file
    If $cmdLine[0] > 0 And $cmdLine[1] = 'silentOff' Then $silentMode = False
    If GUICtrlRead($silentMode_CB) = $GUI_UNCHECKED Or $silentMode = False Then
    GUISetState(@SW_SHOW)
    Else
    _organize()
    Exit (0)
    EndIf

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

    _GUICtrlStatusBarSetText($status_SB, @TAB & Round(TimerDiff($start_T) / 1000, 4) & ' sec', 2)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit (0)
    Case $exit_B
    _exit()
    Exit (0)
    Case $organize_B
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Script started ... organizing includes ... ', 1)
    _organize()
    If GUICtrlRead($autoRestart_CB) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'AutoRestart', 1)
    _restart()
    Else
    IniWrite($includesIni, 'Options', 'AutoRestart', 0)
    EndIf
    Case $openIni_B
    If FileExists($includesIni) Then
    ShellExecute($includesIni)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'includes.ini opened', 1)
    Else
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'No ini file found', 1)
    Sleep(1000)
    $re = MsgBox(36, 'Create new ini file', 'Do you want to create a new ini file?', 15)
    If $re = -1 Or $re = 7 Then
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'No ini file available', 1)
    ElseIf $re = 6 Then
    _prepareOrganizeIncludes()
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'New ini file created', 1)
    Sleep(2000)
    If FileExists($includesIni) Then ShellExecute($includesIni)
    EndIf
    EndIf
    Case $renewIni_B
    _renewIni()
    Case $placeAfterKeyWord_R
    GUICtrlSetState($keyword_I, $GUI_SHOW)
    GUICtrlSetState($keyword_I, $GUI_FOCUS)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Enter your keyword ...', 1)
    Case $placeAtTop_R
    GUICtrlSetState($keyword_I, $GUI_HIDE)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Includes will be placed at top of your script', 1)
    Case $copyToClipBoard_CB
    If GUICtrlRead($copyToClipBoard_CB) = $GUI_CHECKED Then
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Copying includes to clipboard activated', 1)
    Else
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Copying includes to clipboard deactivated', 1)
    EndIf
    Case $includes_LV
    _sortLV()
    Case $delAll_R
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'All includes will be removed', 1)
    Case $delUnneeded_R
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Only the not needed includes will be removed', 1)
    Case $delNothing_R
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'No includes will be removed', 1)
    Case $addIncludePath_B
    $path = FileSelectFolder('Choose a folder where "Organize includes" looks for your udfs', '\', 6, StringLeft(@ScriptDir, 3))
    If $path <> '' Then
    _GUICtrlStatusBarSetText($status_SB, @TAB & $path & ' added to include pathes', 1)
    IniWrite($includesIni, 'IncludePath', $path, '')
    Else
    _GUICtrlStatusBarSetText($status_SB, @TAB & $path & ' Cancel - no paths added', 1)
    EndIf
    _renewIni()
    GUICtrlCreateListViewItem($path & '\', $udf_LV)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Ini-Update ready ...', 1)
    Case $delIncludePath_B
    If IniDelete($includesIni, 'IncludePath') Then _GUICtrlStatusBarSetText($status_SB, @TAB & 'Include pathes deleted', 1)
    _renewIni()
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Ini-Update ready ...', 1)
    Case $restart_B
    _exit()
    _restart()
    Case $silentMode_CB
    If GUICtrlRead($silentMode_CB) = $GUI_CHECKED Then
    GUICtrlSetState($autoRestart_CB, $GUI_DISABLE)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Silent Mode activated', 1)
    Else
    GUICtrlSetState($autoRestart_CB, $GUI_ENABLE)
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Silent Mode deactivated', 1)
    EndIf
    EndSwitch
    WEnd

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

    Func _deleteLinesForAnalyse()
    Local $sourceLine_A = StringSplit($sourceAnalyse, @CR)

    EndFunc ;==>_deleteLinesForAnalyse

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

    ; Start func gets the source and calls all other needed funcs.
    Func _start()
    If Not ProcessExists('SciTE.exe') Then Exit (0)
    Opt('WinTitleMatchMode', 4)
    WinActivate('classname=SciTEWindow')
    WinWaitActive('classname=SciTEWindow')
    $FileName = StringSplit(WinGetTitle(''), '\')
    GUICtrlSetData($filename_I, StringLeft($FileName[UBound($FileName) - 1], StringInStr($FileName[UBound($FileName) - 1], '.au3') + 3))
    $source = ControlGetText('classname=SciTEWindow', '', 350)
    $sourceAnalyse = $source
    ; delete unnessary lines of code
    If Not FileExists($includesIni) Then
    _prepareOrganizeIncludes()
    _setOptions()
    EndIf
    $ToBeIncluded = getIncludes()
    _ArraySort($ToBeIncluded)
    $re = setIncludes($ToBeIncluded)
    ;_selfInclude()
    If $re = -2 Then _GUICtrlStatusBarSetText($status_SB, @TAB & 'No includes needed!', 1)
    _setUDFs()
    EndFunc ;==>_start

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

    ; Starting action (delete and/or insert)
    Func _organize()
    Local $sourceLine_A = StringSplit($source, @CR)
    $sourceLine_A = _deleteIncludes($sourceLine_A)
    $sourceLine_A = _insertIncludes($sourceLine_A)
    ControlSetText('classname=SciTEWindow', '', 'Scintilla1', _ArrayToString($sourceLine_A, @CR, 1))
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Includes inserted', 1)
    EndFunc ;==>_organize

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

    ; Insert includes into array of code lines
    Func _insertIncludes($sourceLine_A)
    Local $includes = ''
    If GUICtrlRead($delAll_R) = $GUI_CHECKED Then $includes = _ArrayToString($green_A, @CR, 1)
    $includes &= @CR & _ArrayToString($yellow_A, @CR, 1)
    If StringLeft($includes, 1) = @CR Then $includes = StringTrimLeft($includes, 1)
    If StringRight($includes, 1) = @CR Then $includes = StringTrimRight($includes, 1)
    If Not $includes <> '' Then Return $sourceLine_A

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

    If GUICtrlRead($placeAfterKeyWord_R) = $GUI_CHECKED Then
    Local $keyword = GUICtrlRead($keyword_I)
    For $i = 0 To UBound($sourceLine_A) - 1
    If StringInStr($sourceLine_A[$i], $keyword, 2) Then
    _ArrayInsert($sourceLine_A, $i + 1, $includes)
    ExitLoop
    EndIf
    Next
    Else
    _ArrayInsert($sourceLine_A, 1, $includes)
    EndIf
    If GUICtrlRead($copyToClipBoard_CB) = $GUI_CHECKED Then
    ClipPut('')
    ClipPut($includes)
    EndIf
    Return $sourceLine_A
    EndFunc ;==>_insertIncludes

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

    ; Delete includes from array of code lines
    Func _deleteIncludes($sourceLine_A)
    If GUICtrlRead($delAll_R) = $GUI_CHECKED Then
    For $i = UBound($sourceLine_A) - 1 To 1 Step - 1
    ; Wenn ';' include dann lasse die Zeile aus
    If StringRegExp($sourceLine_A[$i], '(?i)#include[ ]*<[ ]*(.*?\.au3)[ ]*>' , 0) = 1 And _
    StringRegExp($sourceLine_A[$i], '(?i);.*[ ]*#include[ ]*<', 0) = 0 Then
    _ArrayDelete($sourceLine_A, $i)
    EndIf
    Next
    ElseIf GUICtrlRead($delUnneeded_R) = $GUI_CHECKED Then
    For $ii = 1 To UBound($red_A) - 1
    For $i = UBound($sourceLine_A) - 1 To 1 Step - 1
    If StringRegExp($sourceLine_A[$i], '(?i)#include[ ]*<[ ]*(.*?' & $red_A[$ii] & ')[ ]*>', 0) = 1 And _
    StringRegExp($sourceLine_A[$i], '(?i);.*[ ]*#include[ ]*<', 0) = 0 Then
    _ArrayDelete($sourceLine_A, $i)
    EndIf
    Next
    Next
    EndIf
    Return $sourceLine_A
    EndFunc ;==>_deleteIncludes

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

    Func setIncludes($ToBeIncluded)
    If Not IsArray($ToBeIncluded) Then Return -1
    _GUICtrlListViewSetItemCount($includes_LV, UBound($ToBeIncluded))
    Dim $LV[150]
    ; Create a row for every include and set bk to green
    For $i = 1 To UBound($ToBeIncluded) - 1
    $LV[$count] = GUICtrlCreateListViewItem('#include<' & $ToBeIncluded[$i] & '>' & '|' & $status_A[0] , $includes_LV)
    GUICtrlSetBkColor(-1, $neededAndIncluded)
    $count += 1
    ; Is the needed include not in source code then change bk to yellow and delete entry from green array
    If StringRegExp($source,'(?i)#include[ ]*<[ ]*' & $ToBeIncluded[$i] &'[ ]*>', 0) = 0 Or _
    StringRegExp($source,'(?i);[ ]*#include[ ]*<[ ]*' & $ToBeIncluded[$i] &'[ ]*>', 0) = 1 Then
    _GUICtrlListViewSetItemText($includes_LV, $i - 1, 1, $status_A[1])
    GUICtrlSetBkColor(-1, $neededNotIncluded)
    _ArrayAdd($yellow_A, $ToBeIncluded[$i])
    _ArrayDelete($green_A, _ArraySearch($green_A, $ToBeIncluded[$i]))
    EndIf
    Next
    ; Find all includes in source code. Bk to red if they are not needed
    $alreadyIncluded = StringRegExp($source,'(?i)#include[ ]*<[ ]*(.*?\.au3)[ ]*>', 3)
    If Not @error Then
    For $i = 0 To UBound($alreadyIncluded) - 1
    If _ArraySearch($ToBeIncluded, $alreadyIncluded[$i]) = -1 Then
    $LV[$count] = GUICtrlCreateListViewItem('#include<' & $alreadyIncluded[$i] & '>' & '|' & $status_A[2], $includes_LV)
    GUICtrlSetBkColor(-1, $notNeededButIncluded)
    $count += 1
    _ArrayAdd($red_A, $alreadyIncluded[$i])
    EndIf
    Next
    EndIf
    For $i = 1 To UBound($green_A) - 1
    $green_A[$i] = '#include<' & $green_A[$i] & '>'
    Next
    For $i = 1 To UBound($yellow_A) - 1
    $yellow_A[$i] = '#include<' & $yellow_A[$i] & '>'
    Next
    If UBound($ToBeIncluded) = 1 Then Return -2
    EndFunc ;==>setIncludes

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

    ; If version number (normal and beta) changed or ini file doesn't exist then create a new one with _prepareOrganizeIncludes()
    ; Search for needed includes
    Func getIncludes()
    If Not FileExists($includesIni) Or (IniRead($includesIni, 'Version', 'beta', 'Error') <> $betaInstallVersion) Or _
    (IniRead($includesIni, 'Version', 'Normal', 'Error') <> $InstallVersion) Then _prepareOrganizeIncludes()
    ;Local $iniContent = IniReadSection($includesIni, 'Functions')
    ;If @error Then MsgBox(4096, '', 'Error occurred, probably no ini file.')
    ;_ArrayDisplay($iniContent)

    ; ############################## INIReadSection ########################## ausbauen oder die Erweiterung abwarten!!!!

    Local $lines_A
    If Not _FileReadToArray($includesIni, $lines_A) Then
    MsgBox(4096, '', 'Error occurred, probably no ini file.')
    Exit
    EndIf

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

    Local $iniContent[1][2]
    Local $count = 1
    For $i = 1 To $lines_A[0] - 1
    If StringInStr($lines_A[$i], '.au3') Then
    $re = StringSplit($lines_A[$i], '=')
    ReDim $iniContent[$count + 1][2]
    $iniContent[$count][0] = $re[1]
    $iniContent[$count][1] = $re[2]
    $count += 1
    EndIf
    Next
    $iniContent[0][0] = UBound($iniContent) - 1

    Local $Constants_A[3] = ['$STDIN_CHILD', '$STDOUT_CHILD', '$STDERR_CHILD']

    For $i = 1 To $iniContent[0][0]
    Local $functionsInAU3 = StringSplit($iniContent[$i][1], ';')
    If @error Then
    If StringRegExp($source, '(?i)' & $iniContent[$i][0] & '([ ]+|\()', 0) = 1 Then
    _ArrayAdd($ToBeIncluded, $iniContent[$i][0])
    ExitLoop
    EndIf
    EndIf
    For $ii = 1 To UBound($functionsInAU3) - 1
    If StringRegExp($source, '(?i)\b' & $functionsInAU3[$ii] & '\b([ ]+|\()', 0) = 1 Then
    _ArrayAdd($ToBeIncluded, $iniContent[$i][0])
    ExitLoop
    EndIf
    Next
    Next
    For $iii = 1 To UBound($Constants_A) - 1
    If StringRegExp($source, '(?i)\' & $Constants_A[$iii], 0) = 1 And _
    StringRegExp($source, "(?i)'\" & $Constants_A[$iii] & "'", 0) = 0 Then
    _ArrayAdd($ToBeIncluded, 'Constants.au3')
    ExitLoop
    EndIf
    Next
    $green_A = $ToBeIncluded
    Return $ToBeIncluded
    EndFunc ;==>getIncludes

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

    Func _setOptions()
    ; Version info
    IniWrite($includesIni, 'Version', 'Beta', $betaInstallVersion)
    IniWrite($includesIni, 'Version', 'Normal', $InstallVersion)
    ; Options
    IniWrite($includesIni, 'Options', 'Green', '0x80FF80')
    IniWrite($includesIni, 'Options', 'Yellow', '0xFFFF80')
    IniWrite($includesIni, 'Options', 'Red', '0xEF3D4A')
    IniWrite($includesIni, 'Options', 'Selfinclude', '0x0000F9')
    IniWrite($includesIni, 'Options', 'Keyword', ';[Includes]')
    IniWrite($includesIni, 'Options', 'CopyToCliP', 0)
    IniWrite($includesIni, 'Options', 'Del', 0)
    IniWrite($includesIni, 'Options', 'Place', 0)
    IniWrite($includesIni, 'Options', 'SilentMode', 0)
    IniWrite($includesIni, 'Options', 'AutoRestart', 1)
    IniWrite($includesIni, 'Options', 'Created', @YEAR & '/' & @MON & '/' & @MDAY & ' - ' & @HOUR & ':' & @MIN & ':' & @SEC)
    EndFunc ;==>_setOptions

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

    ; Create new includes.ini with funcs and seetings/options
    Func _prepareOrganizeIncludes()
    ; Includes
    For $ii = 0 To UBound($includesPath) - 1
    $FileList = _FileListToArray($includesPath[$ii], '*.au3', 1)
    If @error = 1 Then ContinueLoop

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

    For $i = 1 To UBound($FileList) - 1
    $functions = StringRegExp(FileRead(FileOpen($includesPath[$ii] & $FileList[$i], 0)), '(?<=Func )[0-9a-zA-Z_]+[ ]{0,}(?=\()', 3)
    If IsArray($functions) And UBound($functions) > 1 Then
    IniWrite($includesIni, 'Functions', $FileList[$i], _ArrayToString($functions, ';'))
    ElseIf IsArray($functions) Then
    IniWrite($includesIni, 'Functions', $FileList[$i], $functions[0])
    EndIf
    Next
    IniWrite($includesIni, 'Functions', 'GUIConstants.au3', 'GUICreate;GUIGetMsg')
    Next
    IniWrite($includesIni, 'Options', 'Created', @YEAR & '/' & @MON & '/' & @MDAY & ' - ' & @HOUR & ':' & @MIN & ':' & @SEC)
    EndFunc ;==>_prepareOrganizeIncludes

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

    ; Create the GUI
    Func _createGUI()
    $GUI = GUICreate('Organize includes for AutoIt by Xenobiologist', 606, 546, 196, 50, $WS_SYSMENU)
    GUICtrlCreateGroup('', 8, 88, 585, 249 + 119)
    $includes_LV = GUICtrlCreateListView('Includes|Status', 24, 112, 553, 201)
    GUICtrlSendMsg($includes_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
    GUICtrlSendMsg($includes_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
    Global $B_DESCENDING[_GUICtrlListViewGetSubItemsCount($includes_LV) ]
    GUICtrlSetFont($includes_LV, 10, 600, '', 'Trebuchet MS')
    _GUICtrlListViewSetColumnWidth($includes_LV, 0, 400)
    _GUICtrlListViewSetColumnWidth($includes_LV, 1, $LVSCW_AUTOSIZE_USEHEADER)
    GUICtrlCreateGroup('', -99, -99, 1, 1)

    $udf_LV = GUICtrlCreateListView('UDF Path', 24, 336, 553, 101)
    GUICtrlSendMsg($udf_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
    GUICtrlSendMsg($udf_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
    GUICtrlSendMsg($udf_LV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_CHECKBOXES, $LVS_EX_CHECKBOXES)
    _GUICtrlListViewSetColumnWidth($udf_LV, 0, $LVSCW_AUTOSIZE_USEHEADER)

    GUICtrlCreateLabel('Autoit', 8, 16, 100, 21, $SS_SUNKEN)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 700)
    GUICtrlCreateLabel('Autoit Beta', 8, 40, 100, 21, $SS_SUNKEN)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 700)
    GUICtrlCreateLabel('Filename', 8, 64, 100, 21, $SS_SUNKEN)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 700)
    $filename_I = GUICtrlCreateInput('', 112, 64, 481, 21)
    $betaVersion_I = GUICtrlCreateInput('', 112, 40, 81, 21)
    $autoitVersion_I = GUICtrlCreateInput('', 112, 16, 81, 21)
    $organize_B = GUICtrlCreateButton('Organize includes', 8, 462, 187, 25, 0)
    GUICtrlSetTip(-1, 'Start organize includes', 'Start script', 1, 1)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 600)

    $openIni_B = GUICtrlCreateButton('Open ini', 200, 462, 100, 25, 0)
    GUICtrlSetTip(-1, 'Options and settings for the "Organize Includes" script', 'Open ini file', 1, 1)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 600)

    $renewIni_B = GUICtrlCreateButton('Renew ini', 303, 462, 100, 25, 0)
    GUICtrlSetTip(-1, 'New scan for funcs in include folders', 'Renew ini file', 1, 1)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 600)

    $exit_B = GUICtrlCreateButton('Exit', 408, 462, 187, 25, 0)
    GUICtrlSetTip(-1, 'Exit' & @TAB & @TAB & @TAB & '- settings will be saved' & @CRLF & _
    'Exit without saving' & @TAB & '- by leaving with the cross', 'Exit script', 1, 1)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 11, 600)
    $status_SB = _GUICtrlStatusBarCreate($GUI, $parts_SB, $text_SB)
    GUIStartGroup()
    $delAll_R = GUICtrlCreateRadio('Remove all', 210, 16, 120, 15)
    GUICtrlSetTip(-1, 'Remove all' & @TAB & @TAB & ' - remove all includes of your script' & @CRLF & _
    'Remove unneeded ' & @TAB & ' - remove all not needed includes of your script' & @CRLF & _
    'Remove nothing ' & @TAB & ' - do not remove includes of your script', 'Remove includes', 1, 1)
    $delUnneeded_R = GUICtrlCreateRadio('Remove unneeded', 210, 32, 120, 15)
    $delNothing_R = GUICtrlCreateRadio('Remove nothing', 210, 48, 120, 15)
    GUIStartGroup()

    Switch IniRead($includesIni, 'Options', 'Del', '0')
    Case 0
    GUICtrlSetState($delAll_R, $GUI_CHECKED)
    Case 1
    GUICtrlSetState($delUnneeded_R, $GUI_CHECKED)
    Case 2
    GUICtrlSetState($delNothing_R, $GUI_CHECKED)
    EndSwitch

    GUIStartGroup()
    $placeAfterKeyWord_R = GUICtrlCreateRadio('Place after keyword', 355, 16, 120, 15)
    GUICtrlSetTip(-1, 'Insert the inculdes at top of your script or' & @CRLF & _
    'place the includes after a special keyword.', 'Insert includes', 1, 1)
    $placeAtTop_R = GUICtrlCreateRadio('Place at top', 355, 32, 120, 15)
    GUIStartGroup()

    $keyword_I = GUICtrlCreateInput(IniRead($includesIni, 'Options', 'Keyword', ';[includes]'), 480, 10, 113, 21)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 9.5, 800)
    GUICtrlSetTip(-1, 'Keyword to search for. Includes are placed after this line.', 'Keyword', 1, 1)
    If IniRead($includesIni, 'Options', 'Place', '0') = 1 Then
    GUICtrlSetState($placeAtTop_R, $GUI_CHECKED)
    GUICtrlSetState($keyword_I, $GUI_HIDE)
    Else
    GUICtrlSetState($placeAfterKeyWord_R, $GUI_CHECKED)
    GUICtrlSetState($keyword_I, $GUI_SHOW)
    EndIf

    $copyToClipBoard_CB = GUICtrlCreateCheckbox('Copy to clipboard', 355, 48, 120, 15)
    GUICtrlSetTip(-1, 'Copy the includes to clipboard.', 'Copy to clipboard', 1, 1)
    If IniRead($includesIni, 'Options', 'CopyToClip', '0') = 1 Then GUICtrlSetState($copyToClipBoard_CB, $GUI_CHECKED)

    $autoRestart_CB = GUICtrlCreateCheckbox('AutoRestart', 480, 32, 120, 15)
    GUICtrlSetTip(-1, 'AutoRestart ' & @TAB & '- Automatically restarts script after pressing organize includes button', 'AutoRestart', 1, 1)
    If IniRead($includesIni, 'Options', 'AutoRestart', '0') = 1 Then GUICtrlSetState($autoRestart_CB, $GUI_CHECKED)

    $silentMode_CB = GUICtrlCreateCheckbox('Silent Mode', 480, 48, 120, 15)
    GUICtrlSetTip(-1, 'Checked ' & @TAB & '- Next start will do an oragnize includes without GUI.' & @CRLF & _
    'Once checked and restarted you can only deacitvate silent mode by changend value in the ini to SilentMode=0 or ' & @CRLF & _
    'by starting the script with parameter silentOff.', 'Silent Mode', 1, 1)
    If IniRead($includesIni, 'Options', 'SilentMode', '0') = 1 Then GUICtrlSetState($silentMode_CB, $GUI_CHECKED)

    $addIncludePath_B = GUICtrlCreateButton('Add include path', 24, 315, 181, 19)
    GUICtrlSetTip(-1, ' You can add pathes to your udf folder. After adding you need to restart the script.', 'Add include path', 1, 1)
    $delIncludePath_B = GUICtrlCreateButton('Del include path', 210, 315, 181, 19)
    GUICtrlSetTip(-1, ' Will delete all added include pathes. After deleting you need to restart the script.', 'Del include path', 1, 1)
    $restart_B = GUICtrlCreateButton('Restart/Refresh', 396, 315, 181, 19)
    GUICtrlSetTip(-1, 'Restarts "organize includes". Behaves like a refresh.', 'Restart/Refresh', 1, 1)
    EndFunc ;==>_createGUI

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

    ; Save seetings before exit
    Func _exit()
    If GUICtrlRead($placeAfterKeyWord_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Keyword', GUICtrlRead($keyword_I))
    EndIf
    If GUICtrlRead($copyToClipBoard_CB) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'CopyToClip', 1)
    Else
    IniWrite($includesIni, 'Options', 'CopyToClip', 0)
    EndIf

    If GUICtrlRead($delAll_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Del', 0)
    ElseIf GUICtrlRead($delUnneeded_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Del', 1)
    ElseIf GUICtrlRead($delNothing_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Del', 2)
    EndIf

    If GUICtrlRead($placeAfterKeyWord_R) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'Place', 0)
    Else
    IniWrite($includesIni, 'Options', 'Place', 1)
    EndIf

    If GUICtrlRead($silentMode_CB) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'SilentMode', 1)
    Else
    IniWrite($includesIni, 'Options', 'SilentMode', 0)
    EndIf

    If GUICtrlRead($autoRestart_CB) = $GUI_CHECKED Then
    IniWrite($includesIni, 'Options', 'AutoRestart', 1)
    Else
    IniWrite($includesIni, 'Options', 'AutoRestart', 0)
    EndIf
    EndFunc ;==>_exit

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

    ; Sort the listview items
    Func _sortLV()
    _GUICtrlListViewSort($includes_LV, $B_DESCENDING, GUICtrlGetState($includes_LV))
    For $i = 0 To $count - 1
    Switch _GUICtrlListViewGetItemText($includes_LV, $i, 1)
    Case $status_A[0]
    GUICtrlSetBkColor($LV[$i], $neededAndIncluded)
    Case $status_A[1]
    GUICtrlSetBkColor($LV[$i], $neededNotIncluded)
    Case $status_A[2]
    GUICtrlSetBkColor($LV[$i], $notNeededButIncluded)
    EndSwitch
    Next
    EndFunc ;==>_sortLV

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

    Func _selfInclude()
    For $i = 0 To $count - 1
    If _GUICtrlListViewGetItemText($includes_LV, $i, 0) = '#include<'&GUICtrlRead($filename_I)&'>' Then
    _GUICtrlListViewSetItemText($includes_LV, $i, 1, $status_A[3])
    If StringRegExp($source, '(?i)#include[ ]*<[ ]*'&GUICtrlRead($filename_I)&'[ ]*>', 0) = 1 Then
    _ArrayAdd($red_A, '#include<'&GUICtrlRead($filename_I)&'>')
    Local $re = _ArraySearch($green_A, '#include<'&GUICtrlRead($filename_I)&'>')
    If $re <> -1 Then _ArrayDelete($green_A, $re)
    GUICtrlSetBkColor($LV[$i], $selfInclude)
    Else
    ; Wenn nicht im Source, dann löschen aus ListView
    _GUICtrlListViewDeleteItem($includes_LV, $i)
    EndIf
    EndIf
    Next
    EndFunc ;==>_selfInclude

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

    Func _restart()
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Script is restarting ...', 1)
    Run('"' & @AutoItExe & '" ' & '/AutoIt3ExecuteScript "' & @ScriptFullPath & '" ' & @AutoItPID, '', @SW_HIDE)
    Exit (0)
    EndFunc ;==>_restart

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

    Func _renewIni()
    ConsoleWrite('_renewIni() ' & @CRLF)
    If IniDelete($includesIni, 'Functions') Then
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'Funcs in includes.ini deleted', 1)
    $includePathSection = IniReadSection($includesIni, 'IncludePath')
    If Not @error Then
    For $i = 1 To $includePathSection[0][0]
    If _ArraySearch($includesPath, $includePathSection[$i][0] & '\') = -1 Then
    _ArrayInsert($includesPath, 0, $includePathSection[$i][0] & '\')
    EndIf
    Next
    EndIf
    _prepareOrganizeIncludes()
    Else
    _GUICtrlStatusBarSetText($status_SB, @TAB & 'includes.ini could not be renewed', 1)
    EndIf
    EndFunc ;==>_renewIni

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

    Func _setUDFs()
    For $i = 1 To UBound($includesPath) - 1
    GUICtrlCreateListViewItem($includesPath[$i], $udf_LV)
    Next
    EndFunc ;==>_setUDFs

    [/autoit]

    So long,

    Mega

  • OrganizeIncludes

    • Xenobiologist
    • 27. September 2007 um 22:17

    Hi,

    bei mir funktioniert es noch einwandfrei. Hast du es auch korrekt eingerichtet?

    Existiert die SciteUser.properties mit den Anpassungen?

    So long,

    Mega

  • Mein Avatar

    • Xenobiologist
    • 27. September 2007 um 20:35

    Hi,

    na ja hätte ich gern mal ein Bild zum Vergleich :D

    So long,

    Mega

  • get & set ID3 Tags

    • Xenobiologist
    • 27. September 2007 um 19:00

    HI,

    ich sollte für eine Kollegin ein Skript schreiben, dass die Titelnummern von MP3 Dateien durchnummerieren kann, damit ihr proprietäres Navigationssystem die Dateien in der richtigen Reihenfolge abspielt.

    Dabei habe ich folgende Funktion gebaut. Vielleicht kann sie ja jemand nutzen.

    Sollten sie für nützlich empfunden werden, dann mache ich richtige UDFs draus.

    Spoiler anzeigen
    [autoit]

    #include <array.au3>

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

    Global $file = "C:\Downloads\Musik\Chris De Burg - Lady in Red.mp3"

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

    _DLLstartup()
    $re = _getID3Tag($file)
    If @error Then MsgBox(0, 'Error', 'Error - no array returned', 5)
    _ArrayDisplay($re)
    _setID3Tag($file, 'TrackPosition', 100)
    If @error Then MsgBox(0, 'Error', 'Error - setID3Tag', 5)
    _setID3Tag($file, 'TitleAlbum', 'Mega')
    If @error Then MsgBox(0, 'Error', 'Error - setID3Tag', 5)
    $re = _getID3Tag($file)
    If @error Then MsgBox(0, 'Error', 'Error - no array returned', 5)
    _ArrayDisplay($re)
    _DLLshutdown()

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

    ;===============================================================================================================
    ; 'TitleAlbum', 'Movie', 'Title', 'CopyrightYear', 'CopyrightHolder', 'Comments', 'Label', 'BeatsPerMinute',
    ; 'LeadArtist', 'PartOfSet', 'TrackPosition', 'Year', 'Genre', 'FileId', 'ISRC'
    ;================================================================================================================
    Func _setID3Tag($h_file, $detail, $value)
    Local $oId3 = ObjCreate("CDDBControl.CddbID3Tag")
    If Not IsObj($oId3) Then
    SetError(1)
    Return 0
    EndIf
    ; False means open for read-write
    $oId3.LoadFromFile ($h_file, False)

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

    Switch $detail
    Case 'TitleAlbum'
    $oId3.Album = $value
    Case 'LeadArtist'
    $oId3.LeadArtist = $value
    Case 'Title'
    $oId3.Title = $value
    Case 'TrackPosition'
    $oId3.TrackPosition = $value
    Case 'Year'
    $oId3.Year = $value
    Case 'Genre'
    $oId3.Genre = $value
    Case 'Comments'
    $oId3.Comments = $value
    Case 'Label'
    $oId3.Label = $value
    Case 'FileID'
    $oId3.FileId = $value
    Case 'IRSC'
    $oId3.ISRC = $value
    Case 'CopyrightHolder'
    $oId3.CopyrightHolder = $value
    Case 'CopyrightYear'
    $oId3.CopyrightYear = $value
    Case 'PartOfSet'
    $oId3.PartOfSet = $value
    Case 'Movie'
    $oId3.Movie = $value
    Case 'BeatsPerMinute'
    $oId3.BeatsPerMinute = $value
    Case Else
    SetError(2)
    Return 0
    EndSwitch
    $oId3.SaveToFile ($h_file)
    Return 1
    EndFunc ;==>_setID3Tag

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

    Func _getID3Tag($h_file)
    Local $oId3 = ObjCreate("CDDBControl.CddbID3Tag")
    If Not IsObj($oId3) Then
    SetError(1)
    Return 0
    EndIf
    $oId3.LoadFromFile ($h_file, False)
    Local $idTag_A[15][2]
    $idTag_A[0][0] = 'Title'
    $idTag_A[0][1] = $oId3.Title
    $idTag_A[1][0] = 'LeadArtist'
    $idTag_A[1][1] = $oId3.LeadArtist
    $idTag_A[2][0] = 'Album'
    $idTag_A[2][1] = $oId3.Album
    $idTag_A[3][0] = 'TrackPosition'
    $idTag_A[3][1] = $oId3.TrackPosition
    $idTag_A[4][0] = 'Year'
    $idTag_A[4][1] = $oId3.Year
    $idTag_A[5][0] = 'Genre'
    $idTag_A[5][1] = $oId3.Genre
    $idTag_A[6][0] = 'Comments'
    $idTag_A[6][1] = $oId3.Comments
    $idTag_A[7][0] = 'Label'
    $idTag_A[7][1] = $oId3.Label
    $idTag_A[8][0] = 'FileId'
    $idTag_A[8][1] = $oId3.FileId
    $idTag_A[9][0] = 'ISRC'
    $idTag_A[9][1] = $oId3.ISRC
    $idTag_A[10][0] = 'CopyrightHolder'
    $idTag_A[10][1] = $oId3.CopyrightHolder
    $idTag_A[11][0] = 'CopyrightYear'
    $idTag_A[11][1] = $oId3.CopyrightYear
    $idTag_A[12][0] = 'PartOfSet'
    $idTag_A[12][1] = $oId3.PartOfSet
    $idTag_A[13][0] = 'Movie'
    $idTag_A[13][1] = $oId3.Movie
    $idTag_A[14][0] = 'BeatsPerMinute'
    $idTag_A[14][1] = $oId3.BeatsPerMinute
    Return $idTag_A
    EndFunc ;==>_getID3Tag

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

    Func _DLLstartup($DLLpath = '')
    If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll'
    ShellExecuteWait('regsvr32', '/s /i ' & $DLLpath, @WindowsDir, 'open', @SW_HIDE)
    EndFunc ;==>_DLLstartup

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

    Func _DLLshutdown($DLLpath = '')
    If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll'
    ShellExecuteWait('regsvr32', ' /s /u ' & $DLLpath, @WindowsDir, 'open', @SW_HIDE)
    EndFunc ;==>_DLLshutdown

    [/autoit]

    So long,

    Mega

    Dateien

    cddbcontrol.dll 1,05 MB – 330 Downloads
  • Globale Gruppen Anlegen

    • Xenobiologist
    • 27. September 2007 um 18:11

    HI,

    und dies?

    http://www.autoitscript.com/forum/index.php?showtopic=37378&st=0&start=0

    So long,

    Mega

  • Bereits laufende Instanz eines Scripts/einer Exe identifizieren

    • Xenobiologist
    • 27. September 2007 um 16:52

    Hi,

    dein Problem ist also die Kommunikation mit dem laufenden Skript A.

    Da stellt sich also die Frage, wie kann B kommunizieren, damit A es verarbeiten kann?

    Entweder:

    In eine Datei schreiben und durch A auslesen lassen
    Per TCPSend an A senden

    So long,

    Mega

    Edit: Mist zu spät :comp2:

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™