1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Xenobiologist

Beiträge von Xenobiologist

  • Häufigkeit eines Strings/Integers in Array

    • Xenobiologist
    • 19. Juli 2007 um 15:24

    Hi,

    schneller Versuch:

    [autoit]

    Dim $array[3]
    $array[0] = "Test"
    $array[1] = "Bla"
    $array[2] = "Test"

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

    MsgBox(0,"",_countStringInArray('Test', $array))

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

    Func _countStringInArray($string, $array, $start = 0, $end = 0)
    Local $count = 0
    If $end = 0 Then $end = UBound($array)-1
    For $i = $start To $end
    If $array[$i] == $string Then $count += 1
    Next
    Return $count
    EndFunc

    [/autoit]

    So long,

    Mega

  • WinGetKey

    • Xenobiologist
    • 19. Juli 2007 um 13:52

    HI,

    Spoiler anzeigen
    [autoit]

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Thorsten Meger
    ;
    ; Script Function:
    ; Windows XP Information displayed in a GUI
    ; with Office-Key (only Office XP or 2003 supported)
    ;
    ; ----------------------------------------------------------------------------

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

    #include <GUIConstants.au3>

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

    ;GUI
    $GUI = GUICreate("Windows Information", 685, 450, 158, 127)

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

    ;Labels
    $windowsInformation_L = GUICtrlCreateLabel("Windows Information", 8, 8, 659, 25)
    $status_L = GUICtrlCreateLabel("Information read out ...", 24, 80, 400, 17)
    $description_L = GUICtrlCreateLabel("Description", 16, 112, 103, 17)
    $windowsType_L = GUICtrlCreateLabel("WindowsType", 16, 152, 103, 17)
    $serialNumber_L = GUICtrlCreateLabel("SerialNumber", 16, 192, 103, 17)
    $ProductKey_L = GUICtrlCreateLabel("ProductKey", 16, 232, 103, 17)
    $InstallDate_L = GUICtrlCreateLabel("InstallDate", 16, 272, 103, 17)
    $LastBootUpTime_L = GUICtrlCreateLabel("LastBootUpTime", 16, 312, 103, 17)
    $RegisteredOwner_L = GUICtrlCreateLabel("RegisteredOwner", 16, 352, 103, 17)
    $officeKey_L = GUICtrlCreateLabel("OfficeKey", 16, 392, 103, 17)

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

    ;Input
    $description_I = GUICtrlCreateInput("Description", 130, 112, 389, 21)
    $windowsType_I = GUICtrlCreateInput("WindowsType", 130, 152, 389, 21)
    $serialNumber_I = GUICtrlCreateInput("SerialNumber", 130, 192, 389, 21)
    $ProductKey_I = GUICtrlCreateInput("ProductKey", 130, 232, 389, 21)
    $InstallDate_I = GUICtrlCreateInput("InstallDate", 130, 272, 389, 21)
    $LastBootUpTime_I = GUICtrlCreateInput("LastBootUpTime", 130, 312, 389, 21)
    $RegisteredOwner_I = GUICtrlCreateInput("RegisteredOwner", 130, 352, 389, 21)
    $officeKey_I = GUICtrlCreateInput("OfficeKey", 130, 392, 389, 21)

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

    ;Groups
    $informationPanel_G = GUICtrlCreateGroup("Information Panel", 8, 48, 585, 393)
    $status_G = GUICtrlCreateGroup("Status", 14, 64, 553, 41)
    $buttins_G = GUICtrlCreateGroup("Buttons", 608, 48, 65, 393)
    $office_G = GUICtrlCreateGroup("Microsoft Office", 14, 375, 553, 48)

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

    ;Buttons
    $exit_B = GUICtrlCreateButton("Exit", 616, 72, 49, 25, 0)
    $Description_B = GUICtrlCreateButton("clipboard", 616, 112, 49, 25, 0)
    $WindowsType_B = GUICtrlCreateButton("clipboard", 616, 152, 49, 25, 0)
    $SerialNumber_B = GUICtrlCreateButton("clipboard", 616, 192, 49, 25, 0)
    $ProductKey_B = GUICtrlCreateButton("clipboard", 616, 232, 49, 25, 0)
    $InstallDate_B = GUICtrlCreateButton("clipboard", 616, 272, 49, 25, 0)
    $LastBootUpTime_B = GUICtrlCreateButton("clipboard", 616, 312, 49, 25, 0)
    $registeredOwner_B = GUICtrlCreateButton("clipboard", 616, 352, 49, 25, 0)
    $OfficeKey_B = GUICtrlCreateButton("clipboard", 616, 392, 49, 25, 0)

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

    ; SetFont
    $font = "Comic Sans MS"
    GUICtrlSetFont($windowsInformation_L, 16, 400, 4, $font)

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

    ;ProgressBar
    $progressbar = GUICtrlCreateProgress(140, 75, 400, 25)

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

    ;Global variables
    Global $product = "" ; Office product Version (XP or 2003)
    Global $counter = 3 ; Counter for progressBar
    Global $wait = 150 ; Wait for progessBar

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

    GUISetState(@SW_SHOW)

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

    While 1
    $msg = GUIGetMsg()
    If $counter = 3 Then
    Sleep(500)
    GUICtrlSetData($status_L, "Initialize... " & $counter)
    progress()
    $counter -= 1
    ElseIf $counter = 2 Then
    GUICtrlSetData($status_L, "Initialize... " & $counter)
    progress()
    $counter -= 1
    ElseIf $counter = 1 Then
    GUICtrlSetData($status_L, "Initialize... " & $counter)
    progress()
    $counter -= 1
    ElseIf $counter = 0 Then
    GUICtrlSetData($status_L, "Ready ...")
    progress()
    $counter -= 1
    ElseIf $counter = -1 Then
    Dim $Bin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductID")
    Dim $key4RegisteredOwner = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
    $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
    $colSettings = $objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

    For $objOperatingSystem In $colSettings
    Next
    GUICtrlSetData($description_I, StringMid($objOperatingSystem.Description, 1))
    GUICtrlSetData($windowsType_I, '(' & @OSVersion & ') ' & StringMid($objOperatingSystem.Caption, 19))
    GUICtrlSetData($serialNumber_I, StringMid($objOperatingSystem.SerialNumber, 1))
    GUICtrlSetData($ProductKey_I, DecodeProductKey($Bin))
    GUICtrlSetData($InstallDate_I, WMIDateStringToDate($objOperatingSystem.InstallDate))
    GUICtrlSetData($LastBootUpTime_I, WMIDateStringToDate($objOperatingSystem.LastBootUpTime))
    GUICtrlSetData($RegisteredOwner_I, RegRead($key4RegisteredOwner, "RegisteredOwner"))
    GUICtrlSetData($officeKey_I, getOfficeKey())
    GUICtrlSetData($officeKey_L, "Office " & $product)
    $counter -= 1
    ElseIf $counter < - 1 Then
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $exit_B
    GUICtrlSetData($status_L, "So long, Mega")
    Sleep(1500)
    ExitLoop
    Case $msg = $Description_B
    ClipPut(StringMid($objOperatingSystem.Description, 1))
    GUICtrlSetData($status_L, "Description copied to clipboard")
    Case $msg = $WindowsType_B
    ClipPut('(' & @OSVersion & ') ' & StringMid($objOperatingSystem.Caption, 19))
    GUICtrlSetData($status_L, "WindowsType copied to clipboard")
    Case $msg = $SerialNumber_B
    ClipPut(StringMid($objOperatingSystem.SerialNumber, 1))
    GUICtrlSetData($status_L, "SerialNumber copied to clipboard")
    Case $msg = $ProductKey_B
    ClipPut(DecodeProductKey($Bin))
    GUICtrlSetData($status_L, "ProductKey copied to clipboard")
    Case $msg = $InstallDate_B
    ClipPut(WMIDateStringToDate($objOperatingSystem.InstallDate))
    GUICtrlSetData($status_L, "InstallDate copied to clipboard")
    Case $msg = $LastBootUpTime_B
    ClipPut(WMIDateStringToDate($objOperatingSystem.LastBootUpTime))
    GUICtrlSetData($status_L, "LastBootUpTime copied to clipboard")
    Case $msg = $registeredOwner_B
    ClipPut(RegRead($key4RegisteredOwner, "RegisteredOwner"))
    GUICtrlSetData($status_L, "RegisteredOwner copied to clipboard")
    Case $msg = $OfficeKey_B
    ClipPut(getOfficeKey())
    GUICtrlSetData($status_L, "OfficeKey copied to clipboard")
    Case Else
    ;;;;;;;
    EndSelect
    EndIf
    WEnd
    Exit

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

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Unknown & Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]>
    ;
    ; Script Function: Decode REG_BINARY
    ; ----------------------------------------------------------------------------

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

    Func DecodeProductKey($BinaryDPID)
    Local $bKey[15]
    Local $sKey[29]
    Local $Digits[24]
    Local $Value = 0
    Local $hi = 0
    Local $n = 0
    Local $i = 0
    Local $dlen = 29
    Local $slen = 15
    Local $Result

    $Digits = StringSplit("BCDFGHJKMPQRTVWXY2346789", "")
    $BinaryDPID = StringMid($BinaryDPID, 105, 30)
    For $i = 1 To 29 Step 2
    $bKey[Int($i / 2) ] = Dec(StringMid($BinaryDPID, $i, 2))
    Next
    For $i = $dlen - 1 To 0 Step - 1
    If Mod(($i + 1), 6) = 0 Then
    $sKey[$i] = "-"
    Else
    $hi = 0
    For $n = $slen - 1 To 0 Step - 1
    $Value = BitOR(BitShift($hi, -8), $bKey[$n])
    $bKey[$n] = Int($Value / 24)
    $hi = Mod($Value, 24)
    Next
    $sKey[$i] = $Digits[$hi + 1]
    EndIf
    Next
    For $i = 0 To 28
    $Result = $Result & $sKey[$i]
    Next
    Return $Result
    EndFunc ;==>DecodeProductKey

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

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Unknown & Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]>
    ;
    ; Script Function: WMIDateStringToDate (changed Date format)
    ; ----------------------------------------------------------------------------

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

    Func WMIDateStringToDate($dtmDate)
    Return (StringMid($dtmDate, 7, 2) & "/" & _
    StringMid($dtmDate, 5, 2) & "/" & StringLeft($dtmDate, 4) _
    & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate, 13, 2))
    EndFunc ;==>WMIDateStringToDate

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

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]>
    ;
    ; Script Function: Display a "fake" progressbar at the beginning
    ; ----------------------------------------------------------------------------

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

    Func progress()
    If $counter = 3 Then
    For $i = 0 To 20 Step 1
    GUICtrlSetData($progressbar, $i)
    Sleep($wait / 20)
    Next
    ElseIf $counter = 2 Then
    For $i = 20 To 50 Step 1
    GUICtrlSetData($progressbar, $i)
    Sleep($wait / 30)
    Next
    ElseIf $counter = 1 Then
    For $i = 50 To 80 Step 1
    GUICtrlSetData($progressbar, $i)
    Sleep($wait / 30)
    Next
    ElseIf $counter = 0 Then
    For $i = 80 To 100 Step 1
    GUICtrlSetData($progressbar, $i)
    Sleep($wait / 20)
    Next
    GUICtrlSetState($progressbar, $GUI_HIDE)
    EndIf
    EndFunc ;==>progress

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

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]>
    ;
    ; Script Function:Get & decode OfficeKey
    ; ----------------------------------------------------------------------------

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

    Func getOfficeKey()
    Local $List[1]
    Local $i = 1
    $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot", "Path")
    If $var <> "" Then
    $product = "2003"
    Dim $officeKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Registration"
    Else
    $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Common\InstallRoot", "Path")
    If @error <> 0 Then
    GUICtrlSetData($status_L, "Info: Unable to find installationPath, maybe no Office installed!")
    Return "No Office XP or 2003 found"
    EndIf
    If $var <> "" Then
    $product = "XP"
    Dim $officeKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Registration"
    EndIf
    EndIf
    Dim $var = RegEnumKey($officeKey, $i)
    If @error <> 0 Then
    GUICtrlSetData($status_L, "Info: Unable to find REG_BINARY 'DigitalProductID', maybe no Office installed!")
    Return "No Office XP or 2003 found"
    Else
    $List[$i - 1] = RegRead($officeKey & "\" & $var, "DigitalProductID")
    If $List[$i - 1] = "" Then
    GUICtrlSetData($status_L, "Info: Unable to find REG_BINARY 'DigitalProductID', maybe no Office installed!")
    Else
    $key = $List[$i - 1]
    Return DecodeProductKey($key)
    EndIf
    EndIf
    EndFunc ;==>getOfficeKey

    [/autoit]

    So long,

    Mega

  • VBS-Aufruf in AutoIt "übersetzen" / Methodenaufruf in Autoit

    • Xenobiologist
    • 19. Juli 2007 um 13:44

    Hi,

    was willst du denn überhaupt machen?

    So long,

    Mega

  • Letztes Fenster wieder aktivieren

    • Xenobiologist
    • 19. Juli 2007 um 13:41

    Hi,

    das wird nicht funktionieren. Damit wird nur das aktive Fenster aktiv. Er will ja das vorher aktive herausfinden.

    So long,

    Mega

  • Broadcast-Meldung von Server an alle verschicken

    • Xenobiologist
    • 19. Juli 2007 um 09:49

    Hi,

    ich glaube was du meinst ist net send IP ...

    Dafür muss aber der Nachrichtendienst aktiviert sein. Dieser ist aber eigentlich mittlerweile in allen größeren Netzen abgeklemmt.

    So long,

    Mega

  • Screenshot.exe geht nicht mehr.....

    • Xenobiologist
    • 18. Juli 2007 um 18:26

    Hi,

    nutz doch einfach :

    [autoit]

    $CaptureDirectory =@ScriptDir
    $CaptureFile = "001.jpg"
    $pos = WinGetPos("")
    $left = $pos[0]
    $top = $pos[1]
    $width = $left+50; wieviel vom fenster
    $height = $top+50; wieviel vom fenster
    $Quality = 100
    DllCall("captdll.dll", "int", "CaptureRegion", "str", $CaptureDirectory & "\" & _
    $CaptureFile, "int", $left, "int", $top, "int", $width, "int", $height, "int", $Quality)

    [/autoit]

    So long,

    Mega

  • PDF-Html Datei ausdrucken

    • Xenobiologist
    • 18. Juli 2007 um 18:21

    Hi,

    guck die mal _FilePrint an.

    So long,

    Mega

  • Programm vom USB-Stick starten

    • Xenobiologist
    • 18. Juli 2007 um 18:13

    Hi,

    das ganze hat wie beschrieben auch seinen Sinn. Ich würde deinen Chef auch von diesem überzeugen. :D

    So long,

    Mega

  • Ordner Datum

    • Xenobiologist
    • 18. Juli 2007 um 18:04

    Hi,

    hier habe ich auch noch was gefunden :

    http://www.autoitscript.com/forum/index.php?showtopic=4800&st=0&p=30391&#entry30391

    So long,

    Mega

  • CMD inhalt auslesen

    • Xenobiologist
    • 18. Juli 2007 um 17:09

    Hui,

    schwere Geburt. :D

    So long,

    Mega

  • CMD inhalt auslesen

    • Xenobiologist
    • 18. Juli 2007 um 16:13

    Hi,

    dann mach doch sowas:

    Spoiler anzeigen
    [autoit]

    #include <Constants.au3>
    Global $text
    Global $command = "set"

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

    $stream = Run(@ComSpec & ' /c ' & $command, '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

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

    While 1
    $textline = StdoutRead($stream)
    $text = $text & @CRLF & $textline
    If @error Then ExitLoop
    WEnd

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

    MsgBox(0, "STDOUT read:", $text)

    [/autoit]

    So long,

    Mega

  • Random

    • Xenobiologist
    • 18. Juli 2007 um 16:10

    Hi,

    [autoit]

    Send("{down " & Random(1, 20, 1) & "}")

    [/autoit]

    So long,

    Mega

  • CMD inhalt auslesen

    • Xenobiologist
    • 18. Juli 2007 um 15:14

    Hi,

    verstehe ich nicht? Was wolltest du denn? IN $var steht doch alles drin.

    So long,

    Mega

  • CMD inhalt auslesen

    • Xenobiologist
    • 18. Juli 2007 um 14:53

    Hi,

    ???

    [autoit]

    Opt('WinTitleMatchMode', 2)
    Global $title = 'C:\WINNT\system32\cmd.exe'
    Run('cmd.exe', '', @SW_HIDE)
    Sleep(500)
    ControlClick($title, '', '', 'right', 1, 1, 1)
    Sleep(400)
    ControlSend($title, '', '', 'a')
    Sleep(400)
    ControlSend($title, '', '', '{enter}')
    $var = ClipGet()
    MsgBox(0,"", $var)

    [/autoit]

    So long,

    Mega

  • CMD inhalt auslesen

    • Xenobiologist
    • 18. Juli 2007 um 14:24

    Hi,

    möchtest du nicht einen Befehl absetzen und nur das Ergebnis des Befehls catchen?

    So long,

    Mega

  • Zusätzlichen LAN-Service installieren

    • Xenobiologist
    • 18. Juli 2007 um 13:22

    HI,

    einfach danach googlen, es gibt viele Seiten, wo die Befehle aufgelistet sind.

    So long,

    Mega

  • shellexecute, 'print' , Auswahlfenster Drucker

    • Xenobiologist
    • 18. Juli 2007 um 09:48

    HI,
    geht _Fileprint nicht?

    So long,

    Mega

  • Downloadgeschwindigkeit anzeigen [InetGet]

    • Xenobiologist
    • 17. Juli 2007 um 21:56

    Hi,

    die Zeit kannst du stoppen und dann läßt sich alles errechnen.

    So long,

    Mega

  • Brauche Hilfe mit Script

    • Xenobiologist
    • 17. Juli 2007 um 21:43

    Hi,

    @ASJ : du sollst doch nicht alles verraten. Das hätte er auch selbst gefunden. :)

    Einfach irgendwo hinklicken?

    Random mit @DesktopHeight und @DesktopWidth

    So long,

    Mega

  • Downloadgeschwindigkeit anzeigen [InetGet]

    • Xenobiologist
    • 17. Juli 2007 um 21:40

    Hi,

    das Bsp aus der Hilfe tut dies doch schon "fast" mit

    [autoit]


    While @InetGetActive
    TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
    Sleep(250)
    Wend

    [/autoit]

    So long,

    Mega

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™