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

Beiträge von McPoldy

  • Desktop Icons speichern/restoren mit zwei ausführbaren scripten ohne GUI

    • McPoldy
    • 15. Februar 2008 um 14:37

    Hier erst einmal was gaaanz einfaches, wenn das Script gestartet wird, werden die Positionen gespeichert, wird das Script beendet, dann werden die Icons wiederhergestellt.
    Wichtig, wenn das Scipt läuft keine Icons hinzufügen oder entfernen!!!! Ist ja auch nur die erste Version :)

    @progandy Dein Wunsch ist mir Befehl ;) denke auch mal das es so am sinnvollsten ist.

    Spoiler anzeigen
    [autoit]


    #Include <GuiListView.au3>

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

    Opt("OnExitFunc","OnAutoItExit")

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

    $handle = ControlGetHandle("Program Manager", "", "SysListView321")
    $anzIcons = _GUICtrlListView_GetItemCount ($handle)
    Dim $arrPos[$anzIcons][3]
    For $i = 0 To $anzIcons -1
    $arrPos[$i][0] = _GUICtrlListView_GetItemPositionX ($handle,$i)
    $arrPos[$i][1] = _GUICtrlListView_GetItemPositionY ($handle,$i)
    $arrPos[$i][2] = _GUICtrlListView_GetItemText($handle,$i)
    Next

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

    While 1
    Sleep(10)
    WEnd

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

    Func OnAutoItExit()
    For $i = 0 To $anzIcons -1
    _GUICtrlListView_SetItemPosition($handle,$i,$arrPos[$i][0],$arrPos[$i][1])
    Next
    EndFunc

    [/autoit]
  • Desktop Icons speichern/restoren mit zwei ausführbaren scripten ohne GUI

    • McPoldy
    • 15. Februar 2008 um 14:11

    Bin schon fleißig, habs hinbekommen das ich meinen Eigenen Dateien Ordern mit einem Script sicher und wiederherstellen kann, aber Anforderung waren ja 2 Scripte, also bastel ich mal weiter, hab ich heute was im Zug zu tun :)

  • Desktop Icons speichern/restoren mit zwei ausführbaren scripten ohne GUI

    • McPoldy
    • 15. Februar 2008 um 12:12

    @Jan
    ich habe es nur angepasst das es lauffähig ist :) aber ich finde es interessant glaube ich bastele auch mal wenn ich Zeit finde (Übung macht den Schlumpf/Meister) ;)

  • Tab aktualisieren und Array neu einlesen lassen

    • McPoldy
    • 15. Februar 2008 um 12:03

    Mahlzeit, die _query() gibt ja auch nix zurück, also wird das Tab in 0 umbenannt!!!

    Spoiler anzeigen
    [autoit]


    Func _query()
    Dim $IP
    _FileReadToArray( $File, $IP )
    ;///////////////////////////// Pingen der einzelnen Computer /////////////////////////////////
    _FileReadToArray( $File, $IP ) ;Alles in ein Array einlesen
    Dim $Zaehler = 50
    $Result = GUISwitch( $GUI_Main, $GUI_Main_Tabitem_Uebersicht )
    ;~ If $Result > 0 Then
    ;~ MsgBox( 0, "Hat gefunzt", "" )
    ;~ Else
    ;~ MsgBox( 0, "Nix :(", "" )
    ;~ EndIf
    for $i=1 to $IP[0]
    $x = $Zaehler+30
    $Zaehler = $x
    $GUI_Main_Tab_Uebersicht_Query_IP = Ping( $IP[$i], 250 )
    GUICtrlSetData( $GUI_Main_Tab_Uebersicht_Progress,( $i*100 )/( $Array_Anzahl[0]-1 ) )
    If $GUI_Main_Tab_Uebersicht_Query_IP > 0 Then
    GUICtrlCreateIcon( @SystemDir & "\shell32.dll", 22, 140, $x, 15, 15 );ok
    Else
    GUICtrlCreateIcon( @SystemDir & "\shell32.dll", 200, 140, $x, 15, 15 );net da
    EndIf
    Next
    Sleep(1000)
    GUICtrlSetData ( $GUI_Main_Tab_Uebersicht_Progress,0 )
    $Zaehler = 50
    $IP = ""
    GUICtrlRead( $GUI_Main_Tab_Konfig_Edit_IP, 1 )
    EndFunc

    [/autoit]


    Bei _readfile() dasselbe

    Spoiler anzeigen
    [autoit]


    Func _read_file()
    Dim $IP
    _FileReadToArray( $File, $IP )
    ;////////////////////////// Auslesen der Textdatei um alle IP's zubekommen //////////////////
    Dim $Zaehler = 50
    for $i=1 to $IP[0]
    $x = $Zaehler+30
    $Zaehler = $x
    GUICtrlCreateIcon( @SystemDir & "\shell32.dll", 19, 15, $x, 15, 15 )
    GUICtrlCreateLabel( $IP[$i], 50, $x )
    GUICtrlCreateLabel( "--------------------------------------", 50, $x+10 )
    Next
    $IP = ""
    EndFunc

    [/autoit]


    Die While 1 Schleife ändern, dann geht es...

    Spoiler anzeigen
    [autoit]

    While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_Main_Btn_Exit
    GUIDelete()
    Exit

    Case $GUI_Main_Btn_Minimize

    Case $GUI_Main_Tab_Konfig_Btn_Save
    FileOpen( $File, 2 )
    FileWrite( $File, GUICtrlRead( $GUI_Main_Tab_Konfig_Edit_IP ) )
    FileClose( $File )
    ;~ GUICtrlSetData( $GUI_Main_Tabitem_Uebersicht, _query() )
    ;~ GUICtrlSetData( $GUI_Main_Tabitem_Uebersicht, _read_file() )
    _query()
    _read_file()
    Case $GUI_Main_Tab_Uebersicht_Btn_refresh
    GUICtrlSetState( $GUI_Main_Tab_Uebersicht_Btn_refresh, $GUI_DISABLE )
    _query()
    GUICtrlSetState( $GUI_Main_Tab_Uebersicht_Btn_refresh, $GUI_ENABLE )
    EndSwitch
    Wend

    [/autoit]
  • Desktop Icons speichern/restoren mit zwei ausführbaren scripten ohne GUI

    • McPoldy
    • 15. Februar 2008 um 11:44

    Nur eine Verständnissfrage, es soll zwei Scripte ergeben? Einses was eine INI anlegt wo die Positionen der Icons gespeichert sind und eines welches die Icons wieder an ihre Position schiebt oder sie auch wieder herstellt, weil irgend jemand eines der Icons bzw. Verknüpfungen gelöscht hat?

    Nebenbei der oben gepostete Quelltext ohne A3LListView.au3

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>
    #Include <GuiListView.au3>
    #include <File.au3>
    #include <GuiConstantsEx.au3>

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

    $guiwindow = GUICreate("Window Selection", 350, 150)
    $font = "Arial Bold"

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

    $LoadB = GUICtrlCreateButton(" Load ", 5, 123)
    $SaveB = GUICtrlCreateButton(" Save ", 45, 123)
    GUICtrlSetFont(-1, 8.5, 400, -1, $font)
    $refreshbutton = GUICtrlCreateButton("Refresh", 100, 123, 60, 25)
    GUICtrlSetFont(-1, 8.5, 400, -1, $font)
    $nListview = GUICtrlCreateListView(" Title|State ", 0, 0, 350, 120)
    GUICtrlSendMsg($nListview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
    GUICtrlSendMsg($nListview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)

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

    RefreshWidth()
    Func RefreshWidth()
    _GUICtrlListView_SetColumnWidth($nListview,1,$LVSCW_AUTOSIZE_USEHEADER)
    _GUICtrlListView_SetColumnWidth($nListview,1,_GUICtrlListView_GetColumnWidth ($nListview,1)-2)
    EndFunc

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

    ListWindows()

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

    LoadInis() ; only that one visible in ListView

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

    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_Event_Close
    GUIDelete($guiwindow)
    Exit
    Case $msg = $LoadB
    Restore()
    ContinueLoop
    Case $msg = $SaveB
    Save()
    ListWindows()
    LoadInis()
    ContinueLoop
    Case $msg = $refreshbutton
    ListWindows()
    LoadInis()
    EndSelect
    WEnd

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

    Exit

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

    Func ListWindows()
    GUISetState(@SW_SHOW)
    _GUICtrlListView_DeleteAllItems ($nListview)
    $aWindows = WinList("[CLASS:CabinetWClass]") ; To remove visible windows take out 'IsVisible' function.
    For $i = 1 To $aWindows[0][0]

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

    ;~ MsgBox(0, 0, "You choose: " & ControlGetText ($aWindows[$i][0], "", "SysListView321"))
    If $aWindows[$i][0] <> "" And ControlGetText ($aWindows[$i][0], "", "SysListView321") = "FolderView" Then
    GUICtrlCreateListViewItem($aWindows[$i][0], $nListview)
    EndIf
    Next
    GUICtrlCreateListViewItem("Program Manager(Desktop)", $nListview)
    _GUICtrlListView_SetColumnWidth($nListview, 0, $LVSCW_AUTOSIZE)

    EndFunc ;==>ListWindows

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

    Func LoadInis()

    $FileList =_FileListToArray(@ScriptDir & "\WindowsPos","*.ini")
    If @error <> 0 Then
    If @error = 1 Then DirCreate ( @ScriptDir & "\WindowsPos" )
    Return -1
    EndIf

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

    For $i = 0 To _GUICtrlListView_GetItemCount ($nListview)-1
    $name = _GUICtrlListView_GetItemText ( $nListview, $i ,0)
    If @error <> 0 Then Return False
    $Load = LoadIni($name,$i)
    If $Load Then
    _GUICtrlListView_SetItemText ( $nListview, $i, 1, $Load )
    EndIf
    Next

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

    RefreshWidth()
    EndFunc

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

    Func LoadIni($name,$listnr)

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

    Dim $PosList[1][3]

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

    If Not FileExists(@ScriptDir & "\WindowsPos\"&$name&".ini") Then Return False ; keine Ini gefunden
    $IniSec = IniReadSection (@ScriptDir & "\WindowsPos\"&$name&".ini","Positions by Name")
    If @error=1 Then
    Return "Error in ini" ; ini gefunden aber fehlerhaft
    EndIf

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

    Return "Positions found"

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

    EndFunc

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

    Func Restore()
    $winname = _GUICtrlListView_GetItemText ( $nListview, -1 ,0)
    If $winname = "Program Manager(Desktop)" Then
    $handle = ControlGetHandle("Program Manager", "", "SysListView321")
    Else
    $handle = ControlGetHandle($winname, "", "SysListView321")
    EndIf
    _GUICtrlListView_BeginUpdate ($handle)
    For $i = 0 To _GUICtrlListView_GetItemCount ($handle)
    $name = _GUICtrlListView_GetItemText ($handle, $i)
    $x = IniRead(@ScriptDir & "\WindowsPos\"&$winname&".ini", "Positions by Name", $name & "x", "Unknown")
    $y = IniRead(@ScriptDir & "\WindowsPos\"&$winname&".ini", "Positions by Name", $name & "y", "Unknown")
    If $x <> "Unknown" Then
    _GUICtrlListView_SetItemPosition32 ($handle, $i, $x, $y)
    EndIf
    Next
    _GUICtrlListView_EndUpdate ($handle)
    EndFunc ;==>Restore

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

    Func Save()
    $winname = _GUICtrlListView_GetItemText ( $nListview, -1 ,0)
    If $winname = "Program Manager(Desktop)" Then
    $handle = ControlGetHandle("Program Manager", "", "SysListView321")
    Else
    $handle = ControlGetHandle($winname, "", "SysListView321")
    EndIf
    If @error = 1 Then MsgBox(0,0," Error(ControlGetHandle) : cant get handle")
    $t= MsgBox(4, "Confirm","Window Name: "&$winname&@CRLF& _
    "Icon Count: "&_GUICtrlListView_GetItemCount ($handle)&@CRLF& _
    "Name of first Icon: "&_GUICtrlListView_GetItemText($handle, 0)&@CRLF&@CRLF& _
    " Do you really want to save?")
    If $t <> 6 Then Return
    _GUICtrlListView_SetItemText ( $nListview, _GUICtrlListView_GetSelectedColumn ($nListview), 1, "saving..." )
    FileDelete(@ScriptDir & "\WindowsPos\"&$winname&".ini")
    For $i = 0 To _GUICtrlListView_GetItemCount ($handle)
    $pos = _GUICtrlListView_GetItemPosition ($handle, $i)
    $name = _GUICtrlListView_GetItemText ($handle, $i)
    If $pos[0] = True Then
    IniWrite(@ScriptDir & "\WindowsPos\"&$winname&".ini", "Positions by Name", $name & "x", $pos[0])
    IniWrite(@ScriptDir & "\WindowsPos\"&$winname&".ini", "Positions by Name", $name & "y", $pos[1])
    EndIf
    Next
    _GUICtrlListView_SetItemText ( $nListview, _GUICtrlListView_GetSelectedColumn ($nListview), 1, "done" )
    RefreshWidth()
    Sleep(1500)
    EndFunc ;==>Save

    [/autoit]
  • Probleme mit Memoryread etc

    • McPoldy
    • 14. Februar 2008 um 05:48

    Moin, ich habe bisher noch nix mit memory gemacht, hatte es nur mal mit dem Notepad getestet, da stand bei mir oben links 0, vielleicht kennt sich jemand anderes damit besser aus.

  • TCP Hilfe - Server - Client

    • McPoldy
    • 13. Februar 2008 um 19:25

    Hi, ich hab mal was in vereinfachter From gebastelt, kannst du bestimmt weiter ausbauen :)

    Server
    [autoit]


    ;HotKey für das Beenden vom Server
    HotKeySet("{ESC}","_Shutdown")

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

    ; Variablen
    $ServerIP = "127.0.0.1"
    $ServerPort = 81
    $ConnectedSocket = -1
    $recvUser = ""
    $recvPwd = ""

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

    ;TCP starten
    TCPStartup()

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

    ;MainSocket erstellen
    $MainSocket = TCPListen($ServerIP, $ServerPort )

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

    ;Bei Fehlschlag Server beenden
    If $MainSocket = -1 Then Exit

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

    ;Meine Testdaten
    $Username = "McPoldy"
    $Passwort = "AutoIT"

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

    While 1
    $ConnectedSocket = TCPAccept( $MainSocket)
    If $ConnectedSocket >= 0 Then
    Empfangen()
    EndIf

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

    WEnd

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

    Func _Shutdown()
    TCPCloseSocket($ConnectedSocket)
    TCPShutdown()
    Exit
    EndFunc

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

    Func Empfangen()
    While $ConnectedSocket >= 0
    $recv = TCPRecv( $ConnectedSocket, 2048 )
    If StringLen($recv) > 0 then
    Switch StringLeft($recv,6)
    Case "Auth1:"
    $strLen = StringLen($recv) - 6
    $recvUser = StringMid($recv,7,$strLen)
    Case "Auth2:"
    $strLen = StringLen($recv) - 6
    $recvPwd = StringMid($recv,7,$strLen)
    If $Username = $recvUser AND $Passwort = $recvPwd Then
    TCPSend($ConnectedSocket,"Anmeldung erfolgreich!")
    Else
    TCPSend($ConnectedSocket,"Anmeldung NICHT erfolgreich!")
    EndIf
    TCPCloseSocket($ConnectedSocket)

    Return 0
    EndSwitch
    EndIf
    WEnd

    EndFunc

    [/autoit]
    Client
    [autoit]


    TCPStartUp()

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

    Dim $szIPADDRESS = "127.0.0.1"
    Dim $nPORT = 81

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

    Dim $ConnectedSocket = -1
    $ConnectedSocket = TCPConnect($szIPADDRESS,$nPORT)
    If $ConnectedSocket = -1 Then Exit
    Dim $szData

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

    $szData = "Auth1:" & InputBox("User","Bitte Benutzer eingeben:","McPoldy")
    TCPSend($ConnectedSocket,$szData)
    Sleep(2000)
    $szData = "Auth2:" & InputBox("Passwort","Bitte Passwort eingeben:","AutoIT")
    TCPSend($ConnectedSocket,$szData)

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

    While 1
    $recv = TCPRecv( $ConnectedSocket, 2048 )
    If StringLen($recv) > 0 then
    MsgBox(0,"Anmeldevorgang",$recv)
    TCPCloseSocket($ConnectedSocket)
    TCPShutdown()
    Exit
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
  • Probleme mit Memoryread etc

    • McPoldy
    • 13. Februar 2008 um 18:27

    HI,

    in der Memory.au3 habe ich gar kein _MemoryOpen etc.

    habe aber das hier gefunden:

    Spoiler anzeigen
    [autoit]

    #include-once
    #region _Memory
    ;==================================================================================
    ; AutoIt Version: 3.1.127 (beta)
    ; Language: English
    ; Platform: All Windows
    ; Author: Nomad
    ; Requirements: These functions will only work with beta.
    ;==================================================================================
    ; Credits: wOuter - These functions are based on his original _Mem() functions.
    ; But they are easier to comprehend and more reliable. These
    ; functions are in no way a direct copy of his functions. His
    ; functions only provided a foundation from which these evolved.
    ;==================================================================================
    ;
    ; Functions:
    ;
    ;==================================================================================
    ; Function: _MemoryOpen($iv_Pid[, $iv_DesiredAccess[, $iv_InheritHandle]])
    ; Description: Opens a process and enables all possible access rights to the
    ; process. The Process ID of the process is used to specify which
    ; process to open. You must call this function before calling
    ; _MemoryClose(), _MemoryRead(), or _MemoryWrite().
    ; Parameter(s): $iv_Pid - The Process ID of the program you want to open.
    ; $iv_DesiredAccess - (optional) Set to 0x1F0FFF by default, which
    ; enables all possible access rights to the
    ; process specified by the Process ID.
    ; $iv_InheritHandle - (optional) If this value is TRUE, all processes
    ; created by this process will inherit the access
    ; handle. Set to 1 (TRUE) by default. Set to 0
    ; if you want it FALSE.
    ; Requirement(s): None.
    ; Return Value(s): On Success - Returns an array containing the Dll handle and an
    ; open handle to the specified process.
    ; On Failure - Returns 0
    ; @Error - 0 = No error.
    ; 1 = Invalid $iv_Pid.
    ; 2 = Failed to open Kernel32.dll.
    ; 3 = Failed to open the specified process.
    ; Author(s): Nomad
    ; Note(s):
    ;==================================================================================
    Func _MemoryOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $iv_InheritHandle = 1)

    If Not ProcessExists($iv_Pid) Then
    SetError(1)
    Return 0
    EndIf

    Local $ah_Handle[2] = [DllOpen('kernel32.dll')]

    If @Error Then
    SetError(2)
    Return 0
    EndIf

    Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', $iv_DesiredAccess, 'int', $iv_InheritHandle, 'int', $iv_Pid)

    If @Error Then
    DllClose($ah_Handle[0])
    SetError(3)
    Return 0
    EndIf

    $ah_Handle[1] = $av_OpenProcess[0]

    Return $ah_Handle

    EndFunc

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

    ;==================================================================================
    ; Function: _MemoryRead($iv_Address, $ah_Handle[, $sv_Type])
    ; Description: Reads the value located in the memory address specified.
    ; Parameter(s): $iv_Address - The memory address you want to read from. It must
    ; be in hex format (0x00000000).
    ; $ah_Handle - An array containing the Dll handle and the handle
    ; of the open process as returned by _MemoryOpen().
    ; $sv_Type - (optional) The "Type" of value you intend to read.
    ; This is set to 'dword'(32bit(4byte) signed integer)
    ; by default. See the help file for DllStructCreate
    ; for all types. An example: If you want to read a
    ; word that is 15 characters in length, you would use
    ; 'char[16]' since a 'char' is 8 bits (1 byte) in size.
    ; Return Value(s): On Success - Returns the value located at the specified address.
    ; On Failure - Returns 0
    ; @Error - 0 = No error.
    ; 1 = Invalid $ah_Handle.
    ; 2 = $sv_Type was not a string.
    ; 3 = $sv_Type is an unknown data type.
    ; 4 = Failed to allocate the memory needed for the DllStructure.
    ; 5 = Error allocating memory for $sv_Type.
    ; 6 = Failed to read from the specified process.
    ; Author(s): Nomad
    ; Note(s): Values returned are in Decimal format, unless specified as a
    ; 'char' type, then they are returned in ASCII format. Also note
    ; that size ('char[size]') for all 'char' types should be 1
    ; greater than the actual size.
    ;==================================================================================
    Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword')

    If Not IsArray($ah_Handle) Then
    SetError(1)
    Return 0
    EndIf

    Local $v_Buffer = DllStructCreate($sv_Type)

    If @Error Then
    SetError(@Error + 1)
    Return 0
    EndIf

    DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')

    If Not @Error Then
    Local $v_Value = DllStructGetData($v_Buffer, 1)
    Return $v_Value
    Else
    SetError(6)
    Return 0
    EndIf

    EndFunc

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

    ;==================================================================================
    ; Function: _MemoryWrite($iv_Address, $ah_Handle, $v_Data[, $sv_Type])
    ; Description: Writes data to the specified memory address.
    ; Parameter(s): $iv_Address - The memory address which you want to write to.
    ; It must be in hex format (0x00000000).
    ; $ah_Handle - An array containing the Dll handle and the handle
    ; of the open process as returned by _MemoryOpen().
    ; $v_Data - The data to be written.
    ; $sv_Type - (optional) The "Type" of value you intend to write.
    ; This is set to 'dword'(32bit(4byte) signed integer)
    ; by default. See the help file for DllStructCreate
    ; for all types. An example: If you want to write a
    ; word that is 15 characters in length, you would use
    ; 'char[16]' since a 'char' is 8 bits (1 byte) in size.
    ; Return Value(s): On Success - Returns 1
    ; On Failure - Returns 0
    ; @Error - 0 = No error.
    ; 1 = Invalid $ah_Handle.
    ; 2 = $sv_Type was not a string.
    ; 3 = $sv_Type is an unknown data type.
    ; 4 = Failed to allocate the memory needed for the DllStructure.
    ; 5 = Error allocating memory for $sv_Type.
    ; 6 = $v_Data is not in the proper format to be used with the
    ; "Type" selected for $sv_Type, or it is out of range.
    ; 7 = Failed to write to the specified process.
    ; Author(s): Nomad
    ; Note(s): Values sent must be in Decimal format, unless specified as a
    ; 'char' type, then they must be in ASCII format. Also note
    ; that size ('char[size]') for all 'char' types should be 1
    ; greater than the actual size.
    ;==================================================================================
    Func _MemoryWrite($iv_Address, $ah_Handle, $v_Data, $sv_Type = 'dword')

    If Not IsArray($ah_Handle) Then
    SetError(1)
    Return 0
    EndIf

    Local $v_Buffer = DllStructCreate($sv_Type)

    If @Error Then
    SetError(@Error + 1)
    Return 0
    Else
    DllStructSetData($v_Buffer, 1, $v_Data)
    If @Error Then
    SetError(6)
    Return 0
    EndIf
    EndIf

    DllCall($ah_Handle[0], 'int', 'WriteProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')

    If Not @Error Then
    Return 1
    Else
    SetError(7)
    Return 0
    EndIf

    EndFunc

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

    ;==================================================================================
    ; Function: _MemoryClose($ah_Handle)
    ; Description: Closes the process handle opened by using _MemoryOpen().
    ; Parameter(s): $ah_Handle - An array containing the Dll handle and the handle
    ; of the open process as returned by _MemoryOpen().
    ; Return Value(s): On Success - Returns 1
    ; On Failure - Returns 0
    ; @Error - 0 = No error.
    ; 1 = Invalid $ah_Handle.
    ; 2 = Unable to close the process handle.
    ; Author(s): Nomad
    ; Note(s):
    ;==================================================================================
    Func _MemoryClose($ah_Handle)

    If Not IsArray($ah_Handle) Then
    SetError(1)
    Return 0
    EndIf

    DllCall($ah_Handle[0], 'int', 'CloseHandle', 'int', $ah_Handle[1])
    If Not @Error Then
    DllClose($ah_Handle[0])
    Return 1
    Else
    DllClose($ah_Handle[0])
    SetError(2)
    Return 0
    EndIf

    EndFunc

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

    ;==================================================================================
    ; Function: SetPrivilege( $privilege, $bEnable )
    ; Description: Enables (or disables) the $privilege on the current process
    ; (Probably) requires administrator privileges to run
    ;
    ; Author(s): Larry (from autoitscript.com's Forum)
    ; Notes(s):
    ; http://www.autoitscript.com/forum/index.ph…ndpost&p=223999
    ;==================================================================================

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

    Func SetPrivilege( $privilege, $bEnable )
    Const $TOKEN_ADJUST_PRIVILEGES = 0x0020
    Const $TOKEN_QUERY = 0x0008
    Const $SE_PRIVILEGE_ENABLED = 0x0002
    Local $hToken, $SP_auxret, $SP_ret, $hCurrProcess, $nTokens, $nTokenIndex, $priv
    $nTokens = 1
    $LUID = DLLStructCreate("dword;int")
    If IsArray($privilege) Then $nTokens = UBound($privilege)
    $TOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]")
    $NEWTOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]")
    $hCurrProcess = DLLCall("kernel32.dll","hwnd","GetCurrentProcess")
    $SP_auxret = DLLCall("advapi32.dll","int","OpenProcessToken","hwnd",$hCurrProcess[0], _
    "int",BitOR($TOKEN_ADJUST_PRIVILEGES,$TOKEN_QUERY),"int*",0)
    If $SP_auxret[0] Then
    $hToken = $SP_auxret[3]
    DLLStructSetData($TOKEN_PRIVILEGES,1,1)
    $nTokenIndex = 1
    While $nTokenIndex <= $nTokens
    If IsArray($privilege) Then
    $priv = $privilege[$nTokenIndex-1]
    Else
    $priv = $privilege
    EndIf
    $ret = DLLCall("advapi32.dll","int","LookupPrivilegeValue","str","","str",$priv, _
    "ptr",DLLStructGetPtr($LUID))
    If $ret[0] Then
    If $bEnable Then
    DLLStructSetData($TOKEN_PRIVILEGES,2,$SE_PRIVILEGE_ENABLED,(3 * $nTokenIndex))
    Else
    DLLStructSetData($TOKEN_PRIVILEGES,2,0,(3 * $nTokenIndex))
    EndIf
    DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,1),(3 * ($nTokenIndex-1)) + 1)
    DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,2),(3 * ($nTokenIndex-1)) + 2)
    DLLStructSetData($LUID,1,0)
    DLLStructSetData($LUID,2,0)
    EndIf
    $nTokenIndex += 1
    WEnd
    $ret = DLLCall("advapi32.dll","int","AdjustTokenPrivileges","hwnd",$hToken,"int",0, _
    "ptr",DllStructGetPtr($TOKEN_PRIVILEGES),"int",DllStructGetSize($NEWTOKEN_PRIVILEGES), _
    "ptr",DllStructGetPtr($NEWTOKEN_PRIVILEGES),"int*",0)
    $f = DLLCall("kernel32.dll","int","GetLastError")
    EndIf
    $NEWTOKEN_PRIVILEGES=0
    $TOKEN_PRIVILEGES=0
    $LUID=0
    If $SP_auxret[0] = 0 Then Return 0
    $SP_auxret = DLLCall("kernel32.dll","int","CloseHandle","hwnd",$hToken)
    If Not $ret[0] And Not $SP_auxret[0] Then Return 0
    return $ret[0]
    EndFunc ;==>SetPrivilege

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

    #endregion

    [/autoit]
  • _FileCopy unter Windows 2000

    • McPoldy
    • 13. Februar 2008 um 15:51

    Bitte schön, so geht es bei mir auch under W2k SP3 wenn ich den Vorgang abbreche, einfach ein Eventhandler hinzufügen:

    Spoiler anzeigen
    [autoit]


    $oMyError = ObjEvent("AutoIt.Error","_Fehlerbehandlung")

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

    _filecopy("c:\xxx.avi","c:\tmp\")

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

    Func _FileCopy($fromFile,$tofile)
    Local $FOF_RESPOND_YES = 16
    Local $FOF_SIMPLEPROGRESS = 512
    $winShell = ObjCreate("shell.application")
    $xx = $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
    EndFunc

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

    Func _Fehlerbehandlung()
    $oMyError.clear
    SetError(1)
    Endfunc

    [/autoit]
  • Func _Login

    • McPoldy
    • 13. Februar 2008 um 13:44

    Ja so ne Passwortdatei wäre schon was schönes, aber bitte mit verschlüsselten Passwort :) kannste ja mit MD5 machen.

    Edit: Habe grade den letzten Komentar gelesen, stimmt schon die Admins machen das erstellen des Scritps, aber wenn du das Login in verschiedenen Scripten einbaust, die von verschiedenen Gruppen genutzt werden, macht es doch wieder Sinn eine verschlüsselte Datei zu nehmen.

  • Bestandsverwaltung

    • McPoldy
    • 13. Februar 2008 um 12:40

    Hi,

    die Idee ist gut, da der schnelle pee :) es ja schon gesagt hat, die DB Anbindung sollte nicht das große Problem sein. Bei dem Scanner ist das immer ne Sache, manche senden einfach Tastaturbefehle, ähnlich dem Send Befehl, in dem Fall müsste es doch über das _IsPressed klappen, würd ich mal so vorsichtig behaupten.

  • Func _Login

    • McPoldy
    • 13. Februar 2008 um 12:21

    Hi,

    der Fehler ist ganz einfach :)

    $test = _Login("Title","Text",$names,$pws) <= Zeile 7

    Func _Login($sTitle,$sUsername,$sPassword,$BgColor = 0x000000,$TxtColor = 0xFFFFFF,$BtnColor = 0x000000) <= Zeile 48

    Bei der Funktion werden Titel, Benutzernamen-Array und Passwort-Arry als Minimum gefordert, beim aufruf über gibt er im Beispiel aber Tilel,Text,Benutzernamen-Array und Passwort-Arry also einen zuviel.

    Pass Zeile 7 so an:
    $test = _Login("Title",$names,$pws)

    Dann klappt es :)

    Edit: :S da war JanSchmidt schneller......

  • _FileCopy unter Windows 2000

    • McPoldy
    • 13. Februar 2008 um 08:49

    Moin, habe mal versucht den Fehler nachzustellen, leider ohne Erfolg. Ich habe das Script auf einem einfachen Windows 2000 System laufen lassen und es lief ohne Fehler.

    Mein Quelltext den ich benutzt habe, der Vollständigkeit halber:

    Spoiler anzeigen
    [autoit]


    _filecopy("c:\xxx.avi","c:\tmp\")
    Func _FileCopy($fromFile,$tofile)
    Local $FOF_RESPOND_YES = 16
    Local $FOF_SIMPLEPROGRESS = 512
    $winShell = ObjCreate("shell.application")
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
    EndFunc

    [/autoit]
  • Shell Execute und Prozess ID

    • McPoldy
    • 12. Februar 2008 um 11:09

    Hi, wenn du Run benutzt, bekommst du als Dankeschön die Pid :)

    [autoit]

    $pid = Run("wget.exe --output-document antivir.exe http://dl4.avgate.net/down/windows/a…_win7u_de_h.exe")

    [/autoit]

    Eine Frage, nur so am Rande, warum wget?

  • Gui fertigstellen aber wie

    • McPoldy
    • 12. Februar 2008 um 05:53

    Moin, das ist jetzt ne gute Frage wo der Fehler liegt, da es das Script ist, welches ich im Video benutzt habe. Das einzige was mir einfällt, ist der Titel von deinem Editor nicht "Unbenannt - Editor" weil du vielleicht nen anderes OS benutzt? Ansonsten musst du mal ein bissel suchen, vom Prinzip her läuft mein Script ( wie auf dem Video zu sehen).

  • Sonderzeichen Ausgeben

    • McPoldy
    • 11. Februar 2008 um 05:49

    Moin

    [autoit]

    Send("{ASC 0156}")

    [/autoit]

    siehe Hilfedatei unter 'Appendix' -> 'Send Key List'

  • Gui fertigstellen aber wie

    • McPoldy
    • 10. Februar 2008 um 17:49

    Nabend, wie heute morgen versprochen, ein kleines Video, sorry für den miesen Sound aber meine Soundkarte ist kaputt :(

    Video

    Und der geänderte Quellcode:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    $Form1_1 = GUICreate("Multibot v. 1.2 Made bei Chris", 170, 140, 360, 424)
    $Group1 = GUICtrlCreateGroup("Autopot´s", 0, 0, 137, 89)
    $chkRot = GUICtrlCreateCheckbox("Rote Pot´s", 8, 24, 97, 17)
    $chkBlau = GUICtrlCreateCheckbox("Blaue Pot´s", 8, 48, 97, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $cmdStart = GUICtrlCreateButton("Start", 0, 105, 73, 25, 0)
    $cmdStop = GUICtrlCreateButton("Stop", 88, 105, 75, 25, 0)
    GUICtrlSetState (-1,$GUI_DISABLE)
    GUISetState(@SW_SHOW)

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

    $checkthepixel = False

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $cmdStart
    GUICtrlSetState ($cmdStart,$GUI_DISABLE)
    GUICtrlSetState ($cmdStop,$GUI_ENABLE)
    $checkthepixel = True

    Case $cmdStop
    GUICtrlSetState ($cmdStop,$GUI_DISABLE)
    GUICtrlSetState ($cmdStart,$GUI_ENABLE)
    $checkthepixel = False
    EndSwitch
    If $checkthepixel = True Then CheckPixel()
    Sleep(50)
    WEnd

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

    Func CheckPixel()
    If BitAnd(GUICtrlRead($chkRot), $GUI_CHECKED) Then
    If PixelGetColor(405, 332) = 0xFF0000 Then
    For $i = 1 To 6
    ControlSend("Unbenannt - Editor","","Edit1","1{ENTER}") ;ist für die roten pots
    Next
    EndIf
    EndIf

    If BitAnd(GUICtrlRead($chkBlau), $GUI_CHECKED) Then
    If PixelGetColor(400, 390) = 0x0000FF Then
    For $i = 1 To 4
    ControlSend("Unbenannt - Editor","","Edit1","2{ENTER}") ;ist für die blauen pots
    Next
    EndIf
    EndIf

    If BitAnd(GUICtrlRead($chkRot), $GUI_CHECKED) Or _
    BitAnd(GUICtrlRead($chkBlau), $GUI_CHECKED) Then
    ControlSend("Unbenannt - Editor","","Edit1","Pause{ENTER}")
    Sleep(1000)
    EndIf
    EndFunc

    [/autoit]
  • Gui fertigstellen aber wie

    • McPoldy
    • 10. Februar 2008 um 02:51

    Nabend, och schön das sich jemand für meine Scripts interessiert :) , ich mach dir heute (merke grade das ja schon Sonntag ist) ein Video dazu.

  • Gui fertigstellen aber wie

    • McPoldy
    • 9. Februar 2008 um 17:56

    Nabend, ich bin mir nicht sicher ob es das ist wie du es haben wolltest, aber kannst ja mal schauen:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>

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

    $Form1_1 = GUICreate("Multibot v. 1.2 Made bei Chris", 170, 140, 193, 125)
    $Group1 = GUICtrlCreateGroup("Autopot´s", 0, 0, 137, 89)
    $chkRot = GUICtrlCreateCheckbox("Rote Pot´s", 8, 24, 97, 17)
    $chkBlau = GUICtrlCreateCheckbox("Blaue Pot´s", 8, 48, 97, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $cmdStart = GUICtrlCreateButton("Start", 0, 105, 73, 25, 0)
    $cmdStop = GUICtrlCreateButton("Stop", 88, 105, 75, 25, 0)
    GUICtrlSetState (-1,$GUI_DISABLE)
    GUISetState(@SW_SHOW)

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

    $checkthepixel = False

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $cmdStart
    GUICtrlSetState ($cmdStart,$GUI_DISABLE)
    GUICtrlSetState ($cmdStop,$GUI_ENABLE)
    $checkthepixel = True

    Case $cmdStop
    GUICtrlSetState ($cmdStop,$GUI_DISABLE)
    GUICtrlSetState ($cmdStart,$GUI_ENABLE)
    $checkthepixel = False
    EndSwitch
    If $checkthepixel = True Then CheckPixel()
    Sleep(50)
    WEnd

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

    Func CheckPixel()
    If GUICtrlGetState($chkBlau) = $GUI_CHECKED Then
    If PixelGetColor(405, 332) = 0xFFFFFF Then
    For $i = 1 To 4
    Send("2") ;ist für die blauen pots
    Next
    EndIf
    EndIf

    If GUICtrlGetState($chkRot) = $GUI_CHECKED Then
    If PixelGetColor(405, 332) = 0xFFFFFF Then
    For $i = 1 To 6
    Send("1") ;ist für die roten pots
    Next
    EndIf
    EndIf
    EndFunc

    [/autoit]
  • Brauche hilfe für mein Relloger progi

    • McPoldy
    • 9. Februar 2008 um 10:08

    Wieso, du bist hier schon richtig :) aber hast du dir den Text durchgelesen den BugFix gepostet hat? Lese doch erstmal die alten Beiträge durch, da steht auch die Lösung zu deinem Problem drinnen. Und ich glaube kaum das man hier Werbung für andere Seiten machen darf :) (peethebee weiß welche Seite ich meine ;) )

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™