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

Beiträge von BugFix

  • Feiertage

    • BugFix
    • 2. Februar 2010 um 21:48

    *hust* Wochentag- Feiertagsermittlung :rolleyes:

  • Tastatur/Maus sperren bzw. verhindern, dass irgendetwas gemacht wird, bis der richtige PIN eingegeben wird

    • BugFix
    • 31. Januar 2010 um 20:54

    Du kannst MousTrap zum Begrenzen der Mausbewegung auf dein Eingabefenster verwenden. Sperre zusätzlich den Taskmanager (Benutze die SuFu, habe dafür mal ein Skript erstellt), damit dein Skript nicht abgeschossen wird, weiterhin mußt du einen Hook auf die Windows- und Menü- Tasten legen (auch SuFu nutzen, Hook-Bsp. hab ich gepostet) und diese Tasten ins Leere laufen lassen.

  • [Suche] Designer

    • BugFix
    • 31. Januar 2010 um 20:05
    Zitat von Conan10

    Kriegen wir denn die Erlaubnis? Sonst nehme ich es wieder raus.


    Ich habe nichts dagegen, wenn meine Skripte geposted werden. Aber ich denke, es gehört zum guten Ton einen Verweis auf den Autor anzubringen. Und das gilt natürlich für Skripte aller Autoren.

  • [Suche] Designer

    • BugFix
    • 31. Januar 2010 um 19:57

    Und wenn dort Skripte von mir gepostet werden, erwarte ich zumindest, dass ich als Autor benannt werde! :cursing: (Bsp. Hex Color List)

  • Syslistview auslesen

    • BugFix
    • 30. Januar 2010 um 15:08

    Da du die Control Class auslesen konntest und auch der Name der Class auf ein Standard-Ctrl schließen läßt, ist die Anwendung der Control-Befehle schon korrekt.
    Ich vermute, das Fenster wird nicht erkannt. Versuche doch mal mit Opt("WinTitleMatchMode", 2) auch die Erkennung von Teilen des Titels zuzulassen.

  • StringAdvanced UDF

    • BugFix
    • 30. Januar 2010 um 14:55

    Hi,
    braucht man sicher ab und an.
    Aber warum die Limitierung auf 256 Zeichen?
    Ich hab mal deine Func _String_GetCharacter etwas umgemodelt und im Bsp. gezeigt, dass auch große Stringlängen kein Problem bereiten.
    Übrigens empfiehlt es sich zur besseren Flexibilität "wchar" zu verwenden.
    Achja: Fehlerrückgabe sollte als @error und numerisch erfolgen.

    [autoit]

    $s = ''
    For $i = 1 To 4096
    $s &= Random(1,9,1)
    Next
    ConsoleWrite('letzter(4096) = ' & StringRight($s,1) & @CRLF)
    ConsoleWrite(_String_GetCharacter($s, 4096) & @CRLF)

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

    Func _String_GetCharacter($s_String, $i_Index)
    Local $len = StringLen($s_String)
    If $i_Index > $len Then Return SetError(1,0,-1)
    Local $c_Struct = DllStructCreate("wchar[" & $len+1 & "]")
    DllStructSetData($c_Struct, 1, $s_String)
    Return DllStructGetData($c_Struct, 1, $i_Index)
    EndFunc

    [/autoit]
  • Suche einfaches Autoit-Tutorial....

    • BugFix
    • 30. Januar 2010 um 13:32
    Zitat von darksider3

    ich hab seit längerem im internet nach guten autoit tutorials gesucht bisher aber keins das für anfänger wierklich geeigtnet wäre.....


    Das kann ich nicht nachvollziehen!
    Vielleicht solltest du dir mal klarmachen, was ein Tut bewirken soll. Du kannst fast jedes Skriptbeispiel in der Hilfe als kleines Tutorial betrachten. Du kannst sehen, wozu Funktionen verwendetet werden und wie die Syntax dazu ist. Was willst du mehr?
    Und die im Forum reichlich vorhandenen Tut's sind auch alle so gehalten, dass man ohne großartige Vorkenntnisse sich dort hineinarbeiten kann.
    Was wir natürlich als Selbstverständlichkeit erachten: dass man die AutoIt-Hilfe intensiv nutzt.

  • Gepinnte Childs

    • BugFix
    • 29. Januar 2010 um 23:35
    Zitat von kleiner27

    Würde das nicht besser sein wenn man das GUI nicht bewegen könnte o. steckt da absicht hinter?


    Das kann man natürlich nach seinem Geschmack anpassen.
    Ziel war eine Möglickeit zu schaffen, ähnlich wie bei Entwickleroberflächen, bedarfsweise Fenster mit z.B. Funktionsinfos o.ä. einblenden zu können.

  • Gepinnte Childs

    • BugFix
    • 29. Januar 2010 um 23:04

    Hi,
    bevor ich wieder ewig nach dem Skript suche, werde ich es mal schnell hier posten. ;)
    Es existiert eine "Pinnleiste" in Form von vertikalen Labels. Über diese Labels wird bei Klick das zugehörige Child ein-/ausgefadet.
    (Kann sein, dass ich es schonmal geposted habe - aber ich finde es nicht mehr ;))

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <WinAPI.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Opt("GUIOnEventMode", 1)

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

    Global Const $AW_SLIDE = 0x40000
    Global Const $AW_HOR_POSITIVE = 0x1 ; left to right
    Global Const $AW_HOR_NEGATIVE = 0x2 ; right to left
    Global Const $AW_ACTIVATE = 0x20000 ; Activates the window
    Global Const $AW_HIDE = 0x10000
    Global Const $iPI = 3.1415926535897932384626433832795
    Global $aChild[3], $aLbl[3], $aGraphics[3], $hWnd, $guiMain, $edit, $closehWnd = 0
    Local $iHTitel = _WinAPI_GetSystemMetrics(4), $iWBorder = _WinAPI_GetSystemMetrics(32)+_WinAPI_GetSystemMetrics(5)
    Local $iWMain = 800, $iHMain = 600, $iWChild = 200, $iHChild = $iHMain-$iHTitel

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

    _GDIPlus_Startup()

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

    $guiMain = GUICreate('Main', $iWMain, $iHMain, -1, -1, Default, $GUI_WS_EX_PARENTDRAG)
    $hWnd = WinGetHandle($guiMain)
    GUISetOnEvent(-3, '_ende')
    $edit = GUICtrlCreateEdit('', 15, 15, $iWMain-50, $iHMain-30)
    $aLbl[0] = GUICtrlCreateLabel('', $iWMain-20, 0, 18, 70)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetOnEvent(-1, "_show")
    $aLbl[1] = GUICtrlCreateLabel('', $iWMain-20, 72, 18, 70)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetOnEvent(-1, "_show")
    $aLbl[2] = GUICtrlCreateLabel('', $iWMain-20, 144, 18, 70)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetOnEvent(-1, "_show")
    $lblBlank = GUICtrlCreateLabel('', $iWMain-20, 216, 18, $iHMain-216)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($guiMain)

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

    $aChild[0] = GUICreate("Child 1", $iWChild, $iHChild-$iWBorder, $iWMain-$iWChild-$iWBorder-21, -21, _
    $WS_CAPTION, $WS_EX_MDICHILD, $guiMain)

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

    $aChild[1] = GUICreate("Child 2", $iWChild, $iHChild-$iWBorder, $iWMain-$iWChild-$iWBorder-21, -21, _
    $WS_CAPTION, $WS_EX_MDICHILD, $guiMain)

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

    $aChild[2] = GUICreate("Child 3", $iWChild, $iHChild-$iWBorder, $iWMain-$iWChild-$iWBorder-21, -21, _
    $WS_CAPTION, $WS_EX_MDICHILD, $guiMain)

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

    GUISetState(@SW_SHOW, $GUImain)

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

    GDIPlus_SetAngledText($hGraphics, 'Pinn 1', 790, 35, 270, "Courier New", 12, 0xFF0000FF)
    GDIPlus_SetAngledText($hGraphics, 'Pinn 2', 790, 107, 270, "Courier New", 12, 0xFF0000FF)
    GDIPlus_SetAngledText($hGraphics, 'Pinn 3', 790, 179, 270, "Courier New", 12, 0xFF0000FF)

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

    While 1
    Sleep(100)
    WEnd

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

    Func _ende()
    Exit
    EndFunc

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

    Func _show()
    Local $ID = @GUI_CtrlId
    For $i = 0 To UBound($aChild) -1
    If ($aLbl[$i] <> $ID) And (WinGetState($aChild[$i]) > 5) Then
    $closehWnd = WinGetHandle($aChild[$i])
    _hide()
    EndIf
    Next
    For $i = 0 To UBound($aChild) -1
    If ($aLbl[$i] = $ID) And (WinGetState($aChild[$i]) > 5) Then
    $closehWnd = WinGetHandle($aChild[$i])
    Return _hide()
    EndIf
    Next
    For $i = 0 To UBound($aLbl) -1
    If $aLbl[$i] = $ID Then _slideIn(WinGetHandle($aChild[$i]))
    Next
    EndFunc

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

    Func _hide()
    Local $hWnd = @GUI_WinHandle
    If $closehWnd Then
    $hWnd = $closehWnd
    $closehWnd = 0
    EndIf
    Return _slideOut($hWnd)
    EndFunc

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

    Func _slideIn($hWnd)
    Local $width = $iWMain-30-$iWChild-$iWBorder-21
    ControlMove($guiMain, '', $edit, 15, 15, $width, $iHMain-30)
    AnimateWindow($hWnd, BitOR($AW_SLIDE, $AW_ACTIVATE, $AW_HOR_NEGATIVE))
    EndFunc

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

    Func _slideOut($hWnd)
    AnimateWindow($hWnd, BitOR($AW_SLIDE, $AW_HIDE, $AW_HOR_POSITIVE))
    Local $width = $iWMain-50
    ControlMove($guiMain, '', $edit, 15, 15, $width, $iHMain-30)
    EndFunc

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

    Func AnimateWindow($hWnd, $dwFlags, $dwTime=100)
    DllCall("user32", 'long', 'AnimateWindow', 'hwnd', $hWnd, 'long', $dwTime, 'long', $dwFlags)
    EndFunc

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

    ; #FUNCTION# ================================================================
    ; Name...........: GDIPlus_SetAngledText
    ; Description ...: Adds text to a graphic object at any angle.
    ; Syntax.........: GDIPlus_SetAngledText($hGraphic, $nText, [$iCentreX, [$iCentreY, [$iAngle , [$nFontName , _
    ; [$nFontSize, [$iARGB, [$iAnchor]]]]]]] )
    ; Parameters ....: $hGraphic - The Graphics object to receive the added text.
    ; $nText - Text string to be displayed
    ; $iCentreX - Horizontal coordinate of horixontal centre of the text rectangle (default = 0 )
    ; $iCentreY - Vertical coordinate of vertical centre of the text rectangle (default = 0 )
    ; $iAngle - The angle which the text will be place in degrees. (default = "" or blank = 0 )
    ; $nFontName - The name of the font to be used (default = "" or Blank = "Arial" )
    ; $nFontSize - The font size to be used (default = "" or Blank = 12 )
    ; $iARGB - Alpha(Transparency), Red, Green and Blue color (0xAARRGGBB) (Default= "" = random color
    ; or Default = Blank = 0xFFFF00FF )
    ; $iAnchor - If zero (default) positioning $iCentreX, $iCentreY values refer to centre of text string.
    ; If not zero positioning $iCentreX, $iCentreY values refer to top left corner of text string.
    ; Return values .: 1
    ; Author ........: Malkey
    ; Modified.......:
    ; Remarks .......: Call _GDIPlus_Startup() before starting this function, and call _GDIPlus_Shutdown()after function ends.
    ; Can enter calculation for Angle Eg. For incline, -ATan($iVDist / $iHDist) * 180 / $iPI , where
    ; $iVDist is Vertical Distance, $iHDist is Horizontal Distance, and, $iPI is Pi, (an added Global Const).
    ; When used with other graphics, call this function last. The MatrixRotate() may affect following graphics.
    ; Related .......: _GDIPlus_Startup(), _GDIPlus_Shutdown(), _GDIPlus_GraphicsDispose($hGraphic)
    ; Link ..........;
    ; Example .......; Yes
    ; ========================================================================================
    Func GDIPlus_SetAngledText($hGraphic, $nText, $iCentreX = 0, $iCentreY = 0, $iAngle = 0, $nFontName = "Arial", _
    $nFontSize = 12, $iARGB = 0xFFFF00FF, $iAnchor = 0)
    Local $x, $y, $iX, $iY, $iWidth, $iHeight
    Local $hMatrix, $iXt, $iYt, $hBrush, $hFormat, $hFamily, $hFont, $tLayout

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

    ; Default values
    If $iAngle = "" Then $iAngle = 0
    If $nFontName = "" Or $nFontName = -1 Then $nFontName = "Arial" ; "Microsoft Sans Serif"
    If $nFontSize = "" Then $nFontSize = 12
    If $iARGB = "" Then ; Randomize ARGB color
    $iARGB = "0xFF" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2)
    EndIf

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

    $hFormat = _GDIPlus_StringFormatCreate(0)
    $hFamily = _GDIPlus_FontFamilyCreate($nFontName)
    $hFont = _GDIPlus_FontCreate($hFamily, $nFontSize, 1, 3)
    $tLayout = _GDIPlus_RectFCreate($iCentreX, $iCentreY, 0, 0)
    $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $nText, $hFont, $tLayout, $hFormat)
    $iWidth = Ceiling(DllStructGetData($aInfo[0], "Width"))
    $iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))

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

    ;Later calculations based on centre of Text rectangle.
    If $iAnchor = 0 Then ; Reference to middle of Text rectangle
    $iX = $iCentreX
    $iY = $iCentreY
    Else ; Referenced centre point moved to top left corner of text string.
    $iX = $iCentreX + (($iWidth - Abs($iHeight * Sin($iAngle * $iPI / 180))) / 2)
    $iY = $iCentreY + (($iHeight + Abs($iWidth * Sin($iAngle * $iPI / 180))) / 2)
    EndIf

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

    ;Rotation Matrix
    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixRotate($hMatrix, $iAngle, 1)
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)

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

    ;x, y are display coordinates of center of width and height of the rectanglular text box.
    ;Top left corner coordinates rotate in a circular path with radius = (width of text box)/2.
    ;Parametric equations for a circle, and adjustments for centre of text box
    $x = ($iWidth / 2) * Cos($iAngle * $iPI / 180) - ($iHeight / 2) * Sin($iAngle * $iPI / 180)
    $y = ($iWidth / 2) * Sin($iAngle * $iPI / 180) + ($iHeight / 2) * Cos($iAngle * $iPI / 180)

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

    ;Rotation of Coordinate Axes formulae - To display at x and y after rotation, we need to enter the
    ;x an y position values of where they rotated from. This is done by rotating the coordinate axes.
    ;Use $iXt, $iYt in _GDIPlus_RectFCreate. These x, y values is the position of the rectangular
    ;text box point before rotation. (before translation of the matrix)
    $iXt = ($iX - $x) * Cos($iAngle * $iPI / 180) + ($iY - $y) * Sin($iAngle * $iPI / 180)
    $iYt = -($iX - $x) * Sin($iAngle * $iPI / 180) + ($iY - $y) * Cos($iAngle * $iPI / 180)

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

    $hBrush = _GDIPlus_BrushCreateSolid($iARGB)
    $tLayout = _GDIPlus_RectFCreate($iXt, $iYt, $iWidth, $iHeight)
    _GDIPlus_GraphicsDrawStringEx($hGraphic, $nText, $hFont, $tLayout, $hFormat, $hBrush)

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

    ; Clean up resources
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    $tLayout = ""
    Return 1
    EndFunc ;==>GDIPlus_SetAngledText

    [/autoit]

    Dateien

    GUI_Pinned_Childs.au3 9,37 kB – 330 Downloads
  • vertical_label UDF

    • BugFix
    • 29. Januar 2010 um 20:15

    :D Oder hier der Verweis auf den Beitrag in unserem Forum ;)
    Text auf GUI in jedem gewünschten Winkel

  • Excel zeilen und spaltn ermitteln...

    • BugFix
    • 29. Januar 2010 um 19:59

    Um die Anzahl der Zeilen/Spalten zu ermitteln gibt es
    .UsedRange.Rows/Columns.Count

    Hier mal im Bsp.:

    Spoiler anzeigen
    [autoit]

    ; === Excel Objekt erstellen
    Local $oBook = ObjCreate("Excel.Application")
    With $oBook
    .SheetsInNewWorkbook = 1
    .Visible = 1
    .WorkBooks.Add
    .ActiveWorkbook.Sheets(1).Select ()
    EndWith

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

    ; === Zellen füllen (A1 bis I21)
    For $i = 0 To 8
    For $j = 0 To 20
    $oBook.Range("A1").Offset($i, $j).Value = StringFormat('%3d', Random(1, 999, 1))
    Next
    Next

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

    ; === letzte Zeile
    ConsoleWrite('Anzahl Zeilen: ' & $oBook.Worksheets(1).UsedRange.Rows.Count & @CRLF)

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

    ; === letzte Spalte
    ConsoleWrite('Anzahl Spalten: ' & $oBook.Worksheets(1).UsedRange.Columns.Count & @CRLF)

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

    ; === Excel Objekt beenden ohne speichern
    $oBook.DisplayAlerts = False
    $oBook.Application.Quit

    [/autoit]
  • Aliasnamen für Pfadanzeige

    • BugFix
    • 29. Januar 2010 um 14:36

    Hi,
    beim Darstellen von Pfaden beispielsweise in Listviews, steht ja für die Pfadanzeige nur begrenzter Platz zur Verfügung.
    Mit der Funktion _MakeAliasFileArray wird aus einem Array, das die vollen Dateipfade enthält, ein 2D-Array erstellt mit vollem Dateipfad und zusätzlichem Anzeigenamen (Alias) in vorgegebener maximaler Länge.
    Als Alias kann wahlweise nur der Dateiname oder Pfad & Dateiname verwendet werden.
    - nur Dateiname
    Ist der Dateiname länger als max. Länge, wird nach dem 3. Buchstaben ausgeschnitten bis zur max. Länge. An der Schnittstelle wird "~~" eingesetzt.
    - Pfad & Dateiname
    Ist der Dateiname länger als max. Länge, so gilt wie oben. Allerdings wird weitere 3 (bzw. 5) Zeichen eingekürzt und in der Anzeige erscheint vor dem Dateinamen "Lw:\", befindet sich die Datei nicht im Root wird "Lw:\..." vorangestellt.
    Kann die Datei in voller Länge verwendet werden, wird der Pfad, so weit wie möglich übernommen und dann mit "..." zum Dateinamen verbunden.

    Hier mal im Bsp., wie von der Alias-Anzeige der kpl. Pfad per Mausklick ausgewählt wird:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <GUIListView.au3>
    #include <ListViewConstants.au3>

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

    $gui = GUICreate('nur Datei')
    $LV = GUICtrlCreateListView('Datei (Pfad)', 20, 20, 300, 300)
    $hLV = GUICtrlGetHandle($LV)
    _GUICtrlListView_SetColumnWidth($hLV, 0, $LVSCW_AUTOSIZE_USEHEADER)
    $btChg = GUICtrlCreateButton('Ordner u. Pfad zeigen', 20, 350, 180, 20)

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

    $dir = FileSelectFolder('Bitte Ordner zur Rekursiv-Auflistung wählen.', @MyDocumentsDir, 4)
    If @error Then Exit MsgBox(0, 'Fehler', 'Es wurde kein Ordner ausgewählt!' & @LF & 'Programm wird beendet.')

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

    $aFiles = _GetFilesFolder_Rekursiv($dir, -1, 0)
    Global $aRet = _MakeAliasFileArray($aFiles, 0)
    For $i = 0 To UBound($aRet) -1
    GUICtrlCreateListViewItem($aRet[$i][1], $LV)
    Next

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

    GUISetState()

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

    While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case -3
    Exit
    Case $btChg
    GUICtrlSetState($btChg, $GUI_DISABLE)
    GUISetState(@SW_LOCK)
    WinSetTitle($gui, '', 'Datei mit Pfad')
    _GUICtrlListView_DeleteAllItems($hLV)
    $aRet = _MakeAliasFileArray($aFiles)
    For $i = 0 To UBound($aRet) -1
    GUICtrlCreateListViewItem($aRet[$i][1], $LV)
    Next
    GUISetState(@SW_UNLOCK)
    Case $GUI_EVENT_PRIMARYUP
    $cursor = GUIGetCursorInfo()
    If $cursor[4] = $LV Then
    $index = _GUICtrlListView_GetSelectedIndices($hLV)
    If $index >= 0 Then MsgBox(0, 'markiert', $aRet[$index][0])
    EndIf
    EndSwitch
    WEnd

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

    ;===============================================================================
    ; Function Name: _MakeAliasFileArray(ByRef $aFullPath, $iBoth=1, $iStartIndex=1, $iMaxAliasLen=30)
    ; Description: Creates an 2D-Array with Aliasname (i.e. to show in an Listview) and full path
    ; Parameter(s): $aFullPath 1D-Array with full file pathes (i.e. from my UDF _GetFilesFolder_Rekursiv)
    ; optional: $iBoth=1 Path and filename are shown (default), 0 - only filename
    ; optional: $iStartIndex Index of first entry (default = 1)
    ; optional: $iMaxAliasLen Maximum count of chars in Alias name (minimum is 20, shorter makes not sense)
    ; Return Value(s): Success 2D-Array with Aliasname and full file path
    ; Failure set @error 1 - no array given
    ; 2 - $iStartIndex out of range
    ; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
    ;===============================================================================
    Func _MakeAliasFileArray(ByRef $aFullPath, $iBoth=1, $iStartIndex=1, $iMaxAliasLen=30)
    If Not IsArray($aFullPath) Then Return SetError(1,0,0)
    If $iStartIndex < 0 Then Return SetError(2,0,0)
    Local $iUbound = UBound($aFullPath) -$iStartIndex
    If $iUbound < 1 Then Return SetError(2,0,0)
    If $iMaxAliasLen < 20 Then $iMaxAliasLen = 20
    Local $aOut[$iUbound][2]
    For $i = 0 To UBound($aOut) -1
    $aOut[$i][0] = $aFullPath[$i+$iStartIndex]
    StringRegExpReplace($aOut[$i][0], '\\', '')
    Local $sub = @extended -1
    Local $file = StringRight($aOut[$i][0], StringLen($aOut[$i][0])-StringInStr($aOut[$i][0], '\', 1, -1))
    Local $lw = StringLeft($aOut[$i][0], 3)
    Switch $iBoth
    Case 0
    If StringLen($file) > $iMaxAliasLen Then
    $aOut[$i][1] = StringLeft($file, 3) & '~~' & StringRight($file, $iMaxAliasLen -5)
    Else
    $aOut[$i][1] = $file
    EndIf
    Case 1
    If StringLen($aOut[$i][0]) <= $iMaxAliasLen Then
    $aOut[$i][1] = $aFullPath[$i+$iStartIndex]
    Else
    If $sub > 0 Then
    If StringLen($file) >= $iMaxAliasLen -6 Then
    $aOut[$i][1] = $lw & '...' & StringLeft($file, 3) & '~~' & StringRight($file, $iMaxAliasLen -11)
    Else
    $aOut[$i][1] = StringLeft($aOut[$i][0], $iMaxAliasLen -StringLen($file) -3) & '...' & $file
    EndIf
    Else
    $aOut[$i][1] = $lw & StringLeft($file, 3) & '~~' & StringRight($file, $iMaxAliasLen -8)
    EndIf
    EndIf
    EndSwitch
    Next
    Return $aOut
    EndFunc ;==>_MakeAliasFileArray

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

    ;==================================================================================================
    ; Function Name: _GetFilesFolder_Rekursiv($sPath [, $sExt='*' [, $iDir=-1 [, $iRetType=0 ,[$sDelim='0']]]])
    ; Description: Recursive listing of files and/or folders
    ; Parameter(s): $sPath Basicpath of listing ('.' -current path, '..' -parent path)
    ; $sExt Extension for file selection '*' or -1 for all (Default)
    ; $iDir -1 Files+Folder(Default), 0 only Files, 1 only Folder
    ; optional: $iRetType 0 for Array, 1 for String as Return
    ; optional: $sDelim Delimiter for string return
    ; 0 -@CRLF (Default) 1 -@CR 2 -@LF 3 -';' 4 -'|'
    ; Return Value(s): Array (Default) or string with found pathes of files and/or folder
    ; Array[0] includes count of found files/folder
    ; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
    ;==================================================================================================
    Func _GetFilesFolder_Rekursiv($sPath, $sExt='*', $iDir=-1, $iRetType=0, $sDelim='0')
    Global $oFSO = ObjCreate('Scripting.FileSystemObject')
    Global $strFiles = ''
    Switch $sDelim
    Case '1'
    $sDelim = @CR
    Case '2'
    $sDelim = @LF
    Case '3'
    $sDelim = ';'
    Case '4'
    $sDelim = '|'
    Case Else
    $sDelim = @CRLF
    EndSwitch
    If ($iRetType < 0) Or ($iRetType > 1) Then $iRetType = 0
    If $sExt = -1 Then $sExt = '*'
    If ($iDir < -1) Or ($iDir > 1) Then $iDir = -1
    __ShowSubFolders($oFSO.GetFolder($sPath),$sExt,$iDir,$sDelim)
    If $iRetType = 0 Then
    Local $aOut
    $aOut = StringSplit(StringTrimRight($strFiles, StringLen($sDelim)), $sDelim, 1)
    If $aOut[1] = '' Then
    ReDim $aOut[1]
    $aOut[0] = 0
    EndIf
    Return $aOut
    Else
    Return StringTrimRight($strFiles, StringLen($sDelim))
    EndIf
    EndFunc ;==>_GetFilesFolder_Rekursiv

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

    Func __ShowSubFolders($Folder, $Ext='*', $Dir=-1, $Delim=@CRLF)
    If Not IsDeclared("strFiles") Then Global $strFiles = ''
    If ($Dir = -1) Or ($Dir = 0) Then
    For $file In $Folder.Files
    If $Ext <> '*' Then
    If StringRight($file.Name, StringLen($Ext)) = $Ext Then _
    $strFiles &= $file.Path & $Delim
    Else
    $strFiles &= $file.Path & $Delim
    EndIf
    Next
    EndIf
    For $Subfolder In $Folder.SubFolders
    If ($Dir = -1) Or ($Dir = 1) Then $strFiles &= $Subfolder.Path & '\' & $Delim
    __ShowSubFolders($Subfolder, $Ext, $Dir, $Delim)
    Next
    EndFunc ;==>__ShowSubFolders

    [/autoit]

    Dateien

    _MakeAliasFileArray.au3 2,51 kB – 364 Downloads
  • Menü &XYZ

    • BugFix
    • 28. Januar 2010 um 20:20

    Das "&" dient bei Controltexten zur Maskierung des Folgebuchstabens zum Aufruf mit "ALT+Buchstabe". ;)

  • [gelöst] Virensoftware - keine Verbindung zum Server möglich

    • BugFix
    • 26. Januar 2010 um 20:52
    Zitat von peethebee

    DNS-Server kaputt?


    Dann sollte eigentlich keinerlei Adreßauflösung funktionieren, oder? Kann alle Webseiten problemlos anwählen.
    Werde es aber mal testen.

  • [gelöst] Virensoftware - keine Verbindung zum Server möglich

    • BugFix
    • 26. Januar 2010 um 20:40

    Hi,
    habe ja meinen PC aufgepeppt (eigentlich sind nur Gehäuse und Brenner geblieben :D), ein jungfräuliches WinXP Pro SP3 aufgespielt, Treiber sind alle aktualisiert.
    Nun habe ich folgendes Phänomen:
    AVG installiert - Updateversuch - "keine Verbindung zum Server möglich"
    OK, kann ja vorkommen. Wollte aber keine SW wo der Server nicht erreichbar ist, also:
    avast! installiert - Updateversuch - "keine Verbindung zum Server möglich" 8|?(:(
    Ja was soll das denn? Den Server direkt per IP-Adresse angewählt: und klappt!
    Programm hat in der Firewall Freigabe, hab auch testweise die FW abgeschaltet - Ergebnis wie gehabt.

    Hat jemand von euch dazu irgendeinen Einfall? Bin total genervt. ;(

  • Mausklicks+Text-Recorder

    • BugFix
    • 26. Januar 2010 um 19:50
    Zitat von ScyLoon

    Was habe ich den falsch gemacht?


    :D Es war nur in vorbeugender Weise gedacht, da leider viele User hier nach Unterstützung für Gamebots suchen (leider).
    Wenn du etwas automatisieren möchtest, ist "rumklicken" immer das letzte (da schlechteste) Mittel. Nur notwendig, wenn die zu steuernde Anwendung keinerlei Windowskonforme Controls verwendet.
    Überprüfe das mit dem 'AutoIt Window Info' Tool.

  • Mausklicks+Text-Recorder

    • BugFix
    • 25. Januar 2010 um 22:01

    Du bist in jedem Falle herzlich willkommen. Jedoch empfehle ich dir dringend als erstes die Forenregeln zu lesen.

  • DockIt GUI abdocken

    • BugFix
    • 24. Januar 2010 um 22:17
    Zitat von Slyfex

    Könntest du mir bitte helfen?


    Habe zur Zeit viel zu tun, evtl, später.

    Zitat von Slyfex

    Ist es möglich die GUI im Fenster anzudocken?


    Ja, einfach die Koordinaten mit den Fensterkoordinaten abgleichen.

  • Schriftart von Labels bekommen

    • BugFix
    • 23. Januar 2010 um 11:22

    Edit:
    Für ein einzelnes Control habe ich keine Lösung parat, da die einzig mir bekannte Funktion (GetTextFace) seltsamerweise immer 'SYSTEM' zurückgibt. :S (k.A. wo der Fehler liegt.
    Vielleicht hilft dir das als Ansatz:

    [autoit]

    #Include <WinAPI.au3>

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

    ; === Test-GUI
    $gui = GUICreate('test')
    $label = GUICtrlCreateLabel('test', 10, 10, 60, 17)
    $hWnd = GUICtrlGetHandle($label)
    GUICtrlSetFont(-1, Default, Default, Default, 'Courier New')

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

    ; === Device Context erstellen
    Local $hDC = _WinAPI_GetDC($hWnd)

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

    ; === Font auslesen
    MsgBox(0, 'Font Name', GetTextFace($hDC) )

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

    ; === Ressourcen löschen
    _WinAPI_ReleaseDC($hWnd, $hDC)
    GUIDelete($gui)

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

    Func GetTextFace($hdc)
    Local $tFaceName = DllStructCreate('char[128]')
    DllCall('gdi32.dll', 'int', 'GetTextFace', 'int', $hdc, 'int', 128, 'ptr', DllStructGetPtr($tFaceName))
    Return DllStructGetData($tFaceName, 1)
    EndFunc

    [/autoit]
  • ListView in Tab Problem

    • BugFix
    • 23. Januar 2010 um 11:09

    Die Funktionen der Listview-UDF verlangen das Handle des Listview (welches von _GUICtrlListView_Create zurückgegeben wird). GUICtrlCreateListView gibt dir die Control-ID zurück.
    Erstelle also dein Listview mit GUICtrlCreateListView und lass dir dann das Handle zum Ctrl für die Nutzung der UDF ausgeben:

    [autoit]


    $ID_Listview = GUICtrlCreateListView(..)
    $hWnd_Listview = GUICtrlGetHandle( $ID_Listview )

    [/autoit]

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

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