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

Beiträge von Oscar

  • Checkbox Hilfe

    • Oscar
    • 30. Mai 2011 um 14:41

    Zitat aus der Hilfe:

    Zitat

    For Checkbox, Radio control several states can be returned as $GUI_FOCUS and $GUI_CHECKED,. So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the control is checked.

  • Checkbox Hilfe

    • Oscar
    • 29. Mai 2011 um 21:59

    Eher so:

    [autoit]

    If BitAND(GUICtrlRead($Checkbox), $GUI_CHECKED) Then

    [/autoit]
  • GUI: Wie Element-Status verändern, ohne dass es zum Flackern kommt?

    • Oscar
    • 25. Mai 2011 um 16:53

    Man kann auch direkt den Status des Buttons abfragen:

    Spoiler anzeigen
    [autoit]


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

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

    $Form1 = GUICreate("Form1", 170, 41, 192, 124)
    $Button1 = GUICtrlCreateButton("Button1", 8, 8, 73, 25, $WS_GROUP)
    $Button2 = GUICtrlCreateButton("Flackerbutton", 88, 8, 73, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

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

    While 1
    If WinExists("[CLASS:Notepad]") Then
    If BitAND(GUICtrlGetState($Button2), $GUI_DISABLE) Then GUICtrlSetState($Button2, $GUI_ENABLE)
    Else
    If BitAND(GUICtrlGetState($Button2), $GUI_ENABLE) Then GUICtrlSetState($Button2, $GUI_DISABLE)
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit]

    BadBunny: Ein Sleep in der Schleife ist nicht nur falsch in Bezug auf die Lösung, sondern auch sehr hinderlich im Zusammenhang mit GUIGetMsg.

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

    • Oscar
    • 23. Mai 2011 um 23:57

    Diese Frage wurde schon einige Male beantwortet. Suche am besten mal nach: Lottozahlen.

    Hier ein recht kurzes Skript, was Deine Bedingungen erfüllt:

    Spoiler anzeigen
    [autoit]


    Global $p, $s, $a[50] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
    For $i = 49 To 43 Step -1
    $p = Random(1, $i, 1)
    $s &= $a[$p] & ' '
    $a[$p] = $a[$i]
    Next
    MsgBox(0,'',$s)

    [/autoit]
  • Bekomme Schrift nicht Schwarz und hintergrund weiß

    • Oscar
    • 16. Mai 2011 um 10:21

    Das mit dem Button liegt am disable. Statt der Inputbox kannst Du für die Anzeige auch ein Label benutzen:

    Spoiler anzeigen
    [autoit]


    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <GuiStatusBar.au3>
    #include <WindowsConstants.au3>
    #include <Date.au3>

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

    AdlibRegister("tick", 1000)
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 200, 200, 200, 200)
    $MenuItem2 = GUICtrlCreateMenu("MenuItem2")
    $MenuItem3 = GUICtrlCreateMenuItem("MenuItem3", $MenuItem2)
    $MenuItem1 = GUICtrlCreateMenu("MenuItem1")
    $MenuItem4 = GUICtrlCreateMenuItem("MenuItem4", $MenuItem1)
    $Uhrzeit = GUICtrlCreateButton("Uhrzeit:", 8, 16, 60, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    ;~ GUICtrlSetState(-1, $GUI_DISABLE)
    $clock = GUICtrlCreateLabel("Uhrzeit", 100, 16, 50, 17, $SS_CENTER, $WS_EX_CLIENTEDGE)
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $StatusBar1 = _GUICtrlStatusBar_Create($Form1)
    _GUICtrlStatusBar_SetMinHeight($StatusBar1, 17)

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

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

    EndSwitch
    WEnd

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

    Func tick()
    GUICtrlSetData($clock, _NowTime())
    EndFunc ;==>tick

    [/autoit]
  • E-Mail Client

    • Oscar
    • 16. Mai 2011 um 09:14

    @meinnameisthase: unterlasse bitte das löschen Deiner Beiträge. Das macht den ganzen Thread unleserlich.

    [Beiträge wiederhergestellt]

  • Sprung in nächste Zeile.

    • Oscar
    • 13. Mai 2011 um 12:29

    Das geht aber auch einfacher:

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>

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

    Global $User = "Kev"
    GUICreate("Chatomatic", 600, 300)
    GUICtrlCreateListView("Angemeldete User", 475, 0, 130, 300)
    $chatbox = GUICtrlCreateEdit("", 0, 0, 475, 250)
    $inhalt = GUICtrlCreateInput("", 10, 260, 350, 25)
    $send = GUICtrlCreateButton("Senden", 370, 260, 100, 25, $BS_DEFPUSHBUTTON)
    GUISetState(@SW_SHOW)
    ControlFocus("Chatomatic", "", $inhalt)

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

    While 1
    Switch GUIGetMsg()
    Case $send
    sende()
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

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

    Func sende()
    GUICtrlSetData($chatbox, $User & ": " & GUICtrlRead($inhalt) & @CRLF, 1)
    GUICtrlSetData($inhalt, "")
    ControlFocus("Chatomatic", "", $inhalt)
    EndFunc ;==>sende

    [/autoit]
  • [Frage] Formular + PM System

    • Oscar
    • 13. Mai 2011 um 11:44

    Das hat wohl kaum etwas mit AutoIt zu tun (eher HTML, JavaScript, etc.).
    [verschoben nach Off-Topic]

  • Bilder anschauen

    • Oscar
    • 10. Mai 2011 um 18:00

    Ich hatte auch mal eine Funktion zum anzeigen von Bildern gemacht. Dort werden die Bilder proportional skaliert: _ShowImage

  • Chatbox-UDF

    • Oscar
    • 10. Mai 2011 um 17:49

    Die Idee ist gut. Habe sie in die UDF integriert. Danke!
    Zusätzlich habe ich dann gleich auch noch den BB-Code "face" eingebaut. So kann man auch innerhalb einer Zeile eine andere Schriftart auswählen.

    Neue Version in Post #1.

  • Drag and Drop vom Explorer in 2 verschiedene Listen

    • Oscar
    • 10. Mai 2011 um 14:34

    Du musst nur @GUI_DropId benutzen:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>
    #include <WindowsConstants.au3>
    #include <GuiListView.au3>
    Global $WM_DROPFILES = 0x233
    Global $gaDropFiles[1], $str = ""

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

    $hGUI = GUICreate("Test", 400, 400, 219, 178, -1, BitOR($WS_EX_ACCEPTFILES, $WS_EX_TOPMOST))
    $hList = GUICtrlCreateList("", 5, 5, 390, 190)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    $hList2 = GUICtrlCreateList("", 5, 205, 390, 190)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)

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

    GUISetState(@SW_SHOW)

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

    GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_UNICODE_FUNC")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $GUI_EVENT_DROPPED
    $str = ""
    For $i = 0 To UBound($gaDropFiles) - 1
    $str = $gaDropFiles[$i]
    GUICtrlSetData(@GUI_DropId, $str)
    Next
    EndSwitch
    WEnd

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

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

    [/autoit]
  • Problem mit HTML & AutoIt

    • Oscar
    • 8. Mai 2011 um 21:48

    Hab ihn wiederhergestellt!

  • IE.au3 'Buttonlink' nicht im Popup öffnen

    • Oscar
    • 4. Mai 2011 um 15:59

    Wenn keine Hilfe kommt hat das vermutlich den Hintergrund, dass keiner Dein Problem nachvollziehen kann.
    In solch einem Fall wäre ein Link zu der Seite sicher sehr hilfreich. Dann kann man testen und evtl. eine Lösung präsentieren.

  • Mauszeiger "verschwunden"

    • Oscar
    • 4. Mai 2011 um 15:56

    Du hast vergessen das Skript zu posten. ;)

  • Windows Rechner nach gebaut Help?

    • Oscar
    • 4. Mai 2011 um 15:54

    Dafür gibt es keinen speziellen Befehl. Du musst schon mit den String-Befehlen die Eingabe entsprechend kürzen.
    Bei meinem Skript habe ich das so gemacht:

    [autoit]


    GUICtrlSetData($hOutput, StringTrimRight(GUICtrlRead($hOutput), 1))

    [/autoit]
  • Windows Rechner nach gebaut Help?

    • Oscar
    • 2. Mai 2011 um 19:58

    Bei Deinem Skript kann man viel einsparen, wenn man Arrays und Schleifen verwendet.
    Hier mal ein kleiner Taschenrechner mit Arrays und im OnEventMode:

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    Opt('GUIOnEventMode', 1)
    Global $aButtons[18] = ['7', '8', '9', '/', '4', '5', '6', '*', '1', '2', '3', '-', '<-', '0', '.', '+', 'C', '=']
    Global $aKeys[18] = [ _
    '{NUMPAD7}', '{NUMPAD8}', '{NUMPAD9}', '{NUMPADDIV}', _
    '{NUMPAD4}', '{NUMPAD5}', '{NUMPAD6}', '{NUMPADMULT}', _
    '{NUMPAD1}', '{NUMPAD2}', '{NUMPAD3}', '{NUMPADSUB}', _
    '{BACKSPACE}', '{NUMPAD0}', '{NUMPADDOT}', '{NUMPADADD}', _
    '{DEL}', '{ENTER}']
    Global $aAccelKeys[18][2], $ahButtons[18]

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

    $hGui = GUICreate('Taschenrechner', 228, 280)
    GUISetOnEvent($GUI_EVENT_CLOSE, '_End')
    GUISetFont(14, 600, 0, 'Verdana')
    $hOutput = GUICtrlCreateLabel('', 16, 10, 196, 28, $SS_RIGHT, $WS_EX_STATICEDGE)
    GUICtrlSetFont(-1, 14, 400)
    GUICtrlSetBkColor(-1, 0xAAFFAA)
    For $i = 0 To 17
    If $i = 17 Then
    $ahButtons[$i] = GUICtrlCreateButton($aButtons[$i], 74, 48 + Int($i / 4) * 48, 80, 32)
    Else
    $ahButtons[$i] = GUICtrlCreateButton($aButtons[$i], 26 + Mod($i, 4) * 48, 48 + Int($i / 4) * 48, 32, 32)
    EndIf
    GUICtrlSetOnEvent(-1, '_Input')
    $aAccelKeys[$i][0] = $aKeys[$i]
    $aAccelKeys[$i][1] = $ahButtons[$i]
    Next
    GUISetAccelerators($aAccelKeys, $hGui)
    GUISetState()

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

    While Sleep(50)
    WEnd

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

    Func _End()
    Exit
    EndFunc ;==>_End

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

    Func _Input()
    Local $iPressed = @GUI_CtrlId - $ahButtons[0]
    GUICtrlSetState(@GUI_CtrlId, $GUI_HIDE)
    Sleep(50)
    GUICtrlSetState(@GUI_CtrlId, $GUI_SHOW)
    Switch $iPressed
    Case 17 ; "=" gedrückt
    GUICtrlSetData($hOutput, Execute(GUICtrlRead($hOutput)))
    Case 16 ; "C" gedrückt
    GUICtrlSetData($hOutput, '')
    Case 12 ; "<-" gedrückt
    GUICtrlSetData($hOutput, StringTrimRight(GUICtrlRead($hOutput), 1))
    Case Else ; restliche Tasten
    GUICtrlSetData($hOutput, GUICtrlRead($hOutput) & $aButtons[$iPressed])
    EndSwitch
    GUICtrlSetState(@GUI_CtrlId, $GUI_FOCUS)
    EndFunc ;==>_Input

    [/autoit]
  • Mach flott den Schrott 2

    • Oscar
    • 2. Mai 2011 um 15:11

    Ja zugegeben, ich habe schon einiges "zusammengeschraubt" und die Aktion des ct-Magazins (ich bin übrigens Abonnent, kenne die Aktion also bereits :-)) finde ich richtig gut. Was dabei für Ideen umgesetzt werden ist immer wieder faszinierend. Ich hätte hier auch diversen Elektronik-"Schrott" rumfliegen, nur fehlt mir momentan die Zeit...und an Ideen fehlt es mir leider auch. :rolleyes:

  • EDID / DDC Daten direkt vom Monitor lesen

    • Oscar
    • 2. Mai 2011 um 14:47

    Ich hatte mal dieses Skript archiviert:

    Spoiler anzeigen
    [autoit]


    ; Retrieve Monitor Model and Serial
    ; 13 November 2005 by Geert (NL)
    ; used parts made by archrival (http://www.autoitscript.com/forum/index.php?showtopic=11136)
    ; Edited/upgraded by rover 20 June 2008

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

    ; Collect EDID strings for all active monitors

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

    ;Links
    ;http://en.wikipedia.org/wiki/Extended_…tification_data
    ;http://www.lavalys.com/forum/lofivers….php/t1829.html
    ;http://cwashington.netreach.net/depo/view.asp?…ptType=vbscript

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

    #AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    Opt("MustDeclareVars", 1)

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

    ; ConsoleWrites slow a script if not needed
    Global $bDebug = True ; change to False or comment out/remove ConsoleWrite() lines if debugging to console not needed

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

    Global $bDisplayAll = False ; if false only 'Active' monitors (reg entries with 'Control' key) with EDID info reported
    ; 'Active' monitors with no reported EDID data(serial, name, date) are ignored

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

    Global $asEDID[1][2] = [[0, 0]]
    Global $iCounterEDID = 0, $sResults
    Global $edidarray[1], $error1, $error2, $error3
    Global $iCounterMonitorName = 1, $iCounterMonitorCode, $iCounterMonitorControlFolder
    Global $sMonitorName, $sMonitorCode, $sMonitorControlFolder, $sMonitorEDIDRead
    Global $ser, $name, $j, $sManuDate, $sEDIDVer

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

    Do
    $sMonitorName = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY", $iCounterMonitorName)
    $error1 = @error
    If $bDebug Then ConsoleWrite(@CRLF & '@@ Debug(' & @ScriptLineNumber & ') : $sMonitorName = ' & _
    StringStripWS($sMonitorName, 2) & @CRLF & '>Error code: ' & $error1 & @CRLF)
    If $sMonitorName <> "" Then
    $iCounterMonitorCode = 1
    Do
    ; Search 'monitor code' - e.g. 5&3aba5caf&0&10000080&01&00
    $sMonitorCode = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _
    $sMonitorName, $iCounterMonitorCode)
    $error2 = @error
    If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorCode = ' & _
    StringStripWS($sMonitorCode, 2) & @CRLF & '>Error code: ' & $error2 & @CRLF)
    ; Search Control folder - When available, the active monitor is found
    $iCounterMonitorControlFolder = 1
    Do
    $sMonitorControlFolder = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _
    $sMonitorName & "\" & $sMonitorCode, $iCounterMonitorControlFolder)
    $error3 = @error
    If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorControlFolder = ' & _
    StringStripWS($sMonitorControlFolder, 2) & @CRLF & '>Error code: ' & $error3 & @CRLF)
    If $sMonitorControlFolder == "Control" Then; Active monitor found!
    Switch RegEnumVal("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & $sMonitorName & _
    "\" & $sMonitorCode & "\Device Parameters", 1)
    Case "EDID"
    $sMonitorEDIDRead = RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _
    $sMonitorName & "\" & $sMonitorCode & "\Device Parameters", "EDID")
    If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorEDIDRead = ' & _
    $sMonitorEDIDRead & @CRLF & '>Error code: ' & @error & @CRLF)
    If $sMonitorEDIDRead <> "" And Not @error Then
    $iCounterEDID += 1
    $asEDID[0][0] = $iCounterEDID
    ReDim $asEDID[UBound($asEDID) + 1][2]
    $asEDID[UBound($asEDID) - 1][0] = $sMonitorEDIDRead; Add found EDID string to Array
    $asEDID[UBound($asEDID) - 1][1] = $sMonitorName
    EndIf
    Case "BAD_EDID"
    $iCounterEDID += 1
    $asEDID[0][0] = $iCounterEDID
    ReDim $asEDID[UBound($asEDID) + 1][2]
    $asEDID[UBound($asEDID) - 1][0] = "BAD_EDID"; Add BAD_EDID string to Array
    $asEDID[UBound($asEDID) - 1][1] = $sMonitorName
    EndSwitch
    EndIf
    $iCounterMonitorControlFolder += 1; Increase counter to search for next folder
    Until $error3 <> 0
    $iCounterMonitorCode += 1; Increase counter to search for next 'monitor code' folder
    Until $error2 <> 0
    EndIf
    $iCounterMonitorName += 1; Increase counter to search for next monitor
    Until $error1 <> 0

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

    ; Extract info from collected EDID strings - Thanks archrival
    If $asEDID[0][0] Then
    For $k = 1 To $asEDID[0][0]
    Switch $asEDID[$k][0]
    Case "BAD_EDID"
    If Not $bDisplayAll Then ContinueLoop
    $ser = "BAD_EDID"
    $name = "BAD_EDID"
    Case Else
    $j = 0
    ReDim $edidarray[StringLen($asEDID[$k][0])]
    $edidarray[0] = (StringLen($asEDID[$k][0]) / 2) + 1
    For $i = 1 To StringLen($asEDID[$k][0]) Step 2
    $j += 1
    $edidarray[$j] = Dec(StringMid($asEDID[$k][0], $i, 2))
    Next
    $ser = StringStripWS(_FindMonitorSerial($edidarray), 1 + 2)
    $name = StringStripWS(_FindMonitorName($edidarray), 1 + 2)
    If $name <> "Not Found" Then
    $sManuDate = StringStripWS(_FindMonitorManuDate($asEDID[$k][0]), 1 + 2)
    $sEDIDVer = StringStripWS(_FindMonitorEDIDVer($asEDID[$k][0]), 1 + 2)
    Else
    $sManuDate = ""
    $sEDIDVer = ""
    EndIf
    If Not $bDisplayAll Then
    If $name = "Not Found" Then ContinueLoop
    EndIf
    EndSwitch

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

    $sResults &= @CRLF & "Monitor #" & $k & @CRLF & "VESA Monitor ID" & @TAB & $asEDID[$k][1] & @CRLF & _
    "Serial: " & @TAB & @TAB & $ser & @CRLF & "Name: " & @TAB & @TAB & $name & @CRLF & _
    "ManuDate: " & @TAB & $sManuDate & @CRLF & "EDID: " & @TAB & @TAB & $sEDIDVer & @CRLF
    Next
    Else
    ; No EDID or BAD_EDID entries found
    $sResults = "No Monitors Found"
    EndIf

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

    ;Show MonitorSerial & MonitorName: no info? -> Your using a notebook right!
    MsgBox(64, "Active Monitor EDID Info", $sResults)
    Exit

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

    #Region - Functions
    Func _FindMonitorSerial(ByRef $aArray); Thanks archrival
    If Not IsArray($aArray) Then Return
    Local $sSernumstr = "", $iSernum = 0, $iEndstr = 0
    For $i = 1 To (UBound($aArray) / 2) - 4
    If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And $aArray[$i + 2] = "0" _
    And $aArray[$i + 3] = "255" And $aArray[$i + 4] = "0" Then
    $iSernum = $i + 4
    EndIf
    Next
    If $iSernum Then
    For $i = 1 To 13
    If $aArray[$iSernum + $i] = "10" Then
    $iEndstr = 1
    ElseIf Not $iEndstr Then
    $sSernumstr &= Chr($aArray[$iSernum + $i])
    EndIf
    Next
    Else
    Return "Not Found"
    EndIf
    Return $sSernumstr
    EndFunc ;==>_FindMonitorSerial

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

    Func _FindMonitorName(ByRef $aArray); Thanks archrival
    If Not IsArray($aArray) Then Return
    Local $n = 0, $sNamestr = "", $iEndstr = 0
    For $i = 1 To (UBound($aArray) / 2) - 4
    If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And _
    $aArray[$i + 2] = "252" And $aArray[$i + 3] = "0" Then
    $n = $i + 3
    EndIf
    Next
    If $n Then
    For $i = 1 To 13
    If $aArray[$n + $i] = "10" Then
    $iEndstr = 1
    ElseIf Not $iEndstr Then
    $sNamestr &= Chr($aArray[$n + $i])
    EndIf
    Next
    Else
    Return "Not Found"
    EndIf
    Return $sNamestr
    EndFunc ;==>_FindMonitorName
    #EndRegion - Functions

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

    Func _FindMonitorManuDate(ByRef $sEDID)
    Local $wk, $yr
    $wk = Dec(StringMid($sEDID, 33, 2)) ; 10h BYTE week number of manufacture
    $yr = Dec(StringMid($sEDID, 35, 2)) + 1990 ; 11h BYTE manufacture year - 1990
    If $wk = 0 Or $wk > 52 Or $yr < 2000 Or $yr > @YEAR Then
    Return ""
    EndIf
    Return "Week " & $wk & "/" & $yr
    EndFunc ;==>_FindMonitorManuDate

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

    Func _FindMonitorEDIDVer(ByRef $sEDID)
    Local $iEDIDVer, $iEDIDRev
    $iEDIDVer = Dec(StringMid($sEDID, 37, 2)) ; 12h BYTE EDID version
    $iEDIDRev = Dec(StringMid($sEDID, 39, 2)) ; 13h BYTE EDID revision
    If $iEDIDVer < 1 Or $iEDIDRev < 2 Then
    Return ""
    EndIf
    Return "v" & $iEDIDVer & "." & $iEDIDRev
    EndFunc ;==>_FindMonitorEDIDVer

    [/autoit]


    Vielleicht hilft Dir das ja weiter...

  • String löschen

    • Oscar
    • 28. April 2011 um 17:43

    Das ginge auch so:

    [autoit]


    $string = '<select style="width: 128px;" id="HundeForm" name="Collies">' & @CR & '<option value="375">Dackel</option>' & @CR & '<option value="800">Collie</option>' & @CR & '<option value="900">Schäferhund</option>'

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

    $out = StringRegExpReplace($string, '<.+(id=".+?") (name=".+?").+', '$1' & @CR & '$2')
    $opt = StringRegExp($string, '<option value="(.+?)">(.+?)</option>', 3)
    If IsArray($opt) Then
    For $i = 0 To UBound($opt) - 1 Step 2
    $out &= @CR & $opt[$i + 1] & '=' & $opt[$i]
    Next
    EndIf
    MsgBox(0, '', $out)

    [/autoit]
  • String löschen

    • Oscar
    • 28. April 2011 um 13:00

    Oder so:

    [autoit]


    $string = '<select style="width: 128px;" id="HundeForm" name="Collies">'
    $out = StringRegExpReplace($string, '<.+(id=.+)>', '$1')
    MsgBox(0, '', $out)

    [/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™