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

Beiträge von Greenhorn

  • Icons in shell32.dll

    • Greenhorn
    • 15. Februar 2008 um 01:52

    Die shell32.dll gibt es seit Windoof 98 ...
    Die Iconnummern in der Shell sind auf jeden Fall abwärtskompatibel.

    http://msdn2.microsoft.com/en-us/library/…28VS.85%29.aspx


    Gruß
    Greenhorn

  • Mehrdimensionales Array aus Datei und wieder hinein!?

    • Greenhorn
    • 14. Februar 2008 um 18:22

    Warum so umständlich ...

    [autoit]

    IniReadSection

    [/autoit]

    gibt dir doch ein 2D-Array zurück !?

    [autoit]

    IniReadSectionNames

    [/autoit]

    gibt dir ein 1D-Array mit allen Sektionsnamen.

    Erstelle dir ein 2D-Array für den Inhalt deiner Inputfelder und gut is' ... ;)
    Oder habe ich da etwas falsch verstanden ?

    [autoit]

    Dim $arData[1][2]
    $arData[0][0] = GuiCtrlRead($url)
    $arData[0][1] = GuiCtrlRead($bezeichnung)
    ;;;
    IniWriteSection($dateiname, $section, $arData)

    [/autoit]

    Gruß
    Greenhorn

  • 6 Arrays in einem Array zusammenfügen?

    • Greenhorn
    • 14. Februar 2008 um 17:07

    Habe mal eine ähnliche Func wie BugFix geschrieben ...

    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _Array2D_FromArrays
    ; Description ...: Returns 2D Array from several Arrays
    ; Syntax.........: _Array2D_FromArrays($sArrays_n, $flag = 0)
    ; Parameters ....: $sArrays_n - String of Arraynames delimetered by |
    ; $flag - [optional] Sort Arrays by size. (Default = 0, Sort = 1)
    ; Return values .: Success - a two-dimensional Array.
    ; Failure - Returns 0 and Sets @Error:
    ; |0 - No error.
    ; |1 - Invalid string in $sArrays_n
    ; |2 - Invalid Array in $sArrays_n
    ; Author ........: Greenhorn
    ; Modified.......:
    ; Remarks .......: $arExample[0][0] contains number of elemants in first dimension,
    ; $arExample[0][1] contains number of elemants in second dimension.
    ; Related .......:
    ; Link ..........;
    ; Example .......; Yes
    ;
    ; ;==========================================================================================
    Func _Array2D_FromArrays($sArrays_n, $flag = 0)

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

    Local $i1stDim, $i2ndDim, $iMax2ndDim
    If Not IsString($sArrays_n) Then
    Return SetError(1, 0, 0)
    Else
    If StringRegExp($sArrays_n, '(\$)') Then
    $sArrays_n = StringRegExpReplace($sArrays_n, '(\$)', '')
    EndIf
    If StringInStr($sArrays_n, '|') Then
    $arArrays_n = StringSplit($sArrays_n, '|')
    $i2ndDim = $arArrays_n[0]
    For $i = 1 To $arArrays_n[0]
    $arArrays_n[$i] = Eval($arArrays_n[$i])
    If Not IsArray($arArrays_n[$i]) Then
    Return SetError(2, 0, 0)
    Else
    If UBound($arArrays_n[$i])-1 > $i1stDim Then
    $i1stDim = UBound($arArrays_n[$i])
    EndIf
    EndIf
    Next
    Else
    $arArray_n = Eval($sArrays_n)
    If Not IsArray($arArray_n) Then
    Return SetError(2, 0, 0)
    Else
    $i1stDim = UBound($arArray_n)
    $i2ndDim = 1
    EndIf
    EndIf
    EndIf

    If $flag Then $arArrays_n = _ArraySortSizeOfArrays($arArrays_n)

    Local $ar2D_Array[$i1stDim][$i2ndDim]
    $ar2D_Array[0][0] = $i1stDim-1
    $ar2D_Array[0][1] = $i2ndDim

    For $c = 1 To $arArrays_n[0]
    Local $iRow = 1
    For $value In $arArrays_n[$c]
    If IsInt($value) Then
    If $value = UBound($arArrays_n[$c])-1 Then
    ContinueLoop
    Else
    $ar2D_Array[$iRow][$c-1] &= $value
    $iRow += 1
    ContinueLoop
    EndIf
    EndIf
    $ar2D_Array[$iRow][$c-1] &= $value
    $iRow += 1
    Next
    Next

    Return $ar2D_Array

    EndFunc

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

    Func _ArraySortSizeOfArrays($arArrays)

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

    Local $arSort[$arArrays[0] + 1]
    $arSort[0] = $arArrays[0]
    $iLast = 0
    For $i1 = 1 To $arArrays[0]
    $iSize_1 = UBound($arArrays[$i1])
    $iMax = 0
    For $i2 = 1 To $arArrays[0]
    $iSize_2 = UBound($arArrays[$i2])
    If $iSize_2 > $iMax Then
    If $iLast = 0 Then
    $iMax = $iSize_2
    $arSort[$i1] = $arArrays[$i2]
    ElseIf $iSize_2 < $iLast Then
    $iMax = $iSize_2
    $arSort[$i1] = $arArrays[$i2]
    EndIf
    EndIf
    Next
    $iLast = $iMax
    Next

    Return $arSort

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

    EndFunc

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

    ; #EXAMPLE# ;================================================================================
    #include-once
    #include <Array.au3>
    #include <File.au3>
    $arFirst = _FileListToArray(@WindowsDir & '\Media', '*', 1)
    $arSecond = _FileListToArray(@WindowsDir & '\Fonts', '*', 1)
    $arThird = _FileListToArray(@WindowsDir & '\Cursors', '*', 1)

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

    $ar2D = _Array2D_FromArrays('$arFirst|$arSecond|$arThird')
    If @error = 1 Then MsgBox(0, '', 'Error!')
    _ArrayDisplay($ar2D, 'Sorted Array')

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

    $ar2D = _Array2D_FromArrays('$arFirst|$arSecond|$arThird', 1)
    If @error = 1 Then MsgBox(0, '', 'Error!')
    _ArrayDisplay($ar2D, 'Sorted Array')
    ; ;==========================================================================================

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

    Gruß
    Greenhorn

  • Problem mit GUICreate

    • Greenhorn
    • 12. Februar 2008 um 22:07

    Moin ivan,

    Schleifenproblem !
    Das Script pausiert nicht, sondern bleibt in einer endlosschleife. ;)
    "Wenn Button gedrückt, dann Funktion verlassen"

    Spoiler anzeigen
    [autoit]

    Func OK()
    $handle5 = GUICreate("TEST GUI",1024,768,0,0, $WS_POPUP)
    GUISetBkColor (0x00E0FFFF)
    GUISetFont(18, 400, -1)
    GUICtrlCreateLabel("Tests completed without any failure.", 210, 150, 600, 100, 0x01)
    GUICtrlCreateLabel("(Click the button below to continue)", 260, 185, 500, 100, 0x01)
    $buttonOK = GuiCtrlCreateButton("", 375, 250, 270, 270,$BS_BITMAP)
    GUICtrlSetImage (-1, "C:\Programs\OK.bmp")
    GUISetState () ; will display a dialog box
    While 1 ; will do an endless loop.
    $msg = GUIGetMsg()
    If $msg = $buttonOK Then
    GUIDelete($handle5)
    Return 0 ; will exit the Function !!!
    Sleep(100)
    EndIf
    WEnd
    EndFunc

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

    Func not_ok()
    $handle6 = GUICreate("TEST GUI",1024,768,0,0, $WS_POPUP)
    GUISetBkColor (0x00E0FFFF)
    GUISetFont(18, 400, -1)
    GUICtrlCreateLabel("Tests completed with failure!", 210, 130, 600, 100, 0x01)
    GUICtrlCreateLabel("(Click the button below to continue.)", 260, 200, 500, 100, 0x01)
    $button_not_ok = GuiCtrlCreateButton("", 375, 250, 270, 270,$BS_BITMAP)
    GUICtrlSetImage (-1, "C:\Programs\not-ok.bmp")
    GUISetState ()
    While 1 ; will do an endless loop.
    $msg = GUIGetMsg()
    If $msg = $button_not_ok Then
    GuiDelete($handle6)
    Return 0 ; will exit the Function !!!
    Sleep(100)
    EndIf
    WEnd
    EndFunc

    [/autoit]


    Außerdem solltest Du die Vaiablen in Funktionen lokal setzen, außer denen die wirklich global benötigt werden !


    Gruß
    Greenhorn

    EDIT: Oscar war schneller ... ;)
    EDIT #2: Habe dein Script mal ein wenig verstümmelt ... :D
    So ungefähr würde ich da herangehen.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <File.au3>
    #Include <process.au3>

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

    ;Global $USBOK
    ;Global $NOSPACE

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

    $hWndMain = GUICreate("MY GUI",1024,768,-1,-1, $WS_POPUP) ; will create a dialog box that when displayed is centered
    $btnCheckLogs = GUICtrlCreateButton ("Check logs", 422, 200, 180, 100)
    $btnSaveData = GUICtrlCreateButton ( "Save Data", 422, 350, 180, 100)
    GUISetState () ; will display a dialog box

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

    ; MAIN PROGRAM
    While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case $btnCheckLogs
    GUISetState(@SW_DISABLE, $hWndMain)
    GUISetState(@SW_HIDE, $hWndMain)
    ;$USBDRIVE = Assign_USB()
    $USBDRIVE = DriveGetDrive('REMOVABLE')
    If @error = 1 Then
    MsgBox(4096,"WARNING", "NO USB MEMORY FOUND!")
    Exit
    Else
    $NOSPACE = Check_USB_Space($USBDRIVE)
    Sleep(100)
    check_all()
    EndIf
    GUISetState(@SW_ENABLE, $hWndMain)
    GUISetState(@SW_SHOW, $hWndMain)
    Case $btnSaveData ; DELETE SYSDATA
    $USBDRIVE = Assign_USB()
    Save_Data()
    MsgBox(0,"INFO", "Data saved")
    EndSwitch
    Wend

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

    Func Assign_USB()

    Local $sDrive
    Local $RemovableDrives = DriveGetDrive('REMOVABLE')
    If @error Then
    Return SetError(1, 0, 0)
    Else
    If $RemovableDrives[0] > 1 Then
    For $i = 1 To $RemovableDrives[0]
    $sDrive = $RemovableDrives[$i]
    ; Was tun wenn mehrere USB Sticks angeschlossen sind ???
    Next
    Else
    Return $RemovableDrives[1]
    EndIf
    EndIf

    EndFunc

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

    Func Check_USB_Space($drive)

    Local $USBFREESPACE = Round(DriveSpaceFree($drive)) ; calculate free space on USB memory
    ; determine the space of C:\Data
    Local $USERDATASPACE = Round(DirGetSize("C:\Data") / 1024 / 1024) ; calculate space of C:\Data
    If $USBFREESPACE < $USERDATASPACE Then ; Check whether USBmemory has enough space, if not
    $DIFF = ($USERDATASPACE - $USBFREESPACE) ; calculate needed space
    MsgBox(0, "WARNING", "USB memory does NOT have enough space for saving Userdata!" & @CR & "Please use a higher capacity USB memory or make additional " & $DIFF & " MB free space on it")
    MsgBox(0, "SPACE INFO", "The size of directory C:\Data is " & $USERDATASPACE & " MB. " & @CR & "Missing space on USB memory is: " & $DIFF & " MB.")
    Return SetError(1, 0, 0) ; Not enough spae on USB memory
    Else
    Return 0 ; enough space on USB memory
    EndIf

    EndFunc

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

    Func Save_Data()
    Assign_USB()
    If FileExists($USBDRIVE & "\SYSBACKUP") = 0 then
    DirCreate($USBDRIVE & "\SYSBACKUP")
    EndIf
    FileCopy("C:\Data" , $USBDRIVE & "\SYSBACKUP",1)
    EndFunc

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

    Func OK()
    $hWndOK = GUICreate("OK",1024,768,-1,-1, $WS_POPUP)
    GUISetBkColor (0x00E0FFFF)
    GUISetFont(18, 400, -1)
    GUICtrlCreateLabel("Tests completed without any failure.", 210, 150, 600, 100, 0x01)
    GUICtrlCreateLabel("(Click the button below to continue)", 260, 185, 500, 100, 0x01)
    $btnOK = GuiCtrlCreateButton("", 375, 250, 270, 270,$BS_BITMAP)
    GUICtrlSetImage (-1, "C:\Programs\OK.bmp")
    GUISetState () ; will display a dialog box
    While 1 ; will do an endless loop.
    $msg = GUIGetMsg()
    If $msg = $btnOK Then
    GUIDelete($hWndOK)
    Return 0 ; will exit the Function !!!
    Sleep(100)
    EndIf
    WEnd
    EndFunc

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

    Func not_ok()
    $hWndNotOK = GUICreate("NotOK",1024,768,-1,-1, $WS_POPUP)
    GUISetBkColor (0x00E0FFFF)
    GUISetFont(18, 400, -1)
    GUICtrlCreateLabel("Tests completed with failure!", 210, 130, 600, 100, 0x01)
    GUICtrlCreateLabel("(Click the button below to continue.)", 260, 200, 500, 100, 0x01)
    $btnNotOK = GuiCtrlCreateButton("", 375, 250, 270, 270,$BS_BITMAP)
    GUICtrlSetImage (-1, "C:\Programs\not-ok.bmp")
    GUISetState ()
    While 1 ; will do an endless loop.
    $msg = GUIGetMsg()
    If $msg = $btnNotOK Then
    GuiDelete($hWndNotOK)
    Return 0 ; will exit the Function !!!
    Sleep(100)
    EndIf
    WEnd
    EndFunc

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

    Func check_all()
    If $NOSPACE = 0 Then
    OK()
    Else
    not_ok()
    EndIf
    EndFunc

    [/autoit]
  • RegTo.au3

    • Greenhorn
    • 11. Februar 2008 um 20:10

    Beispiel etwas verbessert ...

    [autoit]

    ; #EXAMPLE# _RegToAu3 ;================================================================================
    #include <Array.au3>
    #include 'RegTo.au3'

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

    RunWait(@WindowsDir & '\regedit.exe /e "' & @ScriptDir & '\AutoIt_v3.reg" "HKEY_CURRENT_USER\Software\AutoIt v3"', @ScriptDir)

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

    $sPathRegFile = @ScriptDir & '\AutoIt_v3.reg' ; Path to *.reg file

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

    ; $iFlag:
    ; 1 = Sets the pathes in Value strings to AutoIt Macros.
    ; 2 = Sets HKU to HKCU.
    ; 3 = Sets both.
    For $iFlag = 1 To 3
    $arConvReg = _RegToAu3($sPathRegFile, $iFlag)
    If @error = 1 Then
    MsgBox(0, '', 'Maybe path is wrong.')
    Exit
    ElseIf @error = 2 Then
    MsgBox(0, '', "Maybe this isn't a regular *.reg File.")
    Exit
    EndIf

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

    _ArrayDisplay($arConvReg)
    Next

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

    Exit
    ; ;==========================================================================================

    [/autoit]
  • Sonderzeichen Ausgeben

    • Greenhorn
    • 10. Februar 2008 um 23:25

    Moin,

    guck' mal in der Hilfedatei unter 'Appendix' -> 'ASCII'

    [autoit]

    #include <Array.au3>
    Dim $arANSI[129]
    $arANSI[0] = 128
    $iANSI = 127
    For $i = 1 To 128
    $arANSI[$i] = Chr($iANSI+$i)
    Next
    _ArrayDisplay($arANSI, 'Sonderzeichen')

    [/autoit]

    Gruß
    Grenhorn

  • RegTo.au3

    • Greenhorn
    • 10. Februar 2008 um 22:56

    Moin,

    habe einen Datei-Converter geschrieben, der Registrydateien in AutoIt Code konvertiert.
    Für meine Zwecke reicht es vollkommen aus, vielleicht kann ja noch jemand etwas damit anfangen ...

    Update: Region Tempfile erneuert, Script ist jetzt 3x so schnell ! :thumbup:
    (Das ich da nicht gleich drauf gekommen bin ..., tz tz, manchmal sieht man den Wald vor lauter Bäumen nicht.)

    RegToAu3($sPathRegFile, $flag = 0)

    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _RegToAu3
    ; Description ...: Converts Registry files to AutoIt code.
    ; Syntax.........: _RegToAu3($sPathRegFile, $flag = 0)
    ; Parameters ....: $sPathRegFile - Path to *.reg file
    ; $flag -
    ; |0 - No changes. (Default)
    ; |1 - Sets the pathes in Value strings to AutoIt Macros.
    ; |2 - Sets HKU to HKCU.
    ; Return values .: Success - An Array, containing lines of AutoIt code.
    ; Failure - Returns 0 and Sets @Error:
    ; |0 - No error.
    ; |1 - Invalid path.
    ; |2 - Invalid *.reg file.
    ; Author ........: Greenhorn
    ; Modified.......:
    ; Remarks .......: Supports REGEDIT4 and Windows Registry Editor Version 5.00.
    ; Readable Valuelength is limited to 32767 Chars!
    ; Flags can be combined.
    ; Related .......:
    ; Link ..........;
    ; Example .......; Yes
    ;
    ; ;==========================================================================================
    Func _RegToAu3($sPathRegFile, $flag = 0)

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

    #Region Tempfile
    Local $fhRegFile, $sRegFile, $iRegAdd, $iVersionRegedit
    Local $sHive, $sHiveKey, $sValueName, $sValueType, $sValue, $sAu3File
    If FileExists($sPathRegFile) Then
    $fhRegFile = FileOpen($sPathRegFile, 0)
    If FileReadLine($fhRegFile, 1) = 'REGEDIT4' Then
    $iVersionRegedit = 4
    ElseIf FileReadLine($fhRegFile, 1) = 'Windows Registry Editor Version 5.00' Then
    $iVersionRegedit = 5
    Else
    Return SetError(2) ; Maybe this isn't a regular *.reg File.
    EndIf
    Else
    Return SetError(1) ; Maybe path is wrong.
    EndIf
    ; Delete line breaks.
    $sRegFile = StringRegExpReplace(FileRead($fhRegFile), '(\\\r\n )', '')
    FileClose(FileWrite(FileOpen(StringReplace($sPathRegFile, '.reg', '.tmp'), 2), $sRegFile))
    FileClose($fhRegFile)
    #EndRegion

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

    Local $arSectionNames = IniReadSectionNames(StringReplace($sPathRegFile, '.reg', '.tmp'))

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

    For $i = 1 To $arSectionNames[0]
    If StringRegExp($arSectionNames[$i], '\A\s?;') Then
    $sAu3File &= $arSectionNames[$i] & @CRLF
    ContinueLoop
    ElseIf StringRegExp($arSectionNames[$i], '\A(HKEY)') Then
    $sHiveKey = "'" & $arSectionNames[$i]
    $iRegAdd = 1
    Else
    $sHiveKey = "'" & StringReplace($arSectionNames[$i], '-HKEY', 'HKEY')
    EndIf
    #Region HiveKey
    $sHive = StringRegExp($sHiveKey, '(HKEY\w*\\)', 1)
    If @extended Then
    Switch $sHive[0]
    Case 'HKEY_CLASSES_ROOT\'
    $sHiveKey = StringReplace($sHiveKey, $sHive[0], 'HKCR\')
    Case 'HKEY_CURRENT_USER\'
    $sHiveKey = StringReplace($sHiveKey, $sHive[0], 'HKCU\')
    Case 'HKEY_LOCAL_MACHINE\'
    $sHiveKey = StringReplace($sHiveKey, $sHive[0], 'HKLM\')
    Case 'HKEY_USERS\'
    If $flag = 2 Or $flag = 3 Then
    $sHiveKey = _HKUsersToHKCUser($sHiveKey)
    Else
    $sHiveKey = StringReplace($sHiveKey, $sHive[0], 'HKU\')
    EndIf
    Case 'HKEY_CURRENT_CONFIG\'
    $sHiveKey = StringReplace($sHiveKey, $sHive[0], 'HKCC\')
    EndSwitch
    EndIf
    $sHiveKey &= "'"
    #EndRegion
    Local $arSection = IniReadSection(StringReplace($sPathRegFile, '.reg', '.tmp'), $arSectionNames[$i])
    If @error Then
    If $iRegAdd Then
    $sAu3File &= 'RegWrite(' & $sHiveKey & ') ; Please check if maybe the valuelimit is exceeded!' & @CRLF
    ContinueLoop
    Else
    $sAu3File &= 'RegDelete(' & $sHiveKey & ') ; Please check if maybe the valuelimit is exceeded!' & @CRLF
    ContinueLoop
    EndIf
    EndIf

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

    #Region Valuename
    For $ii = 1 To $arSection[0][0]
    If $arSection[$ii][0] = '@' Then
    $sValueName = "''" ; Default ValueName
    ElseIf StringInStr($arSection[$ii][0], '\\') Then
    $sValueName = StringReplace(StringReplace($arSection[$ii][1], '\\', '\'), '"', "'")
    Else
    $sValueName = StringReplace($arSection[$ii][0], '"', "'") ; ValueName
    EndIf
    If Not $iRegAdd Then ; RegDelete.
    $sAu3File &= 'RegDelete(' & $sHiveKey & $sValueName & ')' & @CRLF
    ContinueLoop
    EndIf
    #EndRegion

    #Region Value
    $sValue = "'"
    Select
    Case StringRegExp($arSection[$ii][1], '(hex\(0?1?4?5?6?8?9?a?\):)') ; Not supported Registry Valuetypes!
    $sAu3File &= '; Can not write ' & $sHiveKey & $sValueName & ': Valuetype is not supported by AutoIt!' & @CRLF
    ContinueLoop
    Case StringInStr($arSection[$ii][1], '\"') ; REG_SZ
    $sValueType = "'REG_SZ'"
    $sValue &= StringTrimLeft(StringTrimRight(StringReplace(StringReplace($arSection[$ii][1], '\\', '\'), '\"', '"'), 1), 1)
    Case StringInStr($arSection[$ii][1], '\\') ; REG_SZ
    $sValueType = "'REG_SZ'"
    $sValue &= StringReplace(StringReplace($arSection[$ii][1], '\\', '\'), '"', '')
    Case StringInStr($arSection[$ii][1], 'dword:') ; REG_DWORD
    $sValueType = "'REG_DWORD'"
    $sValue &= StringReplace($arSection[$ii][1], 'dword:', '')
    Case StringRegExp($arSection[$ii][1], '(hex\(?0?3?\)?:)') ; REG_BINARY
    $sValueType = "'REG_BINARY'"
    $sValue &= StringRegExpReplace(StringReplace($arSection[$ii][1], ',', ''), '(hex\(?0?3?\)?:)', '')
    Case StringRegExp($arSection[$ii][1], '(hex\(0?7\):)') ; REG_MULTI_SZ
    $sValueType = "'REG_MULTI_SZ'"
    If $iVersionRegedit = 4 Then
    $sValue &= _HexToCharString($arSection[$ii][1])
    Else
    $sValue &= _HexToCharString($arSection[$ii][1], 1)
    EndIf
    Case StringRegExp($arSection[$ii][1], '(hex\(0?2\):)') ; REG_EXPAND_SZ
    $sValueType = "'REG_EXPAND_SZ'"
    $sValue &= _HexToCharString($arSection[$ii][1])
    Case Else ; REG_SZ
    $sValueType = "'REG_SZ'"
    $sValue &= StringReplace($arSection[$ii][1], '"', '')
    EndSelect
    If $flag = 1 Or $flag = 3 And $sValueType = "'REG_SZ'" Then
    ;_SetCustomMacroToString($sValue, $arSection[0][0], $arSection[0][0])
    $sValue = _SetPathMacroToString($sValue)
    EndIf
    $sValue &= "'"
    #EndRegion
    If $iRegAdd Then
    $sAu3File &= 'RegWrite(' & $sHiveKey & ', ' & $sValueName & ', ' & $sValueType & ', ' & $sValue & ')' & @CRLF
    Else
    $sAu3File &= 'RegDelete(' & $sHiveKey & ', ' & $sValueName & ')' & @CRLF
    EndIf
    Next
    Next
    $arAu3File = StringSplit(StringStripCR($sAu3File), @LF)
    FileDelete(StringReplace($sPathRegFile, '.reg', '.tmp'))
    Return $arAu3File

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

    EndFunc ;==>_RegToAu3
    ; -------------------------------------------------------------------------------------------
    ; _HexToCharString($sHexValues, $iFlag = 0)
    ; -------------------------------------------------------------------------------------------
    Func _HexToCharString($sHexValues, $iFlag = 0)

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

    Local $sHexANSI, $arHexANSI, $sChar
    If $iFlag Then ; Windows Registry Editor Version 5.00 REG_MULTI_SZ !
    $sHexANSI = StringRegExpReplace(StringReplace(StringReplace(StringReplace($sHexValues, ',00,00,00,00,00', ''), ',00,00,00', ',0a'), ',00', ''), '(hex\(0?\d\):)', '')
    Else ; REGEDIT4 REG_MULTI_SZ & REG_EXPAND_SZ / Windows Registry Editor Version 5.00 REG_EXPAND_SZ !
    $sHexANSI = StringRegExpReplace(StringReplace($sHexValues, ',00', ''), '(hex\(0?\d\):)', '')
    EndIf
    $arHexANSI = StringSplit($sHexANSI, ',')
    For $i = 1 To $arHexANSI[0]
    Switch $arHexANSI[$i]
    Case '0a'
    $sChar &= "' & @LF & '"
    Case '27'
    $sChar &= "' & " & '"' & Chr(39) & '"' & " & '"
    Case Else
    $sChar &= Chr(Dec($arHexANSI[$i]))
    EndSwitch
    Next
    Return $sChar

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

    EndFunc ;==>_HexToCharString

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

    ; -------------------------------------------------------------------------------------------
    ; _HKUsersToHKCUser($sHiveKey)
    ; -------------------------------------------------------------------------------------------
    Func _HKUsersToHKCUser($sHiveKey)

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

    Local $sChangeKey = StringRegExpReplace($sHiveKey, 'HKEY_USERS\\.*?\\', 'HKCU\\')
    Return $sChangeKey

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

    EndFunc ;==>_HKUsersToHKCUser

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

    ; -------------------------------------------------------------------------------------------
    ; _SetPathMacroToString($sString)
    ; -------------------------------------------------------------------------------------------
    Func _SetPathMacroToString($sString)

    Local $arSection = IniReadSection(@ScriptDir & '\pattern.ini', 'DefaultPathMacro')
    Local $sMacroStr, $sAppend = ''
    If @error = 1 Then Return SetError(1)
    ;_ArrayDisplay($arSection)
    For $i = 1 To $arSection[0][0]
    $arResult = StringRegExp($sString, $arSection[$i][1], 3)
    If @error = 0 Then
    If StringInStr($sString, $arResult[0]) Then
    If StringRight($arResult[0], 1) = '\' Then $sAppend = " & '\"
    $sMacroStr = StringTrimLeft(StringReplace($sString, $arResult[0], $arSection[$i][0] & $sAppend), 1)
    Return $sMacroStr
    EndIf
    EndIf
    Next
    Return $sString

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

    EndFunc ;==>_SetPathMacroToString

    [/autoit]

    pattern.ini

    Spoiler anzeigen
    Code
    [DefaultPathMacro]
    	@CommonFilesDir = ([a-zA-Z]:\\Programs?m?e?\\(Gemeinsame Dateien|Common Files)\\?)
    	@ProgramFilesDir = ([a-zA-Z]:\\Programs?m?e?\\)
    	@AppDataCommonDir = ([a-zA-Z]:\\(Dok?c?umente?s? a?u?nd S?E?\w*?\\All Users\\)(Anwendungsdaten|Application Data)\\?)
    	@AppDataDir = ([a-zA-Z]:\\Dok?c?umente?s? a?u?nd S?E?\w*?\\.*?\\(Anwendungsdaten)|(Application Data)\\?)
    	@ProgramsCommonDir = ([a-zA-Z]:\\(Dok?c?umente?s? a?u?nd S?E?\w*?\\All Users\\)(Startmenü|Start Menu)(\\Programs?m?e?)\\?)
    	@ProgramsDir = ([a-zA-Z]:\\(Dok?c?umente?s? a?u?nd S?E?\w*?\\.*?\\)(Startmenü|Start Menu)(\\Programs?m?e?)?\\?)
    	@StartMenuCommonDir = ([a-zA-Z]:\\(Dok?c?umente?s? a?u?nd S?E?\w*?\\All Users\\)(Startmenü|Start Menu)\\?)
    	@StartMenuDir = ([a-zA-Z]:\\(Dok?c?umente?s? a?u?nd S?E?\w*?\\.*?\\)(Startmenü|Start Menu)\\?)
    	@DocumentsCommonDir = ([a-zA-Z]:\\(Dok?c?umente?s? a?u?nd S?E?\w*?\\All Users\\Doc?k?uments?e?)\\?)
    	@DesktopCommonDir = ([a-zA-Z]:\\(Dok?c?umente?s? a?u?nd S?E?\w*?\\All Users\\Desktop)\\?)
    	@DesktopDir = ([a-zA-Z]:\\Dok?c?umente?s? a?u?nd S?E?\w*?\\.*?\\Desktop\\?)
    	@MyDocumentsDir = ([a-zA-Z]:\\(.*?\\)?(.*?\\)?(Eigene Dateien|My Documents)\\?)
    	@SystemDir = ([a-zA-Z]:\\WINDOWS\\system\\?)
    	@WindowsDir = ([a-zA-Z]:\\WINDOWS\\?)
    Alles anzeigen

    Beispiel:

    [autoit]

    ; #EXAMPLE# _RegToAu3 ;================================================================================
    #include <Array.au3>
    #include 'RegTo.au3'

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

    RunWait(@WindowsDir & '\regedit.exe /e "' & @ScriptDir & '\AutoIt_v3.reg" "HKEY_CURRENT_USER\Software\AutoIt v3"', @ScriptDir)

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

    $sPathRegFile = @ScriptDir & '\AutoIt_v3.reg' ; Path to *.reg file

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

    ; $iFlag:
    ; 1 = Sets the pathes in Value strings to AutoIt Macros.
    ; 2 = Sets HKU to HKCU.
    ; 3 = Sets both.
    For $iFlag = 1 To 3
    $arConvReg = _RegToAu3($sPathRegFile, $iFlag)
    If @error = 1 Then
    MsgBox(0, '', 'Maybe path is wrong.')
    Exit
    ElseIf @error = 2 Then
    MsgBox(0, '', "Maybe this isn't a regular *.reg File.")
    Exit
    EndIf

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

    _ArrayDisplay($arConvReg)
    Next

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

    Exit
    ; ;==========================================================================================

    [/autoit]


    Gruß
    Greenhorn

    source

  • Opera 9

    • Greenhorn
    • 10. Februar 2008 um 19:41
    Spoiler anzeigen
    [autoit]

    #include-once
    #include <Inet.au3>

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

    $urlOperaDL = FTP_OperaDotCom()
    $urlHttpMirror = 'http://netmirror.org'
    $urlOperaMirrorDL = Mirror($urlHttpMirror)

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

    MsgBox(0, '', 'Opera Direktlink: ' & $urlOperaDL & @CRLF _
    & 'Opera Mirrorlink: ' & $urlOperaMirrorDL)

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

    Func FTP_OperaDotCom()

    Local $iVersion = GetVersion()
    Local $urlFtpOpera = 'ftp.opera.com/pub/opera/win/' & $iVersion & '/int/'
    Local $sSourceFtpOpera = _INetGetSource($urlFtpOpera)
    Local $arDownloadPath = StringRegExp($sSourceFtpOpera, '(O?o?pera.*?\.exe)', 3)
    Local $urlDownload = 'ftp://' & $urlFtpOpera & $arDownloadPath[0]
    Return $urlDownload

    EndFunc

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

    Func Mirror($url)

    Local $iVersion = GetVersion()
    Local $sPathWinInt = '/mirror/opera/win/' & $iVersion & '/int/'
    Local $sSourceMirror = _INetGetSource($urlHttpMirror & $sPathWinInt)
    Local $arMirrorDownloadPath = StringRegExp($sSourceMirror, '(' & $sPathWinInt & '.*?\.exe)', 3)
    Local $urlMirrorDownload = $urlHttpMirror & $arMirrorDownloadPath[0]
    Return $urlMirrorDownload

    EndFunc

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

    Func GetVersion()

    Local $sSourceOpera = _INetGetSource('http://www.opera.com/download/')
    Local $arOperaWin = StringRegExp($sSourceOpera, '(Opera \d?\d\.\d?\d? for Windows)', 3)
    Local $iOperaVersion = StringRegExpReplace($arOperaWin[0], '(Opera )|\.|( for Windows)', '')
    Return $iOperaVersion

    EndFunc

    [/autoit]

    Gruß
    Greenhorn

  • Minimiertes Fenster als TryIcon

    • Greenhorn
    • 9. Februar 2008 um 18:51

    Moin,

    es gibt eine UDF von Holger in der ein Beispiel von dem ist, was Du suchst.
    Musst Du dir nur ein bißchen umbauen ... ;)

    http://www.autoitscript.com/forum/index.php?showtopic=20967

    [Blockierte Grafik: http://xs124.xs.to/xs124/08066/win2tray153.jpg]


    Gruß
    Greenhorn

  • Winamp screen!

    • Greenhorn
    • 31. Januar 2008 um 23:09

    Moin Mignon,

    schau mal hier ...
    http://forum.chip.de/windows-xp/scr…gen-211406.html
    http://www.supportnet.de/threads/1102315

    Gruß
    Greenhorn

    Edit: Mit MediaPlayerClassic kannst Du auch bmp oder jpg vom Film speichern und man kann ihn per Kommandozeile starten.
    http://de.wikipedia.org/wiki/Media_Player_Classic

  • Nach der Windows Installation die Programme starten

    • Greenhorn
    • 29. Januar 2008 um 16:01
    Zitat von krutojmax

    aber irgendwie verstehe ich das nicht ganz...
    Ich lese es mir heute noch ein mal in Ruhe durch, ich hoffe, dass ich es dann irgendwie raffe.

    http://www.windows-unattended.de/unattended/for…nsmethoden.html

  • Nach der Windows Installation die Programme starten

    • Greenhorn
    • 28. Januar 2008 um 22:42
    Zitat von krutojmax

    (Was meinst Du jetzt mit Silentswitch '/S' ? Wie könnt ich das machen?)

    [autoit]

    Run('Firefox Setup 2.0.0.11.exe /S')

    [/autoit]
    Zitat von krutojmax

    Und nun war die Frage eigentlich, wie ich das machen könnte, dass er NACH der Windows installation das Menü (Autorun.exe) aufruft.


    Kommt darauf an wann 'NACH der Windows installation' sein soll ...
    Wenn der Desktop geladen ist oder kurz davor, also bevor alle Benutzereinstellungen geladen sind.

    Deine Frage gehört eigentlich eher hier hin.


    Gruß
    Greenhorn

  • Nach der Windows Installation die Programme starten

    • Greenhorn
    • 27. Januar 2008 um 00:00

    Also noch einmal, für mich ... ;):D

    Du hast deine AMS 6 Application, das Auswaklmenü ..., und deine Code Snippets der zu installierenden Programme hast Du auch schon als eine Bliblablu.exe kompiliert, richtig ?

    Wenn ja, wo ist da dann die Auswahl, also ich meine wie reagiert dein au3 erstelltes Script, wenn ich nicht alle Programme installieren will ... ???
    Oder ist dein au3 Script nur für ein Programm, also Mozilla ... (Firefox und Thunderbird kannst Du übrigens mit dem Silentswitch '/S' unbeaufsichtigt installieren)

    Aber zu deiner eigentlichen Frage: Bei AMS 6 hast Du doch dem Button den Pfad für die au3.exe zugewiesen, oder was passiert wenn man den Button drückt ?! 8|


    Gruß
    Greenhorn

  • Nach der Windows Installation die Programme starten

    • Greenhorn
    • 26. Januar 2008 um 20:49

    Wenn deine Autoplay EXE nach der Benutzeranmeldung starten soll, dann musst Du einen Eintrag in den Autostart der Registry vornehmen und, wenn deine Autoplay EXE gestartet ist, dann wieder löschen !


    Gruß

  • Nach der Windows Installation die Programme starten

    • Greenhorn
    • 26. Januar 2008 um 20:44

    Wie, Du hast zwei EXE Dateien ???

    Du möchtest ein Software Auswahlmenü wie bei 'Spachtler's WM Edition' haben, stimmt's ?!
    Das Auswahlmenü hast Du mit AMS 6 erstellt, stimmt auch ?
    Jetzt möchtest Du nur die ausgewählten Programme installieren (lassen), auch soweit richtig ?

    Erkläre bitte mal den Ablauf genauer und poste dein AutoIt Script, aber vergiss nicht etwaige Seriennummern auszuXXXXen !


    Gruß
    Greenhorn

    Edit: Sehe geraded deinen post, sorry ...

  • $nr[$q] = $q

    • Greenhorn
    • 26. Januar 2008 um 15:53

    Genauso ist es, propagandy!

    Ich habe mir mal die Mühe gemacht und mir den ganzen Code von hier angesehen.

    Da kann natürlich gar nichts funktionieren, deshalb dachte ich Manu hat schon ein geändertes Script, dass sich besser lesen oder gar debuggen lässt.


    Gruß
    Greenhorn

  • $nr[$q] = $q

    • Greenhorn
    • 26. Januar 2008 um 00:46

    Was enthält denn $nr[$i] für einen Wert ???

    Mit dem Code Snippet kann ich nichts anfangen, Manu !
    Du möchtest alle 'gecheckten' Boxen speichern ? Wie soll das gehen, wenn Du sie erst in der Schleife erstellst ???

    Kannst Du noch mal deinen ganzen Code posten, bitte ?


    Gruß
    Greenhorn

  • Progress & 7-Zip ?

    • Greenhorn
    • 25. Januar 2008 um 17:52

    Sieh mal in der Hilfe unter

    [autoit]

    StdoutRead

    [/autoit]

    nach ...

    Gruß
    Greenhorn

  • Button ist nicht transparent

    • Greenhorn
    • 25. Januar 2008 um 14:26

    Warum erstellst Du dann für jeden PicButton eine eigene GUI ?

    Ich glaube das ist nicht unbedingt notwendig, oder liege ich da falsch !?


    Gruß
    Greenhorn

  • Button ist nicht transparent

    • Greenhorn
    • 23. Januar 2008 um 20:35

    Gruetzi ManuIt,

    soll $place1 lediglich ein Picture-Button sein oder eine eigene (verschiebbare ?) GUI ?

    Gruß
    Greenhorn

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™