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

  • Infos aus Anwendung (EXE) auslesen

    • Xenobiologist
    • 12. März 2009 um 16:39

    Gern doch. War ja nur Copy Paste für mich. Die selben Dinge brauchte ich ja auch mal ...

    Mega

  • Infos aus Anwendung (EXE) auslesen

    • Xenobiologist
    • 12. März 2009 um 15:51
    Spoiler anzeigen
    [autoit]

    #include-once

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

    ; #INDEX# =======================================================================================================================
    ; Title .........: FileSetVersion
    ; AutoIt Version: 3.2.10++
    ; Language: English
    ; Description ...: Updating the StringFileInfo section.
    ; ===============================================================================================================================

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

    ; Example
    ;#include <_FileSetVersion.au3>
    #cs
    ; Use Notepad as example...
    FileCopy(@WindowsDir & "\Notepad.exe", @ScriptDir)
    $FineName = @ScriptDir & "\OutPutFile.exe"
    $FineName = @ScriptDir & "\Notepad.exe"

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

    ; save old field information
    $OldCompanyName = FileGetVersion($FineName, "CompanyName")
    MsgBox(4096, "Old Company name", $OldCompanyName)

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

    ; set new field information
    If _FileSetVersion($FineName, "CompanyName", "_FileSetVersion ;-)") = 1 Then
    $NewCompanyName = FileGetVersion($FineName, "CompanyName")
    MsgBox(4096, "New Company name", $NewCompanyName)
    ; Restore old field information
    _FileSetVersion($FineName, "CompanyName", $OldCompanyName)
    Else
    MsgBox(4096, "Error!", "Can not set the field CompanyName!")
    EndIf
    #ce

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

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; __NullEntryPoint
    ; __NullRepeat
    ; __Binary
    ;================================================================================================================================

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _FileSetVersion
    ; Description ...: Updating the StringFileInfo section.
    ; Syntax.........: _FileSetVersion( FileName, "StringName", "StringText" )
    ; Parameters ....: FileName - Path and filename.
    ; StringName- name of the field info, default is "FileVersion".
    ; StringText- string to fill the field info, default is @AutoItVersion.
    ; Return values .: Success - Returns 1 and set @error to 0
    ; Failure - Returns 0 and set @error to 1
    ; Author ........: jscript "FROM BRAZIL"
    ; Modified.......:
    ; Remarks .......: The information contained in the StringFileInfo section is not necessarily more difficult
    ; to change, but it does have the constraint that the new information be the same size or smaller
    ; than the old information. Extra characters would inevitably write on something important.
    ; Related .......: FileGetVersion
    ; Link ..........;
    ; Example .......; Yes
    ; ===============================================================================================================================
    Func _FileSetVersion($hFileName, $sStringName = "FileVersion", $sStringText = @AutoItVersion)
    ;==============================================
    ; Local Constant/Variable Declaration Section
    ;==============================================
    Local $iResourceSize, $hFileOpen, $bFileRead, $bSearch, $bReplace, $bHex, $NewResSize, $iPos
    Local $aStrSplit, $iResFieldSize, $bBinStrName, $sBinStrText, $sFileGetInfo, $iValue, $iCont
    Local $bHeader = "34000000560053005f00560045005200530049004f004e005f0049004e0046004f"
    Local $bEndHeader = "5400720061006e0073006c006100740069006f006e0000000000"
    ;
    ; If not file found return 0 and set @error to 1
    If Not FileExists($hFileName) Then Return SetError(1, 0, 0)
    ;
    ; First open file in only binary read mode and close
    $hFileOpen = FileOpen($hFileName, 16)
    $bFileRead = FileRead($hFileOpen)
    FileClose($hFileOpen)
    ;
    ; Get resource info, if no version information found, return 0 and set @error to 1
    If FileGetVersion($hFileName) = "0.0.0.0" Then Return SetError(1, 0, 0)
    #cs
    ;
    ; Determine the size of the resource information
    $bSearch = StringMid($bFileRead, StringInStr($bFileRead, $bHeader, 0, -1) - 4, 4)
    ; Invert and return value in bytes
    $iResourceSize = Dec(StringRight($bSearch, 2) & StringLeft($bSearch, 2))
    #ce
    ;
    ; Update Resource information
    If $sStringName = "FILEVERSION" Or $sStringName = "PRODUCTVERSION" Then
    ;
    ; Split FileVersion, format is: 00.00.0000.0000
    $aStrSplit = StringSplit($sStringText, ".")
    ; If wrong FileVersion format, return 0 and set @error to 1
    If $aStrSplit[0] > 4 Then Return SetError(1, 0, 0)
    ;
    ; Convert to Hex and Invert data
    Dim $bReplace[5] = [5, Hex(0, 4), Hex(0, 4), Hex(0, 4), Hex(0, 4)]
    For $i = 1 To $aStrSplit[0]
    $bHex = Hex($aStrSplit[$i], 4)
    $bReplace[$i] = StringRight($bHex, 2) & StringLeft($bHex, 2)
    Next
    ;
    ; Set FILEVERSION / PRODUCTVERSION
    If $sStringName = "FILEVERSION" Then $iPos = StringInStr($bFileRead, "bd04effe00000100", 0, -1) + 16
    If $sStringName = "PRODUCTVERSION" Then $iPos = StringInStr($bFileRead, "bd04effe00000100", 0, -1) + 32
    $bFileRead = StringReplace($bFileRead, $iPos, $bReplace[2] & $bReplace[1] & $bReplace[4] & $bReplace[3])
    ; free the memory
    $aStrSplit = 0
    $bReplace = 0
    ;
    ; If error found, return 0 and set @error to 1
    If @error Then Return SetError(1, 0, 0)
    Else
    ; If FileGetVersion returns error then
    If @error Then Return SetError(1, 0, 0)
    ;
    ; Set the length of $sStringName resource field
    $bBinStrName = __Binary(__NullEntryPoint($sStringName))
    $iPos = StringInStr($bFileRead, $bBinStrName)
    $iValue = StringMid($bFileRead, $iPos + StringLen($bBinStrName), 10)
    For $i = 1 To 10
    $iCont = StringMid($iValue, $i, 2)
    If $iCont = "00" Then $bBinStrName &= __Binary(Chr("00"))
    If $iCont <> "00" Then ExitLoop
    $i += 1
    Next
    ;
    ; Get the resource field size
    $iValue = StringMid($bFileRead, $iPos + StringLen($bBinStrName), 400)
    For $i = 1 To 400
    If StringMid($iValue, $i, 6) = "000000" Then
    $iValue = Int($i / 2) + 3
    ExitLoop
    EndIf
    $i += 1
    Next
    $iResFieldSize = Dec(StringMid($bFileRead, $iPos - 8, 2))
    If $iValue > $iResFieldSize Then $iResFieldSize = $iValue
    ;
    If $iResFieldSize <= 1 Then Return SetError(1, 0, 0)
    ;
    ; fix $sStringText length
    $sBinStrText = __Binary(StringMid(__NullEntryPoint(__NullRepeat($sStringText, $iResFieldSize, 32)), 1, $iResFieldSize - 3))
    ;
    ; Replace resource
    $bFileRead = StringReplace($bFileRead, $iPos + StringLen($bBinStrName), $sBinStrText)
    ; If error found, return 0 and set @error to 1
    If @error Then Return SetError(1, 0, 0)
    ;
    ; Update resource field size
    $bHex = Hex($iResFieldSize, 2)
    $bFileRead = StringReplace($bFileRead, StringInStr($bFileRead, $bBinStrName, 0, -1) - 8, $bHex, 1)
    ; If error found, return 0 and set @error to 1
    If @error Then Return SetError(1, 0, 0)
    EndIf
    #cs
    ;
    ; Get new resource size
    $bSearch = StringMid($bFileRead, StringInStr($bFileRead, $bHeader, 0, 1) - 4)
    $bSearch = StringMid($bSearch, 1, StringInStr($bSearch, $bEndHeader, 0, -1) + 60)
    $iResourceSize = Int(BinaryLen($bSearch) / 2)
    ; Convert to Hex, invert and set new resource size
    $bHex = Hex($iResourceSize, 4)
    $iResourceSize = StringRight($bHex, 2) & StringLeft($bHex, 2)
    $bFileRead = StringReplace($bFileRead, StringInStr($bFileRead, $bHeader, 0, -1) - 4, $iResourceSize, 1)
    ;
    ; If error found, return 0 and set @error to 1
    If @error Then Return SetError(1, 0, 0)
    #ce
    ;
    ; Open file in binary write mode, save modified data and close
    $hFileOpen = FileOpen($hFileName, 18)
    ; If error found, return 0 and set @error to 1
    If $hFileOpen = -1 Then Return SetError(1, 0, 0)
    FileWrite($hFileOpen, $bFileRead)
    FileClose($hFileOpen)
    ;
    ; Set @error to 0 and return 1
    Return SetError(0, 0, 1)
    EndFunc ;==>_FileSetVersion

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

    Func _UnHexEntry($t)
    ;Return _StringReverse(_HexToString($t))
    EndFunc ;==>_UnHexEntry

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

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: __NullEntryPoint
    ; Description ...: Adding the Chr("00") enter each char.
    ; Syntax.........: __NullEntryPoint( $sString )
    ; Parameters ....: $sString - String to pass.
    ; Return values .: Success - Returns Chr("00") enter each char
    ; Failure -
    ; Author ........: jscript "FROM BRAZIL"
    ; Modified.......:
    ; Remarks .......:
    ; Related .......:
    ; Link ..........;
    ; Example .......;
    ; ===============================================================================================================================
    Func __NullEntryPoint($sString)
    ;==============================================
    ; Local Constant/Variable Declaration Section
    ;==============================================
    Local $iLen = StringLen($sString), $bNullString = "";Chr("00")
    ;
    For $i = 1 To $iLen
    $bNullString &= StringMid($sString, $i, 1)
    If $i = $iLen Then ExitLoop
    $bNullString &= Chr("00")
    Next
    Return $bNullString
    EndFunc ;==>__NullEntryPoint

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

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: __NullRepeat
    ; Description ...: Adding the Chr("00") at the end of the string
    ; Syntax.........: __NullRepeat( $sString, $iValue, $vChar = 0 )
    ; Parameters ....: $sString- String to pass.
    ; $iValue - Number of times to repeat
    ; $vChar - Char type, default is 00
    ; Return values .: Success - Returns Chr("00") enter each char
    ; Failure -
    ; Author ........: jscript "FROM BRAZIL"
    ; Modified.......:
    ; Remarks .......:
    ; Related .......:
    ; Link ..........;
    ; Example .......;
    ; ===============================================================================================================================
    Func __NullRepeat($sString, $iValue, $vChar = 0)
    ;==============================================
    ; Local Constant/Variable Declaration Section
    ;==============================================
    Local $sRepeat = ""
    ;
    $iValue = $iValue - StringLen($sString)
    If $iValue > 0 Then
    For $i = 1 To $iValue
    $sRepeat &= Chr($vChar)
    Next
    EndIf
    Return $sString & $sRepeat
    EndFunc ;==>__NullRepeat

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

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: __Binary
    ; Description ...: Returns the binary representation of an expression.
    ; Syntax.........: __Binary( $sExpression )
    ; Parameters ....: $sExpression - An expression to convert into binary/byte data.
    ; Return values .: Success - Returns a Binary variant without: 0x
    ; Failure -
    ; Author ........: jscript "FROM BRAZIL"
    ; Modified.......:
    ; Remarks .......:
    ; Related .......:
    ; Link ..........;
    ; Example .......;
    ; ===============================================================================================================================
    Func __Binary($sExpression)
    Return StringTrimLeft(Binary($sExpression), 2)
    EndFunc ;==>__Binary

    [/autoit]
  • Infos aus Anwendung (EXE) auslesen

    • Xenobiologist
    • 12. März 2009 um 09:39
    Spoiler anzeigen
    [autoit]

    #include<Array.au3>
    ;~ Global $filePath = @WindowsDir & '\System32\calc.exe'
    Global $filePath = @WindowsDir & '\notepad.exe'
    Global $info = _getFileInfo($filePath)

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

    If Not IsArray($info) Then
    MsgBox(16, 'Error', 'File not found!')
    Exit (0)
    EndIf

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

    _ArrayDisplay($info, 'FileInfo')

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

    Func _getFileInfo($path)
    If Not FileExists($path) Then Return -1
    Local $info_A[12][2]
    Local $string_A[12] = ['FileVersion', 'FileDescription', 'LegalCopyright', 'Comments', 'InternalName', _
    'ProductName', 'CompanyName', 'ProductVersion', 'LegalTrademarks', 'PrivateBuild', 'OriginalFilename', 'SpecialBuild']
    For $i = 0 To UBound($info_A) - 1
    $info_A[$i][0] = $string_A[$i]
    $info_A[$i][1] = FileGetVersion($path, $string_A[$i])
    Next
    Return $info_A
    EndFunc ;==>_getFileInfo

    [/autoit]

    Mega

  • Pixelgetcolor im Minimiertem Fenster

    • Xenobiologist
    • 11. März 2009 um 16:43

    Hi,

    lass das Bild doch kurz anzeigen und dann ermittelst du die Farbe

    Mega

  • Datum zweier Dateien vergleichen

    • Xenobiologist
    • 11. März 2009 um 15:27

    Noch nicht mal :

    [autoit]

    $explorer = FileGetTime(@SystemDir & "\calc.exe", 1, 1)
    $notepad = FileGetTime(@WindowsDir & "\Notepad.exe", 1, 1)
    ConsoleWrite('$notepad: ' & $notepad & @CRLF)
    ConsoleWrite('$explorer: ' & $explorer & @CRLF)
    If $explorer > $notepad Then
    ConsoleWrite("Explorer ist jünger" & @CRLF)
    Else
    ConsoleWrite("Explorer ist älter" & @CRLF)
    EndIf

    [/autoit]
  • Datum zweier Dateien vergleichen

    • Xenobiologist
    • 11. März 2009 um 11:01

    HI,

    mach es nicht so kompliziert. EInfach FileGetTime nutzen.

    Es gibt unterschiedliche Zeitstempel : modified, created, accessed.

    Mega

  • IE Suchergebnisse anzeigen

    • Xenobiologist
    • 10. März 2009 um 19:17

    Einfach den Source auslesen. (Firefox Strg+U) da siehst du wie alles drinsteht.

  • Dienste mit Programm.exe starten und beenden

    • Xenobiologist
    • 10. März 2009 um 18:27

    Hi,

    such mal nach services.au3, damit kannst du alles machen was du beschreibst.

    Mega

  • Feststellen ob ein Anwender angemeldet ist

    • Xenobiologist
    • 10. März 2009 um 18:24

    Hilft das?

    Spoiler anzeigen
    [autoit]

    $sLoggedInUser = ""
    $sLoggedInDomain = ""
    $sResults = ""
    $strComputer = "."
    $objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
    If IsObj($objWMIService) Then
    $colComputer = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

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

    For $objComputer In $colComputer
    $sLoggedInUser = $objComputer.UserName
    Next
    If StringInStr($sLoggedInUser,"\") Then
    $iSplit = StringInStr($sLoggedInUser,"\")
    $sLoggedInDomain = StringTrimRight($sLoggedInUser,(StringLen($sLoggedInUser) - $iSplit)+1)
    $sLoggedInUser = StringTrimLeft($sLoggedInUser,$iSplit)
    EndIf

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

    If $sLoggedInDomain <> "" Then $sResults &= "Logged in domain: " &$sLoggedInDomain &@CRLF
    If $sLoggedInUser <> "" Then $sResults &= "Logged in user: " &$sLoggedInUser & @CRLF
    $sResults &= "@UserName value: " &@UserName &@CRLF
    ConsoleWrite($sResults)
    Else
    ConsoleWrite("Unable to connect to WMI Service" & @CRLF)
    EndIf

    [/autoit]

    Mega

  • Maus Scroll

    • Xenobiologist
    • 10. März 2009 um 13:21

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

  • 7-Funktion im Eigenbau

    • Xenobiologist
    • 10. März 2009 um 10:11

    Hi,

    wie halbiert? Andocken geht.

    Mega

  • Frage zu der Zip - UDF

    • Xenobiologist
    • 9. März 2009 um 14:36

    Könnte ich zuhause testen. Ich denke aber schon.

  • DllCall funktioniert nicht

    • Xenobiologist
    • 9. März 2009 um 14:35

    Hmmh, kann ich nicht testen bzw. nachvollziehen. Bei mir geht es natürlich schief.

  • Frage zu der Zip - UDF

    • Xenobiologist
    • 9. März 2009 um 13:50

    Es gibt auch andere Zip.au3 UDFs mit denen es ganz einfach geht und sogar Bsp enthalten sind.

    Siehe : http://www.autoitscript.com/forum/index.php?showtopic=73425&hl=zip.au3

  • Datei mit Endung aus Link herausfinden...

    • Xenobiologist
    • 9. März 2009 um 13:45

    Hi,

    nimm doch StringRegExp oder _StringBetween und die Datei zu bekommen. Aber warum überhaupt, wenn du die URL hast, dann reicht diese doch bereits um die Datei mit INget zu laden.

    Mega

  • DllCall funktioniert nicht

    • Xenobiologist
    • 9. März 2009 um 13:42

    Hi,

    du hast doch schon am Anfang Probleme oder?

    [autoit]

    Global $dllIOW, $rslt1IOW, $rslt2IOW, $ptrIOW[16], $snIOW[9], $rslt1IOW

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

    ;Dll öffnen
    $dllIOW = DllOpen("iowkit.dll")
    ;IOWhandle übergeben
    $ptrIOW = DllCall($dllIOW, "ptr", "IowKitOpenDevice")
    If Not IsArray($ptrIOW) Then ConsoleWrite("Mist" & @CRLF)
    ;Anzahl der angeschlossenen Bausteine abfragen
    $rslt1IOW = DllCall($dllIOW, "int", "IowKitGetNumDevs")
    If Not IsArray($rslt1IOW) Then ConsoleWrite("Mist1" & @CRLF)
    ;ProductID abfragen
    $rslt2IOW = DllCall($dllIOW, "dword", "IowKitGetProductId", "ptr", $ptrIOW[0])
    If Not IsArray($rslt2IOW) Then ConsoleWrite("Mist2" & @CRLF)
    ;Seriennummer auslesen
    DllCall($dllIOW, "char", "IowKitGetSerialNumber", "ptr", $ptrIOW[0], "wchar", $snIOW)

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

    ;IOWhandle freigeben
    DllCall($dllIOW, "int", "IowKitCloseDevice", "ptr", $ptrIOW)
    ;Dll schließen
    DllClose($dllIOW)

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

    ;Anzeige
    ConsoleWrite("NUM " & $rslt1IOW[0] & @CRLF)
    ConsoleWrite("PID " & "0x" & Hex($rslt2IOW[0]) & @CRLF)
    ConsoleWrite("S/N " & $snIOW & @CRLF)

    [/autoit]

    Mega

  • mausklick abfangen / deaktivieren

    • Xenobiologist
    • 7. März 2009 um 18:42

    Hi,

    du könntest die Zeit ja auf 1 setzen.

    [autoit]

    Func _GetDoubleClickTime()
    Local $aDLL = DllCall("user32.dll", "uint", "GetDoubleClickTime")
    If Not @error Then Return $aDLL[0]
    EndFunc

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

    Func _SetDoubleClickTime($ms)
    DllCall("user32.dll", "int", "SetDoubleClickTime", "uint", $ms)
    EndFunc

    [/autoit]

    Mega

  • Problem: Konsolenausgabe in Datei speichern

    • Xenobiologist
    • 20. Februar 2009 um 10:36

    Damit es als Anweisung verstanden werden kann muss davor und dahiner ein Leerzeichen sein.

  • Pipe Zurückgabewert

    • Xenobiologist
    • 18. Februar 2009 um 11:21

    Hi,

    es gibt eine UDF dafür und du kannst mal nach _getDosOutput suchen.

    Mega

  • Syntaxhervorhebung selbst gemacht

    • Xenobiologist
    • 16. Februar 2009 um 19:05

    Nee, immer noch nicht. Ich will wissen was du erreichen willst? Willst du eine eigene Sprache entwicklen? Willst du einen eigenen Editor schreiben?

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™