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

Beiträge von UEZ

  • dsktopauflösung ausgeben bei erweiterten desktop?

    • UEZ
    • 2. Juni 2011 um 16:37

    Wenn du willst, kann du mal in AutoIt Windows Screenshooter reinschauen. Dort habe ich einige Möglichkeiten implementiert, um Screenshots zu erstellen, sollte auch mit Spielen funzen :D

    Gruß,
    UEZ

  • Frage zu StringRegExpReplace

    • UEZ
    • 1. Juni 2011 um 20:19
    Zitat von shadow667

    Ganz so einfach scheint's dann auch net zu klappen...
    Kommazahlen z.B. 80.3 (wobei im NC-Programm das Komma nen Punkt is) werden auch geteilt dadurch

    So, hier für euch mal zum Testen ein Ausschnitt eines echten NC-Programmes:

    Was erwartest du, wenn du nur die Hälfte erwähnst?

    Gruß,
    UEZ

  • Frage zu StringRegExpReplace

    • UEZ
    • 1. Juni 2011 um 19:50

    Hier noch eine Variante:

    [autoit]


    $sSource = _
    "N5M6T1(BOHRER D10)" & @LF & _
    "N10G0G54X10Y30S500M3" & @LF & _
    "N15G0Z30" & @LF & _
    "N20G81R2Z-15F500" & @LF & _
    "N20G0G80Z300"
    $sNew = StringRegExpReplace($sSource, "(\w\d+)", "$1 ")
    MsgBox(0, "Test", $sNew)

    [/autoit]

    Gruß,
    UEZ

  • Obfuscator streikt bei zu vielen Zeichen...

    • UEZ
    • 1. Juni 2011 um 14:35

    Ich glaube die Länge des Strings darf höchstens 2048 Zeichen lang sein.

    Hier der Code, den ich benutze, um den Binärstring zu erzeugen:

    Spoiler anzeigen
    [autoit]


    ; ============================================================================================================================
    ; Purpose : Converts any file to HEX binary string
    ; Author : Ward / UEZ
    ; ============================================================================================================================

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

    Local $VarName = StringStripWS(InputBox("Convert to Binary String", "Select a name for the variable." & @CRLF & @CRLF & "$ will automatically added to the beginning of the variable!:", "BinaryString"), 3)
    If $VarName = "" Then Exit

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

    Local $FileName = FileOpenDialog("Open a file", @ScriptDir, "DLL file (*.*)")
    If $FileName = "" Then Exit

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

    Local $Handle = FileOpen($FileName, 16)
    Local $BinaryString = FileRead($Handle)
    FileClose($Handle)

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

    Local $LineLen = 1024
    Local $DllString = String($BinaryString)

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

    Local $Script = "Func " & $VarName & "()" & @CRLF & @TAB & "Local _" & @CRLF & @TAB & "$" & $VarName & " = '" & StringLeft($DllString, $LineLen) & "'" & @CRLF
    $DllString = StringTrimLeft($DllString, $LineLen)

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

    While StringLen($DllString) > $LineLen
    $Script &= " $" & $VarName & " &= '" & StringLeft($DllString, $LineLen) & "'" & @CRLF
    $DllString = StringTrimLeft($DllString, $LineLen)
    WEnd

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

    If StringLen($DllString) <> 0 Then $Script &= " $" & $VarName & " &= '" & $DllString & "'" & @CRLF
    $Script &= @TAB & "Return Binary($" & $VarName & ")" & @CRLF & "EndFunc"
    ClipPut($Script)

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

    MsgBox(64, "Convert to Binary String", "The result is in the clipboard, you can paste it to your script.")

    [/autoit]

    Das Resultat ist eine Funktion mit dem String und es wird in den Zwischenspeicher kopiert.

    Gruß,
    UEZ

  • dsktopauflösung ausgeben bei erweiterten desktop?

    • UEZ
    • 1. Juni 2011 um 13:20

    Hier eine weitere Möglichkeit:

    [autoit]


    #include <Array.au3>
    $hFullScreen = WinGetHandle("Program Manager")
    $aFullScreen = WinGetPos($hFullScreen)
    _ArrayDisplay($aFullScreen)

    [/autoit]

    Gruß,
    UEZ

  • _WinGetControls() - Controls eines Fensters auslesen

    • UEZ
    • 31. Mai 2011 um 08:55

    Die MSDN scheint ja die Bibel der Coder zu sein. Man muss nur daran glauben, suchen, finden und verstehen - und alles wird gut.

    Danke,
    UEZ

  • Bild im GUI einfügen?

    • UEZ
    • 30. Mai 2011 um 14:42

    Hola,

    du könntest das Bild in ein Binärstring umwandeln und direkt vom Speicher darstellen. Beispiel hier: [ offen ] "Binärbild" mit GDI laden! (jetzt ohne Memory Leak Dank Progandy!)

    Wie kannst du ein Bild in ein Binärstring umwandeln? Schaue mal hier rein: http://www.autoitscript.com/forum/topic/12…post__p__879238

    Gruß,
    UEZ

  • _WinGetControls() - Controls eines Fensters auslesen

    • UEZ
    • 29. Mai 2011 um 12:02

    Du bist ja krass drauf 8o

    Da dies hier wunderbar hier rein passt passt, habe ich es in deinen Code mit eingebaut -> ist nicht vollständig, z.B. fehlen die statischen Controls, wie GUICtrlCreatePic, etc.

    _WinGetControls.au3

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <Constants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>
    #include <WinAPI.au3>
    #include-once

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

    ; #DEMOFUNCTION# ================================================================================================================
    ; Name...........: _WinGetControls
    ; Description ...: Liefert ein 2D-Array für die Controls eines Fensters.
    ; Das Array enhält für jedes Control die folgenden Informationen:
    ; |[0] HWND - HWND des Controls
    ; |[1] Class - Klasse des Controls
    ; |[2] NN - ClassNN des Controls
    ; |[3] ID - ID des Controls
    ; |[4] Visible - Sichtbar? 1 = ja, 0 = nein
    ; Das Feld Array[0][0] enthält die Anzahl der Controls.
    ; Syntax.........: _WinGetControls($hWnd)
    ; Parameters ....: $hWnd - HWND des Fensters (z.B. Rückgabewert von GUICreate)
    ; Return values .: Erfolg: Controlarray
    ; Fehler: False, @error = 1
    ; Author ........: Großvater (http://www.autoit.de)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......:
    ; Link ..........:
    ; Example .......:
    ; ===============================================================================================================================
    Func _WinGetControls($hWnd)
    Local $hCB
    If Not IsHWnd($hWnd) Then Return SetError(1, 0, False)
    __WinGetControlsAddControl("Init", 0)
    $hCB = DLLCallbackRegister("__WinGetControlsAddControl", "Int", "HWND;LPARAM")
    DllCall("User32.dll", "Int", "EnumChildWindows", "HWND", $hWnd, "Ptr", DllCallbackGetPtr($hCB), "LPARAM", $hWnd)
    If @error Then Return SetError(DllCallbackFree($hCB), 0, False)
    DllCallbackFree($hCB)
    Return __WinGetControlsAddControl("Result", 0)
    EndFunc

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

    ; #INTERNAL_USE_ONLY# ===========================================================================================================
    ; Name...........: __WinGetControlsAddControl
    ; Description ...: Callback-Funktion für DLLCall "EnumChildWindows" in _WinGetControls
    ; Remarks .......: Weil ich globale Variable für die Rückgabe von Funktionswerten nicht mag und die Implementierung
    ; der statischen Arrays recht rudimentär ist, sind die maximale Anzahl von Controls auf 1024
    ; und die maximale Anzahl von Klassen auf 256 begrenzt.
    ; ===============================================================================================================================
    Func __WinGetControlsAddControl($hWnd, $lParam)
    Local Static $UControls = 1024
    Local Static $UClasses = 256
    Local Static $aControls[$UControls + 1][6]
    Local Static $aClasses[$UClasses + 1][2]
    Local $aResult, $C, $Class, $ClassExist, $ID, $NN
    Switch $hWnd
    Case "Init"
    $aControls[0][0] = 0
    $aClasses[0][0] = 0
    Return
    Case "Result"
    $C = $aControls[0][0] + 1
    $aResult = $aControls
    Redim $aResult[$C][6]
    Return $aResult
    EndSwitch
    $aResult = DllCall("User32.dll", "Int", "GetClassNameW", "HWND", $hWnd, "WStr", "", "Int", 260)
    If @error Or $aResult[0] = 0 Then Return True
    $Class = $aResult[2]
    $aResult = DllCall("User32.dll", "Int", "GetDlgCtrlID", "HWND", $hWnd)
    If @error Or $aResult[0] = 0 Then Return True
    $ID = $aResult[0]
    $ClassExist = False
    $C = $aClasses[0][0]
    For $I = 1 To $C
    If $aClasses[$I][0] = $Class Then
    $NN = $aClasses[$I][1] + 1
    $aClasses[$I][1] = $NN
    $ClassExist = True
    ExitLoop
    EndIf
    Next
    If Not $ClassExist Then
    $NN = 1
    $C += 1
    If $C > $UClasses Then Return False
    $aClasses[0][0] = $C
    $aClasses[$C][0] = $Class
    $aClasses[$C][1] = $NN
    EndIf
    $C = $aControls[0][0] + 1
    If $C > $UControls Then Return False
    $aControls[0][0] = $C
    $aControls[$C][0] = $hWnd
    $aControls[$C][1] = $Class
    $aControls[$C][2] = $NN
    $aControls[$C][3] = $ID
    $aControls[$C][4] = ControlCommand(HWnd($lParam), "", $ID, "IsVisible", "")
    $aControls[$C][5] = __myCtrlGetClass($hWnd)
    Return True
    EndFunc
    ; ===============================================================================================================================

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

    Func __myCtrlGetClass($hHandle) ;code by SmOke_N, modified by Guiness
    Local Const $GWL_STYLE = -16
    Local $iLong, $sClass
    If IsHWnd($hHandle) = 0 Then
    $hHandle = GUICtrlGetHandle($hHandle)
    If IsHWnd($hHandle) = 0 Then
    Return SetError(1, 0, "Unknown")
    EndIf
    EndIf

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

    $sClass = _WinAPI_GetClassName($hHandle)
    If @error Then
    Return "Unknown"
    EndIf

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

    $iLong = _WinAPI_GetWindowLong($hHandle, $GWL_STYLE)
    If @error Then
    Return SetError(2, 0, 0)
    EndIf

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

    Switch $sClass
    Case "Button"
    Select
    Case BitAND($iLong, $BS_GROUPBOX) = $BS_GROUPBOX
    Return "Group"
    Case BitAND($iLong, $BS_CHECKBOX) = $BS_CHECKBOX
    Return "Checkbox"
    Case BitAND($iLong, $BS_AUTOCHECKBOX) = $BS_AUTOCHECKBOX
    Return "Checkbox"
    Case BitAND($iLong, $BS_RADIOBUTTON) = $BS_RADIOBUTTON
    Return "Radio"
    Case BitAND($iLong, $BS_AUTORADIOBUTTON) = $BS_AUTORADIOBUTTON
    Return "Radio"
    EndSelect

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

    Case "Edit"
    Select
    Case BitAND($iLong, $ES_WANTRETURN) = $ES_WANTRETURN
    Return "Edit"
    Case Else
    Return "Input"
    EndSelect

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

    Case "Static"
    Select
    Case BitAND($iLong, $SS_BITMAP) = $SS_BITMAP
    Return "Pic"
    Case BitAND($iLong, $SS_ICON) = $SS_ICON
    Return "Icon"
    Case BitAND($iLong, $SS_LEFT) = $SS_LEFT
    If BitAND($iLong, $SS_NOTIFY) = $SS_NOTIFY Then
    Return "Label"
    EndIf
    Return "Graphic"
    EndSelect

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

    Case "ComboBox"
    Return "Combo"
    Case "ListBox"
    Return "List"
    Case "msctls_progress32"
    Return "Progress"
    Case "msctls_trackbar32"
    Return "Slider"
    Case "SysDateTimePick32"
    Return "Date"
    Case "SysListView32"
    Return "ListView"
    Case "SysMonthCal32"
    Return "MonthCal"
    Case "SysTabControl32"
    Return "Tab"
    Case "SysTreeView32"
    Return "TreeView"

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

    EndSwitch
    Return $sClass
    EndFunc

    [/autoit]

    _WinGetControls Example 2.au3

    Spoiler anzeigen
    [autoit]


    #include "WinGetControls.au3"
    #include <Array.au3>

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

    $sGUITitle1 = "Test Getting GUI Control Types"

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

    $hGUI1 = GUICreate($sGUITitle1, 400, 500, -1, -1)

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

    $x3 = GUICtrlCreateButton("button1", 10, 10, 60, 20) ; button, it's a Group
    $x4 = GUICtrlCreateButton("button2", 10, 40, 60, 20) ; button
    $x5 = GUICtrlCreateButton("button3", 10, 70, 60, 20) ; button
    $x6 = GUICtrlCreateEdit("Edit1", 10, 100, 60, 20) ; edit, it's a HScroll
    $x7 = GUICtrlCreateInput("Input1", 10, 130, 60, 20) ; edit
    $x8 = GUICtrlCreateLabel("Label1", 10, 160, 60, 20) ; static
    $x9 = GUICtrlCreateRadio("Radio1", 10, 190, 60, 20) ; button
    $x10 = GUICtrlCreateRadio("Radio2", 10, 220, 60, 20) ; button
    $x11 = GUICtrlCreateCheckbox("CheckBox1", 10, 250, 60, 20) ; button
    $x12 = GUICtrlCreateGroup("Group1", 10, 280, 80, 50) ; button, it's a Group
    $x13 = GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group, it's a Group
    $x14 = GUICtrlCreateCombo("", 10, 340, 60, 20) ; ComboBox
    GUICtrlSetData(-1, "ComboItem1|Comboitem2|Comboitem3", "Comboitem3")
    $x15 = GUICtrlCreateList("List1", 10, 370, 60, 20) ; ListBox
    GUICtrlSetData(-1, "ListItem1|Listitem2|Listitem3", "Listitem2")

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

    GUISetState(@SW_SHOW, $sGUITitle1)

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

    Dim $aControls, $hWnd, $Title
    $Title = WinGetTitle($hGUI1 )
    $aControls = _WinGetControls($hGUI1)
    If Not IsArray($aControls) Then
    MsgBox(0, "ERROR", "Der Aufruf von _WinGetControls() ist fehlgeschlagen!")
    Else
    _ArrayDisplay($aControls, $Title, -1, 0, "", "|", "Zeile|HWND|Class|NN|ID|Visible|Controls")
    EndIf
    Sleep(1000)
    Exit

    [/autoit]

    Wie hast du das ganze Zeug gelernt?

    Gruß,
    UEZ

  • Bekomme es nicht hin >.>

    • UEZ
    • 28. Mai 2011 um 23:44

    Vielleicht so?

    [autoit]


    $min = 200 * 1024 ;200 kb = 200 * 1024 Bytes
    $datei = "Text1.txt"
    If FileExists($datei) And FileGetSize($datei) < $min Then MsgBox(0, "Info", "Datei ist kleiner als 200kb!")

    [/autoit]

    Gruß,
    UEZ

  • Write Text on Bitmap v0.92 Build 2013-02-16 Beta

    • UEZ
    • 28. Mai 2011 um 15:06

    Durch Zufall habe ich von einem anderen Forum erfahren, dank Google, dass in dem UDF ein Bug ist. Das Positionieren des Textes auf x zentriert, aber auf y manuell war nicht möglich.

    Bug sollte jetzt gefixt sein.

    Schade, dass niemand den Bug hier gemeldet hat. :(

    Gruß,
    UEZ

  • "Verzerrung" bei Bild

    • UEZ
    • 27. Mai 2011 um 17:35

    Hier noch eine Möglichkeit:

    Spoiler anzeigen
    [autoit]


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

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

    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup()
    Global Const $fScale = 30
    Global Const $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\sworddg.png")
    Global Const $iW = _GDIPlus_ImageGetWidth($hImage)
    Global Const $iH = _GDIPlus_ImageGetHeight($hImage)
    Global Const $iWidth = $iW * 96 / _GDIPlus_ImageGetHorizontalResolution($hImage) * $fScale
    Global Const $iHeight = $iH * 96 / _GDIPlus_ImageGetVerticalResolution($hImage) * $fScale

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

    Global Const $hGui = GUICreate("Test", $iWidth, $iHeight)
    GUISetBkColor(0xE0E080)
    Global Const $cPic = GUICtrlCreatePic("", 0, 0, $iWidth, $iHeight)
    Global Const $hPic = GUICtrlGetHandle($cPic)
    GUISetState()

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

    Global Const $hDC = _WinAPI_GetWindowDC($hPic)
    Global Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC)
    Global Const $hBitmap_backbuffer = _WinAPI_CreateCompatibleBitmap($hDC, $iWidth, $iHeight)
    Global Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hBitmap_backbuffer)
    Global Const $hGfx = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer)
    _GDIPlus_GraphicsDrawImage($hGfx, $hImage, 0, 0)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGfx)
    _GDIPlus_Shutdown()

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

    _WinAPI_AlphaBlend($hDC, 0, 0, $iWidth, $iHeight, $hDC_backbuffer, 0, 0, $iW, $iH, 255, 1)
    _WinAPI_BitBlt($hDC_backbuffer, 0, 0, $iWidth, $iHeight, $hDC, 0, 0, $SRCCOPY)

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

    _WinAPI_ReleaseDC($hPic, $hDC)
    _WinAPI_SelectObject($hDC_backbuffer, $DC_obj)
    _WinAPI_DeleteDC($hDC_backbuffer)

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

    Global Const $STM_SETIMAGE = 0x0172
    Global Const $STM_GETIMAGE = 0x0173
    _SendMessage($hPic, $STM_SETIMAGE, 0, $hBitmap_backbuffer)
    Global Const $hObj = _SendMessage($hPic, $STM_GETIMAGE)
    If $hObj <> $hBitmap_backbuffer Then
    _WinAPI_DeleteObject($hBitmap_backbuffer)
    EndIf

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_EXIT")

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

    While Sleep(100000)
    WEnd

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

    Func _Exit()
    GUIDelete($hGui)
    Exit
    EndFunc ;==>_Exit

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

    Func _WinAPI_AlphaBlend($hDestDC, $iXDest, $iYDest, $iWidthDest, $iHeightDest, $hSrcDC, $iXSrc, $iYSrc, $iWidthSrc, $iHeightSrc, $iAlpha, $fAlpha = 0)
    Local $iBlend = BitOR(BitShift(Not ($fAlpha = 0), -24), BitShift(BitAND($iAlpha, 0xFF), -16))
    Local $Ret = DllCall('gdi32.dll', 'int', 'GdiAlphaBlend', 'hwnd', $hDestDC, 'int', $iXDest, 'int', $iYDest, 'int', $iWidthDest, 'int', $iHeightDest, 'hwnd', $hSrcDC, 'int', $iXSrc, 'int', $iYSrc, 'int', $iWidthSrc, 'int', $iHeightSrc, 'dword', $iBlend)
    If @error Or (Not $Ret[0]) Then Return SetError(1, 0, 0)
    Return 1
    EndFunc ;==>_WinAPI_AlphaBlend

    [/autoit]

    Gruß,
    UEZ

  • Gta-Spider hat Geburtstag

    • UEZ
    • 27. Mai 2011 um 16:28

    Auch von mir ein herzliches Happy Birthday und alles Gute!

    Gruß,
    UEZ

  • Check Ping Status v1.05 Build 2014-09-19 Beta

    • UEZ
    • 27. Mai 2011 um 16:15

    Kleines Update:

    Man kann jetzt die Hintergrundfarbe der GUI ändern und eine Datei aussuchen, die standardmäßig geladen wird. Die Einstellungen werden in einer Ini Datei im Skript Verzeichnis gespeichert.

    Gruß,
    UEZ

  • Tooltip bei MouseOver über InputBox

    • UEZ
    • 26. Mai 2011 um 10:29

    Ja,

    [autoit]


    ...
    $Input = GUICtrlCreateInput("", 88, 64, 313, 21)
    GUICtrlSetTip(-1, "Bitte eine Zahl eingeben")
    ...

    [/autoit]

    Gruß,
    UEZ

  • Drag & Drop: Dateipfad in eine Variable bekommen, statt in Inputfeld

    • UEZ
    • 26. Mai 2011 um 09:08

    In der Hilfe unter GUICtrlCreateInput ist ein Beispiel, das du suchst oder?

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <GUIConstantsEx.au3>

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

    Opt('MustDeclareVars', 1)

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

    Example()

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

    Func Example()
    Local $file, $btn, $msg

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

    GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES
    $file = GUICtrlCreateInput("", 10, 5, 300, 20)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    GUICtrlCreateInput("", 10, 35, 300, 20) ; will not accept drag&drop files
    $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20)

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

    GUISetState()

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

    $msg = 0
    While $msg <> $GUI_EVENT_CLOSE
    $msg = GUIGetMsg()
    Select
    Case $msg = $btn
    ExitLoop
    EndSelect
    WEnd

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

    MsgBox(4096, "drag drop file", GUICtrlRead($file))
    EndFunc ;==>Example

    [/autoit]

    Gruß,
    UEZ

  • Bildbearbeitungseffekte / -filter

    • UEZ
    • 24. Mai 2011 um 21:25

    Ich benötige die MSVCR100.dll - genauso wie in der AutoIt v3.3.7.0 (Beta) ;)

    Gruß,
    UEZ

  • AutoIt 3.3.7.xx Beta verfügbar

    • UEZ
    • 24. Mai 2011 um 13:56

    Bei mir gibt's keine Probleme: Win7 x64.

    Gruß,
    UEZ

  • Neuling fragt.......: Zufallszahlen generieren, ohne eine doppelt zu erhalten

    • UEZ
    • 24. Mai 2011 um 13:53

    Der Nachteil der _ArrayPermute() Methode ist, wenn du ein größers Array nimmst, welches dann n! + 1 Arrayspeicher frisst.

    Besser wäre ein Mischen des Arrays.

    Wie? Z.B so:

    Spoiler anzeigen
    [autoit]


    #include-once
    ; #FUNCTION# ======================================================================================
    ; Name ................: Shuffle_Array()
    ; Version .............: v0.50 build 2011-05-24 beta
    ; Description .......: Shuffles an array - support 1D and 2D arrays only
    ; Syntax ..............: Shuffle_Array(ByRef $array, $startindex = 0, $endindex = 0)
    ; Parameters ........: $array - the array to shuffle
    ; $startindex = from which index to start the shuffling
    ; $endindex = to which index to start the shuffling; 0 means last index of the array
    ; Return values ....: True
    ; Failure 1 - $array is not an array
    ; Failure 2 - array has more than 2 dimensions
    ; Failure 3 - array is empty
    ; Failure 4 - $startindex / $endindex are set wrongly
    ; Author ..............: UEZ
    ; Modified ............:
    ; Remarks ............:
    ; Related ..............: Array
    ; =================================================================================================
    Func Shuffle_Array(ByRef $array, $startindex = 0, $endindex = 0)
    If Not IsArray($array) Then Return SetError(1, 0, 0)
    If UBound($array, 0) > 2 Then Return SetError(2, 0, 0)
    If UBound($array) = 1 Then Return SetError(3, 0, 0)
    Local $u1
    If Not $endindex Then
    $u1 = UBound($array) - 1
    Else
    If $endindex > $startindex And $endindex < UBound($array) Then
    $u1 = $endindex
    Else
    Return SetError(4, 0, 0)
    EndIf
    EndIf
    If UBound($array, 2) Then
    Local $aSwap[1][UBound($array, 2)], $u2 = UBound($array, 2) - 1
    Local $i, $j, $r
    For $i = $startindex To $u1
    $r = Random($startindex, $u1, 1)
    For $j = 0 To $u2
    $aSwap[0][$j] = $array[$i][$j]
    $array[$i][$j] = $array[$r][$j]
    $array[$r][$j] = $aSwap[0][$j]
    Next
    Next
    Else
    Local $aSwap[1]
    For $i = $startindex To $u1
    $r = Random($startindex, $u1, 1)
    $aSwap[0] = $array[$i]
    $array[$i] = $array[$r]
    $array[$r] = $aSwap[0]
    Next
    EndIf
    Return 1
    EndFunc

    [/autoit]

    Du mischst das Array und nimmst die Reihenfolge der Zahlen Lochnummer.

    Gruß,
    UEZ

  • Neuling fragt.......: Zufallszahlen generieren, ohne eine doppelt zu erhalten

    • UEZ
    • 24. Mai 2011 um 00:22

    Hier ein andere Variante:

    [autoit]


    #include <Array.au3>
    Dim $aArray[6] = [1, 2, 3, 4, 5, 6]
    $aNewArray = _ArrayPermute($aArray, ",") ;permutiere Array
    MsgBox(0, "Zufall", "Löcher Reihenfolge: " & StringTrimRight($aNewArray[Random(1, $aNewArray[0], 1)], 2))

    [/autoit]

    Idee: es werden alle Möglichkeiten (Permutation) der 6 Zahlen in ein Array abgelegt und anschließend per Zufall ausgesucht.

    Gruß,
    UEZ

  • AutoIt 3.3.7.xx Beta verfügbar

    • UEZ
    • 23. Mai 2011 um 23:05

    COS kann ich ohne Probleme kompilieren, aber beim Versuch SIC2 zu kompilieren, kommt ein Fehler:

    Code
    >Running AU3Check for obfuscated file(1.54.20.0)  from:C:\Program Files (x86)\AutoIt3\Beta
    !>23:04:23 AU3Check Obfuscated code ended.rc:3

    Gruß,
    UEZ

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™