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

Beiträge von AutoTim

  • I/O-Warrior - Hilfe bei einem C Script

    • AutoTim
    • 31. Juli 2010 um 13:32

    Nett ;)

    Also, ich habe hier wegen der device folgendes rausgefunden:

    Spoiler anzeigen
    [autoit]

    #include "IOWKit.au3"

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

    If Not _IowKitStartUp("C:\Users\User\Desktop\Windows\library_1_5\iowkit.dll") Then
    MsgBox(0, "", "DLL konnte nicht geladen werden")
    Exit
    EndIf

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

    Dim $hGlobalDevice = _IowKitOpenDevice()

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

    Dim $num = _IowKitGetNumDevs()

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

    Dim $version = _IowKitVersion()

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

    Dim $numdevice = _IowKitGetDeviceHandle()

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

    MsgBox(0,"","IowKitOpenDevice: " & $hGlobalDevice & @CRLF & "IowKitGetNumDevs: " & $num & @CRLF & "IowKitVersion: " & $version )

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

    _IowKitCloseDevice($hGLobalDevice)

    [/autoit]


    Das Script bleibt einfach stehen, es passiert nach dem drücken auf F5 nichts. Das Script startet, aber es passiert nichts. wenn ich die Zeile mit dem Dim $numdevice = _IowKitGetDeviceHandle() rausnehme, dann kommt meineMsgBox mit den Informationen. Woran kann das liegen ? Also ich habe auch rausgefunden, in der IOWKIT.au3 sind die funktionen, die Funktionen so :

    Spoiler anzeigen
    [autoit]

    ;~ ULONG IOWKIT_API IowKitGetNumDevs(void);
    Func _IowKitGetNumDevs()
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitGetNumDevs")
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetNumDevs

    [/autoit]

    Und die die nicht gehen(Script bleibt stehen) so:

    Spoiler anzeigen
    [autoit]

    ;~ IOWKIT_HANDLE IOWKIT_API IowKitGetDeviceHandle(ULONG numDevice);
    Func _IowKitGetDeviceHandle($numDevice)
    Local $aResult = DllCall($ghIOWkitDll, "ptr", "IowKitGetDeviceHandle", "ulong", $numDevice)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetDeviceHandle

    [/autoit]

    Das einzige was anders ist, ist die Variable $numDevice hinter der Function. Bei den Funktionierenden, ist da einfach ().

    Was muss ich bei diesen anders machen ?

    lg Tim

    PS: Das das nicht so einfach ist, das nachzufolziehen auf die Ferne ist mir klar ;)

    EDIT: Ich habe bei :

    Spoiler anzeigen
    [autoit]

    ;~ IOWKIT_HANDLE IOWKIT_API IowKitGetDeviceHandle(ULONG numDevice);
    Func _IowKitGetDeviceHandle($numDevice)
    Local $aResult = DllCall($ghIOWkitDll, "ptr", "IowKitGetDeviceHandle", "ulong", $numDevice)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetDeviceHandle

    [/autoit]


    einfach mal das $numdevice entfernt, und nun bekomme ich einen Wert zurück. Kann es sein, das das $numdevice nicht in die IOWkit.au3 gehört ?

    Edit2:

    Was bedeutet eigentlich in Func _IowKitWrite($devHandle, $numPipe, $buffer, $length=-1) der $buffer und $length=-1. Was ist bitte ein buffer ? ?(

  • I/O-Warrior - Hilfe bei einem C Script

    • AutoTim
    • 30. Juli 2010 um 16:22

    Also, ich habe die Funkrion noch um folgendes erweitert. Nur habe ich Probleme bei Write, weil ich nicht weis, was ich wo angeben soll, und wo Variablen in den Befehl Write eingesetzt werden.

    Und wie kommst du auf die Variable

    [autoit]

    $hGlobalDevice

    [/autoit]

    ? Konnte sie in der IOWKIT.au3 nicht finden ;?

    Ich denke, wenn ich das nun mit dem Write hinbekomme, kann ich davon auch Read ableiten, und komme hoffentlich ab dann alleine klar. Schön ist es auf jeden fall, das Du/Ihr so geduldig seit.
    Mich würde interessieren wie lange du dich schon mit dem Programmieren / Programmentwicken beschäftigst ;)

    Spoiler anzeigen
    [autoit]

    #include "IOWKit.au3"

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

    If Not _IowKitStartUp("C:\Users\User\Desktop\Windows\library_1_5\iowkit.dll") Then
    MsgBox(0, "", "DLL konnte nicht geladen werden")
    Exit
    EndIf

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

    Dim $hGlobalDevice = _IowKitOpenDevice()

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

    Dim $num = _IowKitGetNumDevs()

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

    Dim $version = _IowKitVersion()

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

    ;~ $devHandle = _IowKitGetProductId() ; Hier komme ich nicht weiter...

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

    ;~ If not _IowKitWrite($devHandle,$num,0, -1) Then ; Und hier habe ich das Problem, das das skript einfach stehenbleibt. Ich bekomme keine Meldeung oder sonstiges.
    ;~ MsgBox(0, "", "Es konnten keine Bits geschrieben werden")
    ;~ Exit
    ;~ EndIf

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

    MsgBox(0,"","IowKitOpenDevice: " & $hGlobalDevice & @CRLF & "IowKitGetNumDevs: " & $num & @CRLF & "IowKitVersion: " & $version )

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

    _IowKitCloseDevice($hGLobalDevice)

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

    ; So wie das Script ist, kann ich die MsgBox ausgebenlassen, und mir die Daten zurückschicken lassen.

    [/autoit]


    Danke nochmal ;)

    lg Tim

  • I/O-Warrior - Hilfe bei einem C Script

    • AutoTim
    • 30. Juli 2010 um 15:42

    Hey Progandy !!

    also , folgendes funktioniert schonmal !!!

    Spoiler anzeigen
    [autoit]

    #include "IOWKit.au3"

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

    If Not _IowKitStartUp("C:\Users\User\Desktop\Windows\library_1_5\iowkit.dll") Then
    MsgBox(0, "", "DLL konnte nicht geladen werden")
    Exit
    EndIf

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

    Dim $hGlobalDevice = _IowKitOpenDevice()

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

    $num = _IowKitGetNumDevs()

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

    MsgBox(0,"",$hGlobalDevice & " __ " & $num)

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

    _IowKitCloseDevice($hGLobalDevice)

    [/autoit]

    Das ist echt klasse. Ich übe mich jezt noch ander Write und Read Funktion, und werde mich bei Problemen melden. !!!

    DANKE euch !!!

    lg Tim

  • Wozu Ruby???

    • AutoTim
    • 29. Juli 2010 um 22:22

    Hey,
    ich will nichts rauskopieren, aber hier hast du alles schön aufgelistet, und deutlich erklärt ;)

    Viel Spaß damit

    http://de.wikipedia.org/wiki/Ruby_%28Programmiersprache%29

    lg Tim

  • cmd

    • AutoTim
    • 29. Juli 2010 um 21:51

    Hm, es mag immer noch nicht. Hier ist mein Script:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Process.au3> ; Für die _RunDOS
    #include <EditConstants.au3> ; Für die EditBox in Hilfe
    #RequireAdmin

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

    Dim $Zahler1 = 0
    Dim $Zahler2 = 0
    Dim $Zahler3 = 0
    Dim $Zahler4 = 0
    Dim $Zahler5 = 0
    Dim $Zahler6 = 0
    Dim $Zahler7 = 0
    Dim $Zahler8 = 0
    Dim $Zahler9 = 0
    Dim $Zahler10 = 0
    Dim $Zahler20 = 0
    Dim $FileGetSizeCookies1 = 0
    Dim $FileGetSizeVerlauf1 = 0
    Dim $FileGetSizeTIN1 = 0
    Dim $FileGetSizeTemp1 = 0
    Dim $FileGetSizeRecent1 = 0
    Dim $FileGetSizeMOD1 = 0
    Dim $FileGetSizeII1 = 0
    Dim $FileGetSizeWTemp1 = 0
    Dim $FileGetSizeCookies2 = 0
    Dim $FileGetSizeVerlauf2 = 0
    Dim $FileGetSizeTIN2 = 0
    Dim $FileGetSizeTemp2 = 0
    Dim $FileGetSizeRecent2 = 0
    Dim $FileGetSizeMOD2 = 0
    Dim $FileGetSizeII2 = 0
    Dim $FileGetSizeWTemp2 = 0
    Dim $FileGetSizeREC1
    Dim $FileGetSizeREC2
    Dim $freierplatz = 0

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

    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaner.kxf
    $SimpleCleaner = GUICreate("Simple Cleaner", 390, 688, 275, 166)
    GUISetIcon("S-ico.ico")
    $Fragezeichen = GUICtrlCreateMenu("?")
    $Hilfe = GUICtrlCreateMenuItem("Hilfe", $Fragezeichen)
    $Uber = GUICtrlCreateMenuItem("Über", $Fragezeichen)
    $Checkbox1 = GUICtrlCreateCheckbox("Coockies löschen", 46, 48, 297, 33)
    $Checkbox2 = GUICtrlCreateCheckbox("Lokale Verlauf löschen", 46, 80, 297, 33)
    $Checkbox3 = GUICtrlCreateCheckbox("Temporare Internet Dateien löschen", 46, 112, 297, 33)
    $Checkbox4 = GUICtrlCreateCheckbox("Temp- Ordner leeren", 46, 144, 297, 33)
    $Checkbox5 = GUICtrlCreateCheckbox("Recent- Ordner leeren", 46, 176, 297, 33)
    $Checkbox6 = GUICtrlCreateCheckbox("Microsoft Office Dateien Löschen", 46, 208, 297, 33)
    $Checkbox7 = GUICtrlCreateCheckbox("Installation Informationen", 46, 240, 297, 33)
    $Checkbox8 = GUICtrlCreateCheckbox("Windows Temp- Ordner leeren", 46, 272, 297, 33)
    $Checkbox9 = GUICtrlCreateCheckbox("IP- FlushDNS", 46, 304, 297, 33)
    $Checkbox10 = GUICtrlCreateCheckbox("Papierkorb leeren", 45, 337, 297, 33)
    $Checkbox11 = GUICtrlCreateCheckbox("Checkbox", 45, 369, 297, 33)
    $Checkbox12 = GUICtrlCreateCheckbox("Checkbox", 45, 401, 297, 33)
    $Checkbox13 = GUICtrlCreateCheckbox("Checkbox", 45, 433, 297, 33)
    $Checkbox14 = GUICtrlCreateCheckbox("Checkbox", 45, 465, 297, 33)
    $ML = GUICtrlCreateButton("Markiertes Löschen", 134, 536, 121, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(26, 624, 337, 33)
    $Label1 = GUICtrlCreateLabel("Simple Cleaner", 119, 16, 151, 33)
    GUICtrlSetFont(-1, 18, 800, 2, "Script MT Bold")
    $Label2 = GUICtrlCreateLabel("Bitte zu löschende Dateien auswählen.", 23, 592, 343, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

    Case $Hilfe
    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaoner\Hilfe.kxf
    $HilfeForm = GUICreate("Hilfe", 413, 304, 302, 218)
    GUISetIcon("S-ico.ico")
    $GroupH1 = GUICtrlCreateGroup("Hilfe zu Simple Cleaner", 14, 15, 385, 265)
    $EditH1 = GUICtrlCreateEdit("", 22, 36, 369, 233, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
    GUICtrlSetData(-1, "Mit Simple Cleaner, ist es Möglich überflüssige Systemdateien einfach und restlos zu entfernen. "&@crlf&""&@crlf&"Was Sie löschen möchten, entscheiden Sie! "&@crlf&"Sie markieren einfach was Sie löschen möchten, und drücken dann auf "&@crlf&""&@crlf&"-Markiertes Löschen-."&@crlf&""&@crlf&" Nun warten Sie einfach ab, bis alles erfolgreich gelöscht worden ist. "&@crlf&"Das Programm kann nun geschlossen werden.")
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete ($HilfeForm)
    ExitLoop

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

    EndSwitch
    WEnd

    Case $Uber
    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaoner\Über.kxf
    $UberForm = GUICreate("Über", 324, 240, 302, 218)
    GUISetIcon("S-ico.ico")
    $picU1 = GUICtrlCreatePic("pic1.jpg", 16, 24, 105, 97, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $GroupBox1 = GUICtrlCreateGroup("", 8, 8, 305, 185)
    $LabelU1 = GUICtrlCreateLabel("Simple Cleaner", 152, 24, 133, 28, $WS_GROUP)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $LabelU2 = GUICtrlCreateLabel("1.0", 152, 56, 26, 24, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $LabelU4 = GUICtrlCreateLabel("Comments: Build Juli 2010", 16, 160, 127, 17, $WS_GROUP)
    $LabelU3 = GUICtrlCreateLabel("Copyright by Tim Erler", 16, 136, 106, 17, $WS_GROUP)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $OK = GUICtrlCreateButton("&OK", 112, 208, 75, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete ($UberForm)
    ExitLoop

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

    Case $OK
    GUIDelete ($UberForm)
    ExitLoop
    EndSwitch
    WEnd

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

    Case $ML

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

    GUICtrlSetData ( $Progress1, 0 )

    if bitand(guictrlread($checkbox1),$GUI_CHECKED) then
    $FileGetSizeCookies1 = DirGetSize(@UserProfileDir & "\Cookies")
    DirRemove(@UserProfileDir & "\Cookies",1)
    GUICtrlSetData ( $Label2, "Coockies gelöscht" )
    $FileGetSizeCookies2 = DirGetSize(@UserProfileDir & "\Cookies")
    GUICtrlSetData ( $Progress1, 10 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox2),$GUI_CHECKED) then
    $FileGetSizeVerlauf1 = DirGetSize(@UserProfileDir & "\Lokale Einstellungen\Verlauf")
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Verlauf",1)
    GUICtrlSetData ( $Label2, "Lokale Verlauf gelöscht" )
    $FileGetSizeVerlauf2 = DirGetSize(@UserProfileDir & "\Lokale Einstellungen\Verlauf")
    GUICtrlSetData ( $Progress1, 20 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox3),$GUI_CHECKED) then
    $FileGetSizeTIN1 = DirGetSize(@UserProfileDir & "\Lokale Einstellungen\Temporary Internet Files")
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Temporary Internet Files",1)
    GUICtrlSetData ( $Label2, "Temporare Internet Dateien gelöscht" )
    $FileGetSizeTIN2 = DirGetSize(@UserProfileDir & "\Lokale Einstellungen\Temporary Internet Files")
    GUICtrlSetData ( $Progress1, 30 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox4),$GUI_CHECKED) then
    $FileGetSizeTemp1 = DirGetSize(@UserProfileDir & "\Lokale Einstellungen\Temp")
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Temp",1)
    GUICtrlSetData ( $Label2, "Temp- Ordner gelehrt" )
    $FileGetSizeTemp2 = DirGetSize(@UserProfileDir & "\Lokale Einstellungen\Temp")
    GUICtrlSetData ( $Progress1, 40 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox5),$GUI_CHECKED) then
    $FileGetSizeRecent1 = DirGetSize(@UserProfileDir & "\Recent")
    DirRemove(@UserProfileDir & "\Recent",1)
    GUICtrlSetData ( $Label2, "Recent- Ordner gelehrt" )
    $FileGetSizeRecent2 = DirGetSize(@UserProfileDir & "\Recent")
    GUICtrlSetData ( $Progress1, 50 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox6),$GUI_CHECKED) then
    $FileGetSizeMOD1 = DirGetSize(@UserProfileDir & "\Anwendungsdaten\Microsoft\Office\Zuletzt verwendet")
    DirRemove(@UserProfileDir & "\Anwendungsdaten\Microsoft\Office\Zuletzt verwendet",1)
    GUICtrlSetData ( $Label2, "Microsoft Office Dateien gelöscht" )
    $FileGetSizeMOD2 = DirGetSize(@UserProfileDir & "\Anwendungsdaten\Microsoft\Office\Zuletzt verwendet")
    GUICtrlSetData ( $Progress1, 60 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox7),$GUI_CHECKED) then
    $FileGetSizeII1 = DirGetSize("C:\Programme\InstallShield Installation Information")
    DirRemove("C:\Programme\InstallShield Installation Information",1)
    GUICtrlSetData ( $Label2, "Installation Informationen gelöscht" )
    $FileGetSizeII2 = DirGetSize("C:\Programme\InstallShield Installation Information")
    GUICtrlSetData ( $Progress1, 70 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox8),$GUI_CHECKED) then
    $FileGetSizeWTemp1 = DirGetSize(@WindowsDir & "\Temp")
    DirRemove(@WindowsDir & "\Temp",1)
    GUICtrlSetData ( $Label2, "Windows Temp- Ordner gelehrt",1)
    $FileGetSizeWTemp2 = DirGetSize(@WindowsDir & "\Temp")
    GUICtrlSetData ( $Progress1, 80 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox9),$GUI_CHECKED) then
    _RunDOS("ipconfig /flushdns")
    GUICtrlSetData ( $Label2, "IP-DNS gelöscht" )
    GUICtrlSetData ( $Progress1, 90 )
    Sleep(500)
    else
    endif

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

    if bitand(guictrlread($checkbox10),$GUI_CHECKED) then
    $FileGetSizeREC1 = DirGetSize("C:/$Recycler.Bin")
    Msgbox(0,"",$FileGetSizeREC1)
    FileRecycleEmpty()
    GUICtrlSetData ( $Label2, "Papierkorb gelehrt",1)
    $FileGetSizeREC2 = DirGetSize("C:/$Recycler.Bin")
    GUICtrlSetData ( $Progress1, 100 )
    Sleep(500)
    endif

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

    GUICtrlSetData ( $Progress1, 100 )

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

    $freierplatz = ((($FileGetSizeCookies1 + $FileGetSizeVerlauf1 + $FileGetSizeTIN1 + $FileGetSizeTemp1 + $FileGetSizeRecent1 + $FileGetSizeMOD1 + $FileGetSizeII1 + $FileGetSizeWTemp1 + $FileGetSizeREC1 ) - ($FileGetSizeCookies2 + $FileGetSizeVerlauf2 + $FileGetSizeTIN2 + $FileGetSizeTemp2 + $FileGetSizeRecent2 + $FileGetSizeMOD2 + $FileGetSizeII2 + $FileGetSizeWTemp2 + $FileGetSizeREC2)) / 1048576 )

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

    GUICtrlSetData ( $Label2, "Es wurden " & $freierplatz & " Mb entfernt." )

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

    if bitand(guictrlread($checkbox1),$GUI_UNCHECKED) then $Zahler1 = 1
    if bitand(guictrlread($checkbox2),$GUI_UNCHECKED) then $Zahler2 = 1
    if bitand(guictrlread($checkbox3),$GUI_UNCHECKED) then $Zahler3 = 1
    if bitand(guictrlread($checkbox4),$GUI_UNCHECKED) then $Zahler4 = 1
    if bitand(guictrlread($checkbox5),$GUI_UNCHECKED) then $Zahler5 = 1
    if bitand(guictrlread($checkbox6),$GUI_UNCHECKED) then $Zahler6 = 1
    if bitand(guictrlread($checkbox7),$GUI_UNCHECKED) then $Zahler7 = 1
    if bitand(guictrlread($checkbox8),$GUI_UNCHECKED) then $Zahler8 = 1
    if bitand(guictrlread($checkbox9),$GUI_UNCHECKED) then $Zahler9 = 1
    if bitand(guictrlread($checkbox10),$GUI_UNCHECKED) then $Zahler10 = 1
    $Zahler20 = $Zahler1 + $Zahler2 + $Zahler3 + $Zahler4 + $Zahler5 + $Zahler6 + $Zahler7 + $Zahler8 + $Zahler9 + $Zahler10

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

    if $Zahler20 = 10 then ;Nur weil 10 Checkboxen zur verfügung stehen sonnt eben 9 oder co. --- Nun 10 mit dem Korb
    GUICtrlSetData ( $Label2, "ES MUSS MINDESTENS EINE OPTION ANGEKLICKT SEIN" )
    GUICtrlSetData ( $Progress1, 0 )
    EndIf

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

    Dim $Zahler1 = 0; Variablen wieder auf 0 Setzen
    Dim $Zahler2 = 0
    Dim $Zahler3 = 0
    Dim $Zahler4 = 0
    Dim $Zahler5 = 0
    Dim $Zahler6 = 0
    Dim $Zahler7 = 0
    Dim $Zahler8 = 0
    Dim $Zahler9 = 0
    Dim $Zahler10 = 0
    Dim $Zahler20 = 0
    Dim $FileGetSizeCookies1 = 0
    Dim $FileGetSizeVerlauf1 = 0
    Dim $FileGetSizeTIN1 = 0
    Dim $FileGetSizeTemp1 = 0
    Dim $FileGetSizeRecent1 = 0
    Dim $FileGetSizeMOD1 = 0
    Dim $FileGetSizeII1 = 0
    Dim $FileGetSizeWTemp1 = 0
    Dim $FileGetSizeCookies2 = 0
    Dim $FileGetSizeVerlauf2 = 0
    Dim $FileGetSizeTIN2 = 0
    Dim $FileGetSizeTemp2 = 0
    Dim $FileGetSizeRecent2 = 0
    Dim $FileGetSizeMOD2 = 0
    Dim $FileGetSizeII2 = 0
    Dim $FileGetSizeWTemp2 = 0
    Dim $FileGetSizeREC1
    Dim $FileGetSizeREC2
    $freierplatz = 0

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

    EndSwitch
    WEnd

    [/autoit]

    lg Tim

  • cmd

    • AutoTim
    • 29. Juli 2010 um 21:30

    Ok, ich habe leider ein Problem, ich bekomme bei Folgendem Script -1 zurück.

    [autoit]

    if bitand(guictrlread($checkbox10),$GUI_CHECKED) then
    $FileGetSizeREC1 = DirGetSize("C:/$Recycler.Bin")
    Msgbox(0,"",$FileGetSizeREC1)
    FileRecycleEmpty()
    GUICtrlSetData ( $Label2, "Papierkorb gelehrt",1)
    $FileGetSizeREC2 = DirGetSize("C:/$Recycler.Bin")
    GUICtrlSetData ( $Progress1, 100 )
    Sleep(500)
    endif

    [/autoit]

    Warum denn ? Habe ich etwas falsch gemacht ?

    lg Tim

  • I/O-Warrior - Hilfe bei einem C Script

    • AutoTim
    • 29. Juli 2010 um 21:06

    Ok, der Push hätte nciht sein müssen, ich denke das liegt daran, weil ich das Teil zum laufen bekommen will. Ist die Anspannung und Freude.
    Ok, ich werde mich versuchen, und wenn es wider Probleme gibt, posten.
    Danke
    lg Tim


    Edit:

    Also, ich habe nun etwas mit den dll´s. rumgespielt, und bin auf folgendes gestoßen:

    Spoiler anzeigen
    [autoit]

    #include "C:\Users\User\Desktop\ubersetzung.au3"

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

    $antwort = DllCall("C:\Users\User\Desktop\Windows\library_1_5\IOWKIT.dll", "ptr", "IowKitOpenDevice (ioHandle)")
    MsgBox(0,"",$antwort)

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

    $antwort3 = DllCall("C:\Users\User\Desktop\Windows\library_1_5\IOWKIT.dll", "ulong", "IowKitGetNumDevs()")
    MsgBox(0,"",$antwort3)

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

    $antwort2 = DllCall("C:\Users\User\Desktop\Windows\library_1_5\IOWKIT.dll", "ptr", "IowKitCloseDevice(ioHandle)")
    MsgBox(0,"",$antwort2)

    [/autoit]

    Mein Problem dabe ist, das ich immer 0 zurück bekomme. Am anfang ist das auch ok, udn am Ende, aber bei dem Aufruf IowKitGetNumDevs() sollte ich eigentlich eine Zahl zurückbekommen. Es sollte 0x1500 sein. Ich bekomme aber null. Liegt das an meinem falschem dll Aufruf, oder habe ich etwas falsch verstanden. Hier ist die IOWKit. C in AutoIt umgeschriben. Das habe ich schon vor langem mit ProGandy gemacht. Aber was macht diese genau ? Verbindet die sozusagen meinen Befehl in AutoIt mit der dll ?

    Spoiler anzeigen
    [autoit]

    #include-once
    ;~ IO-Warrior vendor & product IDs
    Global Const $IOWKIT_VENDOR_ID = 0x07c0
    Global Const $IOWKIT_VID = $IOWKIT_VENDOR_ID
    ;~ IO-Warrior 40
    Global Const $IOWKIT_PRODUCT_ID_IOW40 = 0x1500
    Global Const $IOWKIT_PID_IOW40 = $IOWKIT_PRODUCT_ID_IOW40
    ;~ IO-Warrior 24
    Global Const $IOWKIT_PRODUCT_ID_IOW24 = 0x1501
    Global Const $IOWKIT_PID_IOW24 = $IOWKIT_PRODUCT_ID_IOW24
    ;~ IO-Warrior PowerVampire
    Global Const $IOWKIT_PRODUCT_ID_IOWPV1 = 0x1511
    Global Const $IOWKIT_PID_IOWPV1 = $IOWKIT_PRODUCT_ID_IOWPV1
    Global Const $IOWKIT_PRODUCT_ID_IOWPV2 = 0x1512
    Global Const $IOWKIT_PID_IOWPV2 = $IOWKIT_PRODUCT_ID_IOWPV2
    ;~ IO-Warrior 56
    Global Const $IOWKIT_PRODUCT_ID_IOW56 = 0x1503
    Global Const $IOWKIT_PID_IOW56 = $IOWKIT_PRODUCT_ID_IOW56

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

    ;~ Max number of pipes per IOW device
    Global Const $IOWKIT_MAX_PIPES = 2

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

    ;~ pipe names
    Global Const $IOW_PIPE_IO_PINS = 0
    Global Const $IOW_PIPE_SPECIAL_MODE = 1

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

    ;~ Max number of IOW devices in system
    Global Const $IOWKIT_MAX_DEVICES = 16
    ;~ IOW Legacy devices open modes
    Global Const $IOW_OPEN_SIMPLE = 1
    Global Const $IOW_OPEN_COMPLEX = 2

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

    ;~ first IO-Warrior revision with serial numbers
    Global Const $IOW_NON_LEGACY_REVISION = 0x1010

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

    ;~ Don't forget to pack it!
    ;~ #pragma pack(push, 1)

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

    Global Const $tagIOWKIT_REPORT = "align 1;byte ReportID; DWORD Value;"
    Global Const $tagIOWKIT40_IO_REPORT = "align 1;byte ReportID; DWORD Value;"
    Global Const $tagIOWKIT24_IO_REPORT = "align 1;byte ReportID; WORD Value;"
    Global Const $tagIOWKIT_SPECIAL_REPORT = "align 1;byte ReportID; byte Bytes[7];"
    Global Const $tagIOWKIT56_IO_REPORT = "align 1;byte ReportID; byte Bytes[7];"
    Global Const $tagIOWKIT56_SPECIAL_REPORT = "align 1;byte ReportID; byte Bytes[63];"

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

    Global Const $IOWKIT_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT_REPORT, 1))
    Global Const $IOWKIT40_IO_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT40_IO_REPORT, 1))
    Global Const $IOWKIT24_IO_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT24_IO_REPORT, 1))
    Global Const $IOWKIT_SPECIAL_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT_SPECIAL_REPORT, 1))
    Global Const $IOWKIT56_IO_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT56_IO_REPORT, 1))
    Global Const $IOWKIT56_SPECIAL_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT56_SPECIAL_REPORT, 1))

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

    Func _IowKitDWORDToBytes($dword)
    ; Author: ProgAndy
    Return BinaryMid($dword, 1, 4)
    EndFunc
    Func _IowKitWORDToBytes($word)
    ; Author: ProgAndy
    Return BinaryMid($word, 1, 2)
    EndFunc

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

    ;~ #pragma pack(pop)

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

    ;~ Opaque IO-Warrior handle
    Global $ghIOWkitDll = -1
    Func _IowKitStartUp($sDLL = "iowkit.dll") ; DLL laden, für alle anderen Funktionen wichtig
    If $ghIOWkitDll = -1 Then
    $ghIOWkitDll = DllOpen($sDLL)
    EndIf
    Return $ghIOWkitDll <> -1
    EndFunc ;==>_IowKitStartUp

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

    ;~ Function prototypes

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

    ;~ #ifdef __cplusplus
    ;~ extern "C" {
    ;~ #endif // __cplusplus

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

    ;~ IOWKIT_HANDLE IOWKIT_API IowKitOpenDevice(void);
    Func _IowKitOpenDevice()
    Local $aResult = DllCall($ghIOWkitDll, "ptr", "IowKitOpenDevice")
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitOpenDevice

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

    ;~ void IOWKIT_API IowKitCloseDevice(IOWKIT_HANDLE devHandle);
    Func _IowKitCloseDevice($devHandle)
    DllCall($ghIOWkitDll, "none", "IowKitCloseDevice", "ptr", $devHandle)
    If @error Then Return SetError(1, @error, 0)
    EndFunc ;==>_IowKitCloseDevice

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

    ;--------------------------------------------------------------------------------------------------

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

    ;~ ULONG IOWKIT_API IowKitWrite(IOWKIT_HANDLE devHandle, ULONG numPipe,
    ;~ PCHAR buffer, ULONG length);
    Func _IowKitWrite($devHandle, $numPipe, $buffer, $length=-1)
    ; Author: ProgAndy
    Local $pBuffer
    If IsDllStruct($buffer) Then
    $pBuffer = DllStructGetPtr($buffer)
    If $length < 1 Or $length > DllStructGetSize($buffer) Then $length = DllStructGetSize($buffer)
    ElseIf IsPtr($buffer) Then
    If $length < 0 Then Return SetError(2,0,0)
    $pBuffer = $buffer
    Else
    If $length < 1 Then $length = BinaryLen($buffer)
    Local $tBuffer = DllStructCreate("byte[" & $length & "]")
    DllStructSetData($tBuffer, 1, Binary($buffer))
    $buffer = 0 ; Speicher freigeben
    $pBuffer = DllStructGetPtr($tBuffer)
    EndIf
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitWrite", "ptr", $devHandle, "ULONG", $numPipe, "ptr", $pBuffer, "ULONG", $length)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitWrite

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

    ;~ ULONG IOWKIT_API IowKitRead(IOWKIT_HANDLE devHandle, ULONG numPipe,
    ;~ PCHAR buffer, ULONG length);
    Func _IowKitRead($devHandle, $numPipe, ByRef $buffer, $length)
    ; Author: ProgAndy
    Local $pBuffer, $fInternal=False
    If IsDllStruct($buffer) Then
    $pBuffer = DllStructGetPtr($buffer)
    If $length < 1 Or $length > DllStructGetSize($buffer) Then $length = DllStructGetSize($buffer)
    ElseIf $length < 1 Then
    Return SetError(2,0,0)
    ElseIf IsPtr($buffer) Then
    $pBuffer = $buffer
    Else
    Local $tBuffer = DllStructCreate("byte[" & $length & "]")
    $pBuffer = DllStructGetPtr($tBuffer)
    $buffer = Binary('')
    $fInternal = True
    EndIf
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitRead", "ptr", $devHandle, "ULONG", $numPipe, "ptr", $pBuffer, "ULONG", $length)
    If @error Then Return SetError(1, @error, 0)
    If $fInternal Then
    $buffer = DllStructGetData($tBuffer,1)
    $tBuffer = 0
    EndIf
    Return $aResult[0]
    EndFunc ;==>_IowKitRead

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

    ;~ ULONG IOWKIT_API IowKitReadNonBlocking(IOWKIT_HANDLE devHandle, ULONG numPipe,
    ;~ PCHAR buffer, ULONG length);
    Func _IowKitReadNonBlocking($devHandle, $numPipe, ByRef $buffer, $length)
    ; Author: ProgAndy
    Local $pBuffer, $fInternal=False
    If IsDllStruct($buffer) Then
    $pBuffer = DllStructGetPtr($buffer)
    If $length < 1 Or $length > DllStructGetSize($buffer) Then $length = DllStructGetSize($buffer)
    ElseIf $length < 1 Then
    Return SetError(2,0,0)
    ElseIf IsPtr($buffer) Then
    $pBuffer = $buffer
    Else
    Local $tBuffer = DllStructCreate("byte[" & $length & "]")
    $pBuffer = DllStructGetPtr($tBuffer)
    $buffer = Binary('')
    $fInternal = True
    EndIf
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitReadNonBlocking", "ptr", $devHandle, "ULONG", $numPipe, "ptr", $pBuffer, "ULONG", $length)
    If @error Then Return SetError(1, @error, 0)
    If $fInternal Then
    $buffer = DllStructGetData($tBuffer,1)
    $tBuffer = 0
    EndIf
    Return $aResult[0]
    EndFunc ;==>_IowKitReadNonBlocking

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

    ;~ BOOL IOWKIT_API IowKitReadImmediate(IOWKIT_HANDLE devHandle, PDWORD value);
    Func _IowKitReadImmediate($devHandle, ByRef $value)
    ; Author: ProgAndy
    $value = 0
    Local $aResult = DllCall($ghIOWkitDll, "none", "IowKitReadImmediate", "ptr", $devHandle, "dword*", 0)
    If @error Then Return SetError(1, @error, 0)
    $value = $aResult[2]
    Return $aResult[0]
    EndFunc ;==>_IowKitReadImmediate

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

    ;--------------------------------------------------------------------------------------------------

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

    ;~ ULONG IOWKIT_API IowKitGetNumDevs(void);
    Func _IowKitGetNumDevs()
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitGetNumDevs")
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetNumDevs

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

    ;~ IOWKIT_HANDLE IOWKIT_API IowKitGetDeviceHandle(ULONG numDevice);
    Func _IowKitGetDeviceHandle($numDevice)
    Local $aResult = DllCall($ghIOWkitDll, "ptr", "IowKitGetDeviceHandle", "ulong", $numDevice)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetDeviceHandle

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

    ;~ BOOL IOWKIT_API IowKitSetLegacyOpenMode(ULONG legacyOpenMode);
    Func _IowKitSetLegacyOpenMode($legacyOpenMode)
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitSetLegacyOpenMode", "ulong", $legacyOpenMode)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitSetLegacyOpenMode

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

    ;~ ULONG IOWKIT_API IowKitGetProductId(IOWKIT_HANDLE devHandle);
    Func _IowKitGetProductId($devHandle)
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitGetProductId", "ptr", $devHandle)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetProductId

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

    ;~ ULONG IOWKIT_API IowKitGetRevision(IOWKIT_HANDLE devHandle);
    Func _IowKitGetRevision($devHandle)
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitGetRevision", "ptr", $devHandle)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetRevision

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

    ;~ HANDLE IOWKIT_API IowKitGetThreadHandle(IOWKIT_HANDLE devHandle);
    Func _IowKitGetThreadHandle($devHandle)
    Local $aResult = DllCall($ghIOWkitDll, "ptr", "IowKitGetThreadHandle", "ptr", $devHandle)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetThreadHandle

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

    ;--------------------------------------------------------------------------------------------------

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

    ;~ BOOL IOWKIT_API IowKitGetSerialNumber(IOWKIT_HANDLE devHandle, PWCHAR serialNumber);
    Func _IowKitGetSerialNumber($devHandle, ByRef $serialNumber)
    $serialNumber = ''
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitGetSerialNumber", "ptr", $devHandle, "wstr", '')
    If @error Then Return SetError(1, @error, 0)
    $serialNumber = $aResult[2]
    Return $aResult[0]
    EndFunc ;==>_IowKitGetSerialNumber

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

    ;~ BOOL IOWKIT_API IowKitSetTimeout(IOWKIT_HANDLE devHandle, ULONG timeout);
    Func _IowKitSetTimeout($devHandle, $timeout)
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitSetTimeout", "ptr", $devHandle, "ULONG", $timeout)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitSetTimeout

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

    ;~ BOOL IOWKIT_API IowKitSetWriteTimeout(IOWKIT_HANDLE devHandle, ULONG timeout);
    Func _IowKitSetWriteTimeout($devHandle, $timeout)
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitSetWriteTimeout", "ptr", $devHandle, "ULONG", $timeout)
    If @error Then Return SetError(1, @error, 0)
    EndFunc ;==>_IowKitSetWriteTimeout

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

    ;~ BOOL IOWKIT_API IowKitCancelIo(IOWKIT_HANDLE devHandle, ULONG numPipe);
    Func _IowKitCancelIo($devHandle, $numPipe)
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitCancelIo", "ptr", $devHandle, "ULONG", $numPipe)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitCancelIo

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

    ;--------------------------------------------------------------------------------------------------

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

    ;~ PCSTR IOWKIT_API IowKitVersion(void);
    Func _IowKitVersion()
    Local $aResult = DllCall($ghIOWkitDll, "str", "IowKitVersion")
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitVersion

    [/autoit]

    lg Tim

  • cmd

    • AutoTim
    • 29. Juli 2010 um 21:04

    ok, danke !!

    Weis den noch jemand für Win 7 ?

    lg Tim

  • I/O-Warrior - Hilfe bei einem C Script

    • AutoTim
    • 28. Juli 2010 um 21:04

    Kann oder mag mir keiner helfen ?

    lg Tim

  • cmd

    • AutoTim
    • 28. Juli 2010 um 20:33

    Hey, du ich brauche den Pfad des Papierkorbes. Weil ich gerne mit DimgetSize(PFAD DES PAIERKORBES) die größe des Papierkorbinhaltes ermitteln möchte.

    lg Tim

  • I/O-Warrior - Hilfe bei einem C Script

    • AutoTim
    • 28. Juli 2010 um 16:43

    Hallo, ich habe es an meinen Alten Beitrag versucht anzuhängen, aber leider ging das nicht so wie geplant. War wohl zu alt ;)

    Also, meine Problem, ich habe folgenden Quelltext in C, der mit Hilfe einer .dll mein USB Kit anspricht, und die Leds an Port 3 Blinken lässt. Ich habe keine Ahnung in C und habde das Problem, das ich das gerne in AutoIt umschreiben möchte. Im Script wird zwischen I/O Warriar 24, 40 und 56 unterschieden. Ich habe den 40.

    Hier erstmal das Script:

    Spoiler anzeigen
    [autoit]

    //
    // ioblink.cpp - Blinking LEDs sample
    //

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

    #include "stdafx.h"
    #include "time.h"
    #include "iowkit.h"

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

    // Write simple value
    BOOLEAN WriteSimple(IOWKIT_HANDLE devHandle, DWORD value)
    {
    IOWKIT56_IO_REPORT rep;

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

    // Init report
    memset(&rep, 0xff, IOWKIT56_IO_REPORT_SIZE);
    rep.ReportID = 0;
    switch (IowKitGetProductId(devHandle))
    {
    // Write simple value to IOW40
    case IOWKIT_PRODUCT_ID_IOW40:
    rep.Bytes[3] = (BYTE) value;
    return IowKitWrite(devHandle, IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT40_IO_REPORT_SIZE) == IOWKIT40_IO_REPORT_SIZE;
    // Write simple value to IOW24
    case IOWKIT_PRODUCT_ID_IOW24:
    rep.Bytes[0] = (BYTE) value;
    return IowKitWrite(devHandle, IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT24_IO_REPORT_SIZE) == IOWKIT24_IO_REPORT_SIZE;
    case IOWKIT_PRODUCT_ID_IOW56:
    // Write simple value to IOW56
    rep.Bytes[6] = (BYTE) value;
    return IowKitWrite(devHandle, IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT56_IO_REPORT_SIZE) == IOWKIT56_IO_REPORT_SIZE;
    default:
    return FALSE;
    }
    }

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

    int main(int argc, char* argv[])
    {
    IOWKIT_HANDLE iows[IOWKIT_MAX_DEVICES];
    int i, j;
    ULONG bits;
    int numIows;
    IOWKIT56_IO_REPORT rep;
    WCHAR sn[9];
    ULONG rc;
    DWORD pid;
    IOWKIT_HANDLE devHandle;

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

    // Open device
    devHandle = IowKitOpenDevice();
    if (devHandle == NULL)
    {
    printf("Failed to open device\n");
    goto out;
    }
    // Get number of IOWs in system
    numIows = IowKitGetNumDevs();
    printf("%d IOWs in system\n", numIows);
    // Get all IOW handles
    for (i = 0; i < numIows; i++)
    {
    // Get device handle and init object
    iows[i] = IowKitGetDeviceHandle(i + 1);
    // Get serial number
    IowKitGetSerialNumber(iows[i], sn);
    pid = IowKitGetProductId(iows[i]);
    printf("%d PID %x, S/N \"%ws\"\n", i + 1, pid, sn);
    }
    // Init report
    // Report ID 0 is for writing to 32 input/output pins
    rep.ReportID = 0;
    printf("Blinking LEDs...\n");
    //srand(time(NULL));
    // Blinking'
    for (i = 0; i < 100; i++)
    {
    bits = rand();
    // Make every IOW blink
    for (j = 0; j < numIows; j++)
    {
    // Write to simple endpoint
    rc = WriteSimple(iows[j], bits);
    // Check for error
    if (!rc)
    printf("Cannot write, err %d\n", GetLastError());
    }
    // Sleep for 25ms
    Sleep(25);
    }
    printf("Blinking complete\n");
    // Set LEDs off
    for (i = 0; i < numIows; i++)
    // Write to simple endpoint
    WriteSimple(iows[i], 0xFFFFFFFF);
    for(i = 0; i < 10; i++)
    {

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

    // Read non blocking
    // Init report
    memset(&rep, 0, IOWKIT56_IO_REPORT_SIZE);
    switch (IowKitGetProductId(devHandle))
    {
    case IOWKIT_PRODUCT_ID_IOW40:
    rc = IowKitReadNonBlocking(iows[0], IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT40_IO_REPORT_SIZE);
    printf("%2d) ReadNonBl(): rc=%u bits=", i + 1, rc);
    for (j = IOWKIT40_IO_REPORT_SIZE - 1; j >= 0; j--)
    printf("%02x", rep.Bytes[j]);
    printf("\n");
    break;
    case IOWKIT_PRODUCT_ID_IOW24:
    rc = IowKitReadNonBlocking(iows[0], IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT24_IO_REPORT_SIZE);
    printf("%2d) ReadNonBl(): rc=%u bits=", i + 1, rc);
    for (j = IOWKIT24_IO_REPORT_SIZE - 1; j >= 0; j--)
    printf("%02x", rep.Bytes[j]);
    printf("\n");
    break;
    case IOWKIT_PRODUCT_ID_IOW56:
    rc = IowKitReadNonBlocking(iows[0], IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT56_IO_REPORT_SIZE);
    printf("%2d) ReadNonBl(): rc=%u bits=", i + 1, rc);
    for (j = IOWKIT56_IO_REPORT_SIZE - 1; j >= 0; j--)
    printf("%02x", rep.Bytes[j]);
    printf("\n");
    break;
    }
    Sleep(100);
    }
    // Close device
    IowKitCloseDevice(devHandle);
    out:

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

    return 0;
    }

    [/autoit]


    So, das Beispielprogramm mit C-Sourge und co. gibt es hier. fals ich eigentlich garnicht die richtige Quell-Datei habe, dann ist es klar, wieso ich einfach nicht schlau werde.
    KLICK MICH

    Ich habe auch rausgefunden, das man erstmal das Kit ansprechen muss mit : IowKitOpenDevice()
    und dann die Aktionen mit : IowKitWrite() und IowKitRead() ausführen.
    Am Ende muss man es wider mit : IowKitCloseDevice () schließen, das ein klares Ende definiert ist.

    Ich weis nicht wie es in C ist, ob da ein Script reicht, wie in AutoIt, oder ob sich das aus vielen Dateien zusammensetzt.

    Ich hoffe mir kann jemand mit den bisherigen Informationen Helfen.
    Sollte dochnoch Fragen geben, sind in dieser .pdf-Anleitung soweit eigentlich alles erklärt. Ich habe diese gelesen, komme aber leider mit der Umsetztung von C in AutoIt nicht zurecht. HIER DIE .PDF

  • I/O-Warrior

    • AutoTim
    • 27. Juli 2010 um 17:43

    So, nun ist es soweit. Er ist da. Ich habe Ihn zusammengebaut, und die Samples die als exe dabei waren ausprobiert. Das klappt schonmal super. Nun aber habe ich mir Gedanken gemacht. Wie ich es in AutoIt umsetzten soll. z.B. einen einzelnen ausgang anzusprechen. Das mus ja mit FileWrite passieren. Ich habe mir dazu auch die .pdf durchgelesen. Aber habe ich das Problem, das ich es nciht hinbekomme das wider mals in Autoit anzuwenden. Hier mal die .pdf. Eventuell kannst du Progandy mir mal wider helfen ;)

    Spoiler anzeigen

    IO-Warrior Dynamic Library
    V1.5 for Windows
    Applicable for all IO-Warriors
    Code Mercenaries
    Overview
    The IO-Warrior Kit Dynamic Library provides a simple API to access all IO-Warrior products from Code
    Mercenaries. It is intended to be used with any programming language available on Windows or Linux.
    Sample programs are included for Microsoft VC++ 6, MS Visual Basic 6 and Borland Delphi 6 for
    Windows and C for Linux. The name of the library is iowkit.dll for Windows and libiowkit.so for Linux.
    The API is deliberately simple. It does not address plug and unplug of IO-Warriors for example.
    It allows access to several IO-Warriors in parallel though. The limit is 16 IO-Warriors. If this limit is too
    low then it is possible to recompile the Windows DLL with a higher limit. The source code is included in
    the SDK.
    The starting point of all activity is the function IowKitOpenDevice(). It opens all IO-Warriors
    connected to the computer. Likewise IowKitCloseDevice() closes all open devices.
    IowKitGetNumDevs() tells you how many devices have been found and
    IowKitGetDeviceHandle() gives access to the individual devices of the list. From there on it is
    mainly IowKitRead(), IowKitReadNonBlockinge() and IowKitWrite() to communicate
    with the device. The precise data to read and write is explained in the IO-Warrior data sheet
    "IOWarriorDatasheet.pdf".
    The IO-Warriors have two communication channels. In USB terminology this is called an interface or
    pipe. Pipe 0 is used to directly access the I/O pins, whereas pipe 1 allows access to the special functions
    of the IO-Warrior. Consequently IowKitRead() and IowKitWrite() have a numPipe parameter.
    IowKitReadImmediate() is only for access to the I/O pins so it abstracts from the pipes and always
    returns 32 bits in a DWORD.
    As of version 1.4 the dynmaic library is threadsafe. Also the DLL loads in Windows 95 and Windows NT,
    but does not find any IO-Warriors due to the lack of USB support in these Windows versions.
    For Linux libiowkit.so has been implemented which exposes the same API as iowkit.dll. It needs the
    driver module iowkit.ko to be installed in the Linux kernel. Do not be afraid. Installing a kernel module is
    simple.
    iowkit.dll and libiowkit.so also expose the API functions as methods for a Java class to allow Java
    programs to access the IO-Warrior directly. This is documented separately.
    The API has been expanded to handle the new IOW56. Some examples (mainly „Simple IO“) have been
    expanded to handle IOW56. The expansion is preliminary and needs some finetuning.
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 1
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    Data structures
    Data with the devices is exchanged in the form of reports. Each report is identified by a report ID which
    is the first byte of any report. For Linux the missing ReportID for Pipe0 is simulated to make the API
    identical to the Windows API.
    The report ID assignment is per pipe. Pipe 0 for the I/O pins has only one type of report so it does not use
    a reportID. But Windows requires that a reportID is provided, even though the reportID is always 0. The
    difference between IO-Warrior24 and IO-Warrior40 is that the former has a report size of 3 bytes (report
    ID and 2 bytes payload), whereas the latter has a report size of 5 bytes (reportID and 4 bytes payload).It is
    possible to always read 5 bytes with IowKitRead() no matter which IO-Warrior is accessed because
    the read only returns in chunks of full reports and 5 bytes is too small to hold two 3 byte reports. Clean
    programming with correct sizes is a wiser idea though.
    Pipe 1 for the special mode functions has a report size of 8 bytes for all IO-Warriors (report ID and 7
    bytes payload). See "IOWarriorDatasheet.pdf" for details on allowed report IDs and the data payload for
    them. The header files provide some predefined structures for ease of use:
    C:
    typedef struct _IOWKIT_REPORT
    {
    UCHAR ReportID;
    union
    {
    DWORD Value;
    BYTE Bytes[4];
    };
    }
    IOWKIT_REPORT, *PIOWKIT_REPORT;
    typedef struct _IOWKIT40_IO_REPORT
    {
    UCHAR ReportID;
    union
    {
    DWORD Value;
    BYTE Bytes[4];
    };
    }
    IOWKIT40_IO_REPORT, *PIOWKIT40_IO_REPORT;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 2
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    typedef struct _IOWKIT24_IO_REPORT
    {
    UCHAR ReportID;
    union
    {
    WORD Value;
    BYTE Bytes[2];
    };
    }
    IOWKIT24_IO_REPORT, *PIOWKIT24_IO_REPORT;
    typedef struct _IOWKIT_SPECIAL_REPORT
    {
    UCHAR ReportID;
    UCHAR Bytes[7];
    }
    IOWKIT_SPECIAL_REPORT, *PIOWKIT_SPECIAL_REPORT;
    Delphi:
    type
    PIOWKIT_REPORT = ^IOWKIT_REPORT;
    IOWKIT_REPORT = packed record
    ReportID: Byte;
    case Boolean of
    False: (Value: DWORD;);
    True: (Bytes: array [0..3] of Byte;);
    end;
    PIOWKIT40_IO_REPORT = ^IOWKIT40_IO_REPORT;
    IOWKIT40_IO_REPORT = packed record
    ReportID: Byte;
    case Boolean of
    False: (Value: DWORD;);
    True: (Bytes: array [0..3] of Byte;);
    end;
    PIOWKIT24_IO_REPORT = ^IOWKIT24_IO_REPORT;
    IOWKIT24_IO_REPORT = packed record
    ReportID: Byte;
    case Boolean of
    False: (Value: WORD;);
    True: (Bytes: array [0..1] of Byte;);
    end;
    PIOWKIT_SPECIAL_REPORT = ^IOWKIT_SPECIAL_REPORT;
    IOWKIT_SPECIAL_REPORT = packed record
    ReportID: Byte;
    Bytes: array [0..6] of Byte;
    end;
    IOWKIT_REPORT dates from the 1.2 version of the API and is the same as IOWKIT40_IO_REPORT.
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 3
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitOpenDevice
    Declaration:
    IOWKIT_HANDLE IOWKIT_API IowKitOpenDevice(void);
    function IowKitOpenDevice: IOWKIT_HANDLE; stdcall;
    Opens all available IO-Warrior devices and returns the handle to the first device found.
    The value returned is an opaque handle to the specific device to be used in most of the other functions of
    the API.
    The return value for failure is NULL (which is nil for Delphi and 0 for VB6). Use GetLastError()
    to learn more about the reason for failure. The most common reason for failure is of course that no IO-Warrior
    is connected. GetLastError() returns ERROR_DEV_NOT_EXIST for that.
    Calling this function several times is possible, but not advisable. The devices get reenumerated and
    therefore the position in the list for a specific device may change.
    Returning the first IO-Warrior found makes it simpler for programmers to handle the use of only one IOWarrior.
    Linux only handles a maximum of 8 IO-Warriors.
    Sample usage C:
    IOWKIT_HANDLE ioHandle;
    ioHandle = IowKitOpenDevice();
    if (ioHandle != NULL)
    {
    // ... success, access devices
    }
    else
    {
    // ... didn't open IoWarrior, handle error
    }
    Sample usage Delphi:
    var
    ioHandle: IOWKIT_HANDLE;
    begin
    ioHandle := IowKitOpenDevice;
    if Assigned(ioHandle) then
    begin
    // ... success, access devices
    end
    else
    begin
    // ... didn't open IoWarrior, handle error
    end;
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 4
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitSetLegacyOpenMode
    This function is only for IO-Warrior40 older than V1.0.1.0!
    Declaration:
    BOOL IOWKIT_API IowKitSetLegacyOpenMode(ULONG legacyOpenMode);
    function IowKitSetLegacyOpenMode(legacyOpenMode: ULONG): BOOL; stdcall;
    Set legacy devices open mode.
    IowKitLegacyOpenMode() specifies which open mode to use if old IO-Warrior40 chips are present.
    IOW_OPEN_SIMPLE - open simple endpoints only.
    IOW_OPEN_COMPLEX - open complex endpoints only.
    Legacy open mode does not affect new IO-Warrior chips which have serial number support (Firmware
    V1.0.1.0 and later), IOW SDK always opens both endpoints for new IO-Warriors.
    The return value is TRUE (1) for the parameters IOW_OPEN_SIMPLE and IOW_OPEN_COMPLEX
    and FALSE (0) otherwise.
    By default IOW SDK opens only simple endpoints on old IO-Warrior 40 chips, so if you want to open
    the complex endpoints, you must call IowKitSetLegacyOpenMode(IOW_OPEN_COMPLEX)
    before calling IowKitOpenDevice().
    Note that because the SDK opens only one endpoint for each legacy device, there will always be only one
    pipe for each device, thus you should always use 0 as numPipe in calls to IowKitRead()/
    IowKitWrite() functions.
    As of dynamic library version 1.4 this function is deprecated. The dynamic library can now handle even
    old IO-Warrior40 chips without serial number fully. The only difference is now that the older firmware
    revisions do not implement all Special Mode functions.
    Sample usage C:
    IOWKIT_HANDLE ioHandle;
    IowKitSetLegacyOpenMode(IOW_OPEN_COMPLEX);
    ioHandle = IowKitOpenDevice();
    Sample usage Delphi:
    var
    ioHandle: IOWKIT_HANDLE;
    begin
    IowKitSetLegacyOpenMode(IOW_OPEN_COMPLEX);
    ioHandle := IowKitOpenDevice;
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 5
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitGetProductId
    Declaration:
    ULONG IOWKIT_API IowKitProductId(IOWKIT_HANDLE iowHandle);
    function IowKitGetProductId(devHandle: IOWKIT_HANDLE): ULONG; stdcall;
    Return the Product ID of the IO-Warrior device identified by iowHandle.
    The Product ID is a 16-bit Word identifying the specific kind of IO-Warrior. For easier compatibility with
    VB6 the function returns a 32-bit DWORD with the upper word set to 0.
    IOWKIT_PRODUCT_ID_IOW40 (0x1500, $1500, &H1500) is returned for an IO-Warrior 40
    whereas IOWKIT_PRODUCT_ID_IOW24 (0x1501, $1501, &H1501) is returned for an IO-Warrior
    24. 0 is returned for an invalid iowHandle.
    The value is cached in the dynamic library because access to the device needs some msecs.
    Sample usage C:
    BOOLEAN IsIOWarrior24(IOWKIT_HANDLE ioHandle)
    {
    return IowKitGetProductId(ioHandle) == IOWKIT_PRODUCT_ID_IOW24;
    }
    BOOLEAN IsIOWarrior40(IOWKIT_HANDLE ioHandle)
    {
    return IowKitGetProductId(ioHandle) == IOWKIT_PRODUCT_ID_IOW40;
    }
    Sample usage Delphi:
    function IsIOWarrior24(ioHandle: IOWKIT_HANDLE): Boolean;
    begin
    Result := IowKitGetProductId(ioHandle) = IOWKIT_PRODUCT_ID_IOW24;
    end;
    function IsIOWarrior40(ioHandle: IOWKIT_HANDLE): Boolean;
    begin
    Result := IowKitGetProductId(ioHandle) = IOWKIT_PRODUCT_ID_IOW40;
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 6
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitGetNumDevs
    Declaration:
    ULONG IOWKIT_API IowKitGetNumDevs(void);
    function IowKitGetNumDevs: ULONG; stdcall;
    Returns the number of IO-Warrior devices present.
    The function has to be called after IowKitOpenDevice() to return meaningful results.
    Plugging or unplugging IO-Warriors after calling IowKitOpenDevice() is not handled. The number
    IowKitGetNumDevs() returns stays the same.
    Sample usage C:
    IOWKIT_HANDLE ioHandle;
    ULONG numDevs;
    ioHandle = IowKitOpenDevice();
    if (ioHandle != NULL)
    {
    // ... success, count devices
    numDevs = IowKitGetNumDevs();
    }
    Sample usage Delphi:
    var
    ioHandle: IOWKIT_HANDLE;
    numDevs: ULONG;
    begin
    ioHandle := IowKitOpenDevice;
    if Assigned(ioHandle) then
    begin
    // ... success, count devices
    numDevs := IowKitGetNumDevs;
    end;
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 7
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitGetDeviceHandle
    Declaration:
    IOWKIT_HANDLE IOWKIT_API IowKitGetDeviceHandle(ULONG numDevice);
    function IowKitGetDeviceHandle(numDevice: ULONG): IOWKIT_HANDLE; stdcall;
    Access a specific IO-Warrior present. numDevice is an index into the available IO-Warrior devices.
    The number range is 1 to IowKitGetNumDevs(). Any value outside that range returns NULL/nil.
    IowKitGetDeviceHandle(1) returns the same handle as IowKitOpenDevice().
    Understand this function as an extension to IowKitOpenDevice(). IowKitOpenDevice() has
    opened all IO-Warriors but has only returned the first one found. IowKitGetDeviceHandle() allows
    to access the other devices found.
    Sample usage C:
    IOWKIT_HANDLE ioHandles[IOWKIT_MAX_DEVICES];
    ULONG numDevs, i;
    ioHandles[0] = IowKitOpenDevice();
    if (ioHandles[0] != NULL)
    {
    // ... success, count devices
    numDevs = IowKitGetNumDevs();
    // get all IO-Warriors
    for(i = 2; i <= numDevs; i++)
    ioHandles[i-1] = IowKitGetDeviceHandle(i);
    }
    Sample usage Delphi:
    var
    ioHandles: array [1..IOWKIT_MAX_DEVICES] of IOWKIT_HANDLE;
    I: ULONG;
    begin
    ioHandles[1] := IowKitOpenDevice;
    if Assigned(ioHandles[1]) then
    // get all IO-Warriors
    for I := 2 to IowKitGetNumDevs do
    ioHandles := IowKitGetDeviceHandle(I);
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 8
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitGetRevision
    Declaration:
    ULONG IOWKIT_API IowKitGetRevision(IOWKIT_HANDLE iowHandle);
    function IowKitGetRevision(devHandle: IOWKIT_HANDLE): ULONG; stdcall;
    A new function of dynamic library version 1.4.
    Return the revision of the firmware of the IO-Warrior device identified by iowHandle.
    The revision is a 16-bit Word telling the revision of the firmware. For easier compatibility with VB6 the
    function returns a 32-bit DWORD with the upper word set to 0.
    The revision consists of 4 hex digits. $1021 designates the current revision 1.0.2.1. 0 is returned for an
    invalid iowHandle.
    Legacy IO-Warriors (without serial number) have a revision < 1.0.1.0 (0x1010, $1010, &H1010).
    The value is cached in the dynamic library because access to the device needs some msecs.
    Sample usage C:
    BOOLEAN IsLegacyIOWarrior(IOWKIT_HANDLE ioHandle)
    {
    return IowKitGetRevision(ioHandle) < IOW_NON_LEGACY_REVISION;
    }
    Sample usage Delphi:
    function IsLegacyIOWarrior(ioHandle: IOWKIT_HANDLE): Boolean;
    begin
    Result := IowKitGetRevision(ioHandle) < IOW_NON_LEGACY_REVISION;
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 9
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitGetSerialNumber
    Declaration:
    BOOL IOWKIT_API IowKitGetSerialNumber(IOWKIT_HANDLE iowHandle, PWCHAR serialNumber);
    function IowKitGetSerialNumber(devHandle: IOWKIT_HANDLE;
    serialNumber: PWideChar): BOOL; stdcall;
    Fills a buffer with the serial number string of the specific IO-Warrior identified by iowHandle.
    All IO-Warriors (for IOW40 only those with firmware V1.0.1.0 and later) contain an 8 digit serial
    number. The serial number is represented as an Unicode string. The buffer pointed to by
    serialNumber must be big enough to hold 9 Unicode characters (18 bytes), because the string is
    terminated in the usual C way with a 0 character.
    On success, this function copies the IO-Warrior serial number string to the buffer and returns TRUE. It
    fails and returns FALSE if the IO-Warrior does not have a serial number or if either iowHandle or
    serialNumber buffer are invalid.
    Sample usage C:
    void ShowSerialNumber(IOWKIT_HANDLE ioHandle)
    {
    WCHAR buffer[9];
    IowKitGetSerialNumber(ioHandle, buffer);
    printf("%ws\n", buffer);
    }
    Sample usage Delphi:
    procedure ShowSerialNumber(ioHandle: IOWKIT_HANDLE);
    var
    Buffer: array [0..8] of WideChar;
    begin
    IowKitGetSerialNumber(ioHandle, @Buffer[0]);
    ShowMessage(Buffer);
    end;
    Sample usage Visual Basic 6:
    Dim N As Long
    Dim S(18) As Byte
    N = IowKitGetSerialNumber(IowKitGetDeviceHandle(1), S(0))
    Label.Caption = S
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 10
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitCloseDevice
    Declaration:
    void IOWKIT_API IowKitCloseDevice(IOWKIT_HANDLE devHandle);
    procedure IowKitCloseDevice(devHandle: IOWKIT_HANDLE); stdcall;
    Close all IO-Warriors.
    You must call this function when you are done using IO-Warriors in your program.
    If multiple IO-Warriors are present all will be closed by this function.
    IowKitOpenDevice() and IowKitCloseDevice() use a IOWKIT_HANDLE for the most
    common case of only one IO-Warrior connected to the computer. This way you do not have to think about
    IowKitGetNumDevs() or IowKitGetDeviceHandle() at all.
    As of dynamic library version 1.4 the function ignores the parameter completely. Since it closes all
    opened IO-Warriors anyway, there is no real need to check if the parameter is the IOWKIT_HANDLE
    returned by IowKitOpenDevice().
    The parameter is now only retained for compatibility and cleaner looking sources. If you handle only a
    single IO-Warrior in your program then IowKitOpenDevice() and IowKitCloseDevice() look
    and work as intuition suggests.
    Sample usage C and Delphi:
    // OK, we're done, close IO-Warrior
    IowKitCloseDevice(ioHandle);
    ...
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 11
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitRead
    Declaration:
    ULONG IOWKIT_API IowKitRead(IOWKIT_HANDLE devHandle, ULONG numPipe,
    PCHAR buffer, ULONG length);
    function IowKitRead(devHandle: IOWKIT_HANDLE; numPipe: ULONG;
    buffer: PChar; length: ULONG): ULONG; stdcall;
    Read data from IO-Warrior.
    This function reads length bytes from IO-Warrior and returns the number of bytes read if successful.
    Note that you must specify the number of the pipe (see IO-Warrior specs) to read from. numPipe ranges
    from 0 to IOWKIT_MAX_PIPES-1.
    Since the IO-Warriors are HID devices, you can only read the data in chunks called reports. Each report is
    preceded by a ReportID byte. The "IOWarriorDatasheet.pdf" elaborates about that.
    The function returns the number of bytes read, so you should always check if it reads the correct number
    of bytes, you can use GetLastError() to get error details. Keep in mind that data is always returned
    in report chunks, so reading 5 bytes from the IO-pins of an IO-Warrior 24 would only return 3 bytes of
    data because the IO-Warrior 24 has a 3 byte report whereas an IO-Warrior 40 has a 5 byte report.
    The Special Mode pipe has a report size of 8 bytes for all IO-Warriors.
    Linux does not have a ReportID byte of 0 for pipe 0 (I/O pins). To be completely compatible with
    Windows libiowkit.so adds that ReportID to the data.
    As of dynamic library version 1.4 and later the function correctly reads several reports at once.
    ATTENTION!
    This function blocks the current thread until something changes on IO-Warrior (i.e. until user presses a
    button connected to an input pin, or until IIC data arrives), so if you do not want your program to be
    blocked you should use a separate thread for reading from IO-Warrior. If you do not want a blocking read
    use IowKitReadNonBlocking().
    Alternatively you can set the read timeout with IowKitSetTimeout() to force IowKitRead() to
    fail when the timeout elapsed.
    Sample usage C:
    IOWKIT40_IO_REPORT report;
    ULONG res;
    // Read IO pins of IO-Warrior 40
    res = IowKitRead(ioHandle, IOW_PIPE_IO_PINS,
    &report, IOWKIT40_IO_REPORT_SIZE);
    if (res != IOWKIT40_IO_REPORT_SIZE)
    {
    // Didn't read, handle error
    ...
    }
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 12
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitReadNonBlocking
    Declaration:
    ULONG IOWKIT_API IowKitReadNonBlocking(IOWKIT_HANDLE devHandle, ULONG numPipe,
    PCHAR buffer, ULONG length);
    function IowKitReadNonBlocking(devHandle: IOWKIT_HANDLE; numPipe: ULONG;
    buffer: PChar; length: ULONG): ULONG; stdcall;
    New function of the 1.5 API.
    Read data from IO-Warrior, but do not block if no data is available.
    This function reads length bytes from IO-Warrior and returns the number of bytes read if successful.
    Note that you must specify the number of the pipe (see IO-Warrior specs) to read from. numPipe ranges
    from 0 to IOWKIT_MAX_PIPES-1. On error or if no data is available the function returns 0.
    Since the IO-Warriors are HID devices, you can only read the data in chunks called reports. Each report is
    preceded by a ReportID byte. The "IOWarriorDatasheet.pdf" elaborates about that.
    The function returns the number of bytes read, so you should always check if it reads the correct number
    of bytes, you can use GetLastError() to get error details. Keep in mind that data is always returned
    in report chunks, so reading 5 bytes from the IO-pins of an IO-Warrior 24 would only return 3 bytes of
    data because the IO-Warrior 24 has a 3 byte report whereas an IO-Warrior 40 has a 5 byte report.
    The Special Mode pipe has a report size of 8 bytes for IO-Warriors 24 and 40.
    Linux does not have a ReportID byte of 0 for pipe 0 (I/O pins). To be completely compatible with
    Windows libiowkit.so adds that ReportID to the data.
    The function can read several reports at once. It reads as many reports as available. The internal buffering can
    hold up to 128 reports.
    Sample usage C:
    IOWKIT40_IO_REPORT report;
    ULONG res;
    // Read IO pins of IO-Warrior 40
    res = IowKitReadNonBlocking(ioHandle, IOW_PIPE_IO_PINS,
    &report, IOWKIT40_IO_REPORT_SIZE);
    if (res == 0)
    {
    // Didn't read, handle error
    }
    Sample usage Delphi:
    var
    Report: IOWKIT40_IO_REPORT;
    Ret: ULONG;
    begin
    // Read IO pins of IO-Warrior 40
    Ret := IowKitReadNonBlocking(ioHandle, IOW_PIPE_IO_PINS,
    @report, IOWKIT40_IO_REPORT_SIZE);
    if Ret = 0 then
    begin
    // Didn't read, handle error
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 13
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitReadImmediate
    Declaration:
    BOOL IOWKIT_API IowKitReadImmediate(IOWKIT_HANDLE devHandle, PDWORD value);
    function IowKitReadImmediate(devHandle: IOWKIT_HANDLE; var value: DWORD): BOOL; stdcall;
    Return current value directly read from the IO-Warrior I/O pins.
    The function returns TRUE if a new value has arrived otherwise it returns FALSE and places the last
    value read into value.
    The function can only read the I/O pins so it does not need a numPipe parameter. It also abstracts from the
    number of I/O pins the device has. It always returns 32 bits as a DWORD. For the IOWarrior24 which has only
    16 I/O pins the upper WORD of the DWORD is set to 0.
    The function internally uses the Special Mode Function „Read current pin status“ if available. For chip
    revisions predating revision 1.0.1.0 it returns the most recent value read from the IO-Pins or returns FALSE if no
    value has been read yet.
    The 1.4 version of the API implements another strategy. That strategy is now available through
    IowKitReadNonBlocking. 1.5 reverts to the implementation of the 1.2 API to provide compatibility.
    This function fails unconditionally for IOW56 devices because it cannot handle more than 32 bits. For the
    IOW56 you can always use the special mode function „Get Current Pin Status“ directly instead.
    Sample usage C:
    DWORD bits;
    if (IowKitReadImmediate(ioHandle, &bits))
    {
    // new data from IO-Warrior pins
    ...
    }
    Sample usage Delphi:
    var
    Bits: DWORD;
    begin
    if IowKitReadImmediate(ioHandle, Bits) then
    begin
    // new data from IO-Warrior pins
    ...
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 14
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitSetTimeout
    Declaration:
    BOOL IOWKIT_API IowKitSetTimeout(IOWKIT_HANDLE devHandle, ULONG timeout);
    function IowKitSetTimeout(devHandle: IOWKIT_HANDLE; timeout: ULONG): BOOL; stdcall;
    Set read I/O timeout in milliseconds.
    It is possible to lose reports with HID devices. Since reading a HID device is a blocking call it is possible
    to block your application in that case.
    IowKitSetTimeout() makes IowKitRead() fail if it does not read a report in the allotted time.
    If IowKitRead() times out, you have to restart any pending transaction (for example, IIC write or read
    transaction) from the beginning.
    It is recommended to use 1 second (1000) or bigger timeout values.
    Sample usage C and Delphi:
    // set read timeout to 1000 msecs
    IowKitSetTimeout(ioHandle, 1000);
    ...
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 15
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitSetWriteTimeout
    Declaration:
    BOOL IOWKIT_API IowKitSetWriteTimeout(IOWKIT_HANDLE devHandle, ULONG timeout);
    function IowKitSetWriteTimeout(devHandle: IOWKIT_HANDLE; timeout: ULONG): BOOL; stdcall;
    Set write I/O timeout in milliseconds.
    IowKitSetWriteTimeout() makes IowKitWrite() fail if it does not write a report in the
    allotted time. If IowKitWrite() times out, you have to restart any pending transaction (for example, IIC write
    transaction) from the beginning.
    Failure of IowKitWrite() is uncommon. Check your hardware if you encounter write errors.
    libiowkit.so does not implement IowKitSetWriteTimeout() yet.
    It is recommended to use 1 second (1000) or bigger timeout values.
    Sample usage C and Delphi:
    // set write timeout to 1000 msecs
    IowKitSetWriteTimeout(ioHandle, 1000);
    ...
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 16
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitCancelIo
    Description:
    BOOL IOWKIT_API IowKitCancelIo(IOWKIT_HANDLE devHandle, ULONG numPipe);
    function IowKitCancelIo(devHandle: IOWKIT_HANDLE; numPipe: ULONG): BOOL; stdcall;
    Cancel a read or write operation under way on one of the pipes.
    This function is seldom used, because you need several threads in your program to be able to call it at all.
    IowKitRead() blocks the thread so you need another thread for canceling. Setting the timeouts is an
    easier way for handling read or write problems.
    The function cancels pending read and write operations simultaneously.
    Sample usage:
    // cancel I/O for I/O pins
    IowKitCancelIo(ioHandle, IOW_PIPE_IO_PINS);
    ...
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 17
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitWrite
    Declaration:
    ULONG IOWKIT_API IowKitWrite(IOWKIT_HANDLE devHandle, ULONG numPipe,
    PCHAR buffer, ULONG length);
    function IowKitWrite(devHandle: IOWKIT_HANDLE; numPipe: ULONG;
    buffer: PChar; length: ULONG): ULONG; stdcall;
    Write length bytes of data to pipe numPipe of IO-Warrior. The return value is the number of bytes
    written. Writing something else than a single report of the correct size and a valid report ID for the pipe
    fails for Windows. The function allows writing to the I/O pins through pipe 0 and Special Mode functions
    through pipe 1. To be completely compatible with the Windows version libiowkit.so expects a ReportID 0
    for pipe 0 (I/O pins) even if Linux does not have a ReportID on pipe 0. The ReportID is stripped from the
    data sent to the device.
    Sample write to pipe 0 of an IO-Warrior 40:
    DWORD value consists of 32 bits, which correspond to the 32 IO-Warrior 40 I/O pins. Each bit has the
    following meaning:
    When a 1 is written to a pin the output driver of that pin is off and the pin is pulled high by an internal
    resistor. The pin can now be used as an input or an output with high state.
    When a 0 is written to a pin the output driver is switched on pulling the pin to ground. The pin is now a
    output driving low.
    For example, writing 0 (all 32 bits are zero) to IO-Warrior sets all pins as outputs driving low (so if you
    have LEDs connected to them they will be on).
    Reading the status of the pins does always return the logic level on the pins, not the value written to the
    pin drivers.
    Writing 0xFFFFFFFF (value in hex, all 32 bits set) sets all pins as inputs.
    Note that if you want to use a pin as an input, you must first set it up as input, in other words, you must
    write 1 to it. For connected LEDs this means they go off.
    Sample usage C:
    IOWKIT40_IO_REPORT report;
    ULONG res;
    // Write IO pins of IO-Warrior 40
    report.ReportID = 0;
    report.Value = 0; // all LEDs *on*
    res = IowKitWrite(ioHandle, IOW_PIPE_IO_PINS,
    &report, IOWKIT40_IO_REPORT_SIZE);
    if (res != IOWKIT40_IO_REPORT_SIZE)
    {
    // Didn't write, handle error
    ...
    }
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 18
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitGetThreadHandle
    Description:
    HANDLE IOWKIT_API IowKitGetThreadHandle(IOWKIT_HANDLE iowHandle);
    function IowKitGetThreadHandle(devHandle: IOWKIT_HANDLE): THandle; stdcall;
    A new function of dynamic library version 1.4.
    It returns the internal Windows thread handle used to read the I/O pins of the IO-Warrior.
    The function is only for programmers with expert knowledge about threads. It is provided for
    manipulations like raising or lowering thread priority.
    Since Linux does not need a thread for implementing the IO-Warrior functions,
    IowKitGetThreadHandle() always returns 0 then.
    Sample usage C:
    HANDLE threadHandle;
    threadHandle = IowKitGetThreadHandle(ioHandle);
    if (threadHandle != NULL)
    {
    // lower thread priority
    SetThreadPriority(threadHandle, THREAD_PRIORITY_BELOW_NORMAL);
    }
    Sample usage Delphi:
    var
    ThreadHandle: Thandle;
    begin
    ThreadHandle := IowKitGetThreadHandle(ioHandle);
    if ThreadHandle <> 0 then
    begin
    // lower thread priority
    SetThreadPriority(ThreadHandle, THREAD_PRIORITY_BELOW_NORMAL);
    end;
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 19
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitVersion
    Description:
    PCHAR IOWKIT_API IowKitVersion(void);
    function IowKitVersion: PChar; stdcall;
    Return a static C string identifying the dynamic library version. This function has been added with 1.3
    version of the dynamic library. Currently it returns "IO-Warrior Kit V1.5".
    Sample usage C:
    printf("%s\n", IowKitVersion());
    ...
    Sample usage Delphi:
    ShowMessage(IowKitVersion);
    ...
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 20
    IO-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    Programming by Robert Marquardt.
    Legal Stuff
    This document is ©2005 by Code Mercenaries.
    The information contained herein is subject to change
    without notice. Code Mercenaries makes no claims as
    to the completeness or correctness of the information
    contained in this document.
    Code Mercenaries assumes no responsibility for the use
    of any circuitry other than circuitry embodied in a Code
    Mercenaries product. Nor does it convey or imply any
    license under patent or other rights.
    Code Mercenaries products may not be used in any
    medical apparatus or other technical products that are
    critical for the functioning of lifesaving or supporting
    systems. We define these systems as such that in the
    case of failure may lead to the death or injury of a
    person. Incorporation in such a system requires the
    explicit written permission of the president of Code
    Mercenaries.
    Trademarks used in this document are properties of
    their respective owners.
    Code Mercenaries
    Hard- und Software GmbH
    Karl-Marx-Str. 147a
    12529 Schönefeld / Grossziethen
    Germany
    Tel: x49-3379-20509-20
    Fax: x49-3379-20509-30
    Mail: support@codemercs.com
    Web: https://autoit.de/www.codemercs.com
    HRB 16007 P
    Geschäftsführer: Guido Körber, Christian Lucht
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 21

    So, habe mal diese Test Datei in einem C-Editor aufgemacht, und da stand folgendes drinnen:

    Spoiler anzeigen
    [autoit]

    //
    // ioblink.cpp - Blinking LEDs sample
    //

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

    #include "stdafx.h"
    #include "time.h"
    #include "iowkit.h"

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

    // Write simple value
    BOOLEAN WriteSimple(IOWKIT_HANDLE devHandle, DWORD value)
    {
    IOWKIT56_IO_REPORT rep;

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

    // Init report
    memset(&rep, 0xff, IOWKIT56_IO_REPORT_SIZE);
    rep.ReportID = 0;
    switch (IowKitGetProductId(devHandle))
    {
    // Write simple value to IOW40
    case IOWKIT_PRODUCT_ID_IOW40:
    rep.Bytes[3] = (BYTE) value;
    return IowKitWrite(devHandle, IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT40_IO_REPORT_SIZE) == IOWKIT40_IO_REPORT_SIZE;
    // Write simple value to IOW24
    case IOWKIT_PRODUCT_ID_IOW24:
    rep.Bytes[0] = (BYTE) value;
    return IowKitWrite(devHandle, IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT24_IO_REPORT_SIZE) == IOWKIT24_IO_REPORT_SIZE;
    case IOWKIT_PRODUCT_ID_IOW56:
    // Write simple value to IOW56
    rep.Bytes[6] = (BYTE) value;
    return IowKitWrite(devHandle, IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT56_IO_REPORT_SIZE) == IOWKIT56_IO_REPORT_SIZE;
    default:
    return FALSE;
    }
    }

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

    int main(int argc, char* argv[])
    {
    IOWKIT_HANDLE iows[IOWKIT_MAX_DEVICES];
    int i, j;
    ULONG bits;
    int numIows;
    IOWKIT56_IO_REPORT rep;
    WCHAR sn[9];
    ULONG rc;
    DWORD pid;
    IOWKIT_HANDLE devHandle;

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

    // Open device
    devHandle = IowKitOpenDevice();
    if (devHandle == NULL)
    {
    printf("Failed to open device\n");
    goto out;
    }
    // Get number of IOWs in system
    numIows = IowKitGetNumDevs();
    printf("%d IOWs in system\n", numIows);
    // Get all IOW handles
    for (i = 0; i < numIows; i++)
    {
    // Get device handle and init object
    iows[i] = IowKitGetDeviceHandle(i + 1);
    // Get serial number
    IowKitGetSerialNumber(iows[i], sn);
    pid = IowKitGetProductId(iows[i]);
    printf("%d PID %x, S/N \"%ws\"\n", i + 1, pid, sn);
    }
    // Init report
    // Report ID 0 is for writing to 32 input/output pins
    rep.ReportID = 0;
    printf("Blinking LEDs...\n");
    //srand(time(NULL));
    // Blinking'
    for (i = 0; i < 100; i++)
    {
    bits = rand();
    // Make every IOW blink
    for (j = 0; j < numIows; j++)
    {
    // Write to simple endpoint
    rc = WriteSimple(iows[j], bits);
    // Check for error
    if (!rc)
    printf("Cannot write, err %d\n", GetLastError());
    }
    // Sleep for 25ms
    Sleep(25);
    }
    printf("Blinking complete\n");
    // Set LEDs off
    for (i = 0; i < numIows; i++)
    // Write to simple endpoint
    WriteSimple(iows[i], 0xFFFFFFFF);
    for(i = 0; i < 10; i++)
    {

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

    // Read non blocking
    // Init report
    memset(&rep, 0, IOWKIT56_IO_REPORT_SIZE);
    switch (IowKitGetProductId(devHandle))
    {
    case IOWKIT_PRODUCT_ID_IOW40:
    rc = IowKitReadNonBlocking(iows[0], IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT40_IO_REPORT_SIZE);
    printf("%2d) ReadNonBl(): rc=%u bits=", i + 1, rc);
    for (j = IOWKIT40_IO_REPORT_SIZE - 1; j >= 0; j--)
    printf("%02x", rep.Bytes[j]);
    printf("\n");
    break;
    case IOWKIT_PRODUCT_ID_IOW24:
    rc = IowKitReadNonBlocking(iows[0], IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT24_IO_REPORT_SIZE);
    printf("%2d) ReadNonBl(): rc=%u bits=", i + 1, rc);
    for (j = IOWKIT24_IO_REPORT_SIZE - 1; j >= 0; j--)
    printf("%02x", rep.Bytes[j]);
    printf("\n");
    break;
    case IOWKIT_PRODUCT_ID_IOW56:
    rc = IowKitReadNonBlocking(iows[0], IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT56_IO_REPORT_SIZE);
    printf("%2d) ReadNonBl(): rc=%u bits=", i + 1, rc);
    for (j = IOWKIT56_IO_REPORT_SIZE - 1; j >= 0; j--)
    printf("%02x", rep.Bytes[j]);
    printf("\n");
    break;
    }
    Sleep(100);
    }
    // Close device
    IowKitCloseDevice(devHandle);
    out:

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

    return 0;
    }

    [/autoit]


    Hoffe man kann damit etwas anfangen.

    Lg Tim

  • Rahmen beim Markieren auf einer autoitgui

    • AutoTim
    • 26. Juli 2010 um 21:08

    Also willst du theoretisch eine Gui schrieben, bei der du einfach auf der Gui einen Rahmen ziehen kannst. So wie in Paint, wenn du ein Rechteck ziehst ?

    mfg Tim

  • cmd

    • AutoTim
    • 26. Juli 2010 um 19:37

    Danke dir. Nein, er soll nicht den Ordner löschen, sondern den Inhalt. Das wegen dem Papierkorb, ist nur dafür, das man auch die Option hat, sich den Papierkorb leeren zu lassen.

    Danke dir für deinen Vorschlag !!!


    lg Tim


    Edit: Undzwar habe cih das Problem, das ich gerne den Pfad des Papierkorbes bräuchte. Das ist von Win 7 zu Xp unterschiedlich. Ich möchte gerne die Größe des Papierkorbes mit DirGetSize auslesen. Wie ist das möglich ?

  • cmd

    • AutoTim
    • 26. Juli 2010 um 18:50

    Ich hoffe du kannst mir helfen:
    Oder habe ich dich falsch verstanden.

    Hier mein Aktueller Code :

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Process.au3> ; Für die _RunDOS
    #include <EditConstants.au3> ; Für die EditBox in Hilfe

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

    Dim $Zahler1 = 0
    Dim $Zahler2 = 0
    Dim $Zahler3 = 0
    Dim $Zahler4 = 0
    Dim $Zahler5 = 0
    Dim $Zahler6 = 0
    Dim $Zahler7 = 0
    Dim $Zahler8 = 0
    Dim $Zahler9 = 0
    Dim $Zahler10 = 0

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

    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaner.kxf
    $SimpleCleaner = GUICreate("Simple Cleaner", 390, 515, 275, 166)
    GUISetIcon("S-ico.ico")
    $Fragezeichen = GUICtrlCreateMenu("?")
    $Hilfe = GUICtrlCreateMenuItem("Hilfe", $Fragezeichen)
    $Uber = GUICtrlCreateMenuItem("Über", $Fragezeichen)
    $Checkbox1 = GUICtrlCreateCheckbox("Coockies löschen", 46, 48, 297, 33)
    $Checkbox2 = GUICtrlCreateCheckbox("Lokale Verlauf löschen", 46, 80, 297, 33)
    $Checkbox3 = GUICtrlCreateCheckbox("Temporare Internet Dateien löschen", 46, 112, 297, 33)
    $Checkbox4 = GUICtrlCreateCheckbox("Temp- Ordner leeren", 46, 144, 297, 33)
    $Checkbox5 = GUICtrlCreateCheckbox("Recent- Ordner leeren", 46, 176, 297, 33)
    $Checkbox6 = GUICtrlCreateCheckbox("Microsoft Office Dateien Löschen", 46, 208, 297, 33)
    $Checkbox7 = GUICtrlCreateCheckbox("Installation Informationen", 46, 240, 297, 33)
    $Checkbox8 = GUICtrlCreateCheckbox("Windows Temp- Ordner leeren", 46, 272, 297, 33)
    $Checkbox9 = GUICtrlCreateCheckbox("IP- FlushDNS", 46, 304, 297, 33)
    $ML = GUICtrlCreateButton("Markiertes Löschen", 134, 352, 121, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(26, 440, 337, 33)
    $Label1 = GUICtrlCreateLabel("Simple Cleaner", 119, 16, 151, 33)
    GUICtrlSetFont(-1, 18, 800, 2, "Script MT Bold")
    $Label2 = GUICtrlCreateLabel("Bitte zu löschende Dateien auswählen.", 23, 408, 343, 17)
    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]

    Case $Hilfe
    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaoner\Hilfe.kxf
    $HilfeForm = GUICreate("Hilfe", 413, 304, 302, 218)
    GUISetIcon("S-ico.ico")
    $GroupH1 = GUICtrlCreateGroup("Hilfe zu Simple Cleaner", 14, 15, 385, 265)
    $EditH1 = GUICtrlCreateEdit("", 22, 36, 369, 233, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
    GUICtrlSetData(-1, "Mit Simple Cleaner, ist es Möglich überflüssige Systemdateien einfach und restlos zu entfernen. "&@crlf&""&@crlf&"Was Sie löschen möchten, entscheiden Sie! "&@crlf&"Sie markieren einfach was Sie löschen möchten, und drücken dann auf "&@crlf&""&@crlf&"-Markiertes Löschen-."&@crlf&""&@crlf&" Nun warten Sie einfach ab, bis alles erfolgreich gelöscht worden ist. "&@crlf&"Das Programm kann nun geschlossen werden.")
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete ($HilfeForm)
    ExitLoop

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

    EndSwitch
    WEnd

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

    Case $Uber
    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaoner\Über.kxf
    $UberForm = GUICreate("Über", 324, 240, 302, 218)
    GUISetIcon("S-ico.ico")
    $picU1 = GUICtrlCreatePic("pic1.jpg", 16, 24, 105, 97, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $GroupBox1 = GUICtrlCreateGroup("", 8, 8, 305, 185)
    $LabelU1 = GUICtrlCreateLabel("Simple Cleaner", 152, 24, 133, 28, $WS_GROUP)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $LabelU2 = GUICtrlCreateLabel("1.0", 152, 56, 26, 24, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $LabelU4 = GUICtrlCreateLabel("Comments: Build Juli 2010", 16, 160, 127, 17, $WS_GROUP)
    $LabelU3 = GUICtrlCreateLabel("Copyright by Tim Erler", 16, 136, 106, 17, $WS_GROUP)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $OK = GUICtrlCreateButton("&OK", 112, 208, 75, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete ($UberForm)
    ExitLoop

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

    Case $OK
    GUIDelete ($UberForm)
    ExitLoop
    EndSwitch
    WEnd

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

    Case $ML
    if bitand(guictrlread($checkbox1),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Cookies",1)
    GUICtrlSetData ( $Label2, "Coockies gelöscht" )
    GUICtrlSetData ( $Progress1, 10 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox2),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Verlauf",1)
    GUICtrlSetData ( $Label2, "Lokale Verlauf gelöscht" )
    GUICtrlSetData ( $Progress1, 20 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox3),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Temporary Internet Files",1)
    GUICtrlSetData ( $Label2, "Temporare Internet Dateien gelöscht" )
    GUICtrlSetData ( $Progress1, 30 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox4),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Temp",1)
    GUICtrlSetData ( $Label2, "Temp- Ordner gelehrt" )
    GUICtrlSetData ( $Progress1, 40 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox5),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Recent",1)
    GUICtrlSetData ( $Label2, "Recent- Ordner gelehrt" )
    GUICtrlSetData ( $Progress1, 50 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox6),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Anwendungsdaten\Microsoft\Office\Zuletzt verwendet",1)
    GUICtrlSetData ( $Label2, "Microsoft Office Dateien gelöscht" )
    GUICtrlSetData ( $Progress1, 60 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox7),$GUI_CHECKED) then
    DirRemove("C:\Programme\InstallShield Installation Information",1)
    GUICtrlSetData ( $Label2, "Installation Informationen gelöscht" )
    GUICtrlSetData ( $Progress1, 70 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox8),$GUI_CHECKED) then
    DirRemove(@WindowsDir & "\Temp",1)
    GUICtrlSetData ( $Label2, "Windows Temp- Ordner gelehrt",1)
    GUICtrlSetData ( $Progress1, 80 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox9),$GUI_CHECKED) then
    _RunDOS("ipconfig /flushdns")
    GUICtrlSetData ( $Label2, "IP-DNS gelöscht" )
    GUICtrlSetData ( $Progress1, 90 )
    Sleep(500)
    else
    endif

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

    GUICtrlSetData ( $Progress1, 100 )
    GUICtrlSetData ( $Label2, " FERTIG..." )

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

    if bitand(guictrlread($checkbox1),$GUI_UNCHECKED) then $Zahler1 = 1
    if bitand(guictrlread($checkbox2),$GUI_UNCHECKED) then $Zahler2 = 1
    if bitand(guictrlread($checkbox3),$GUI_UNCHECKED) then $Zahler3 = 1
    if bitand(guictrlread($checkbox4),$GUI_UNCHECKED) then $Zahler4 = 1
    if bitand(guictrlread($checkbox5),$GUI_UNCHECKED) then $Zahler5 = 1
    if bitand(guictrlread($checkbox6),$GUI_UNCHECKED) then $Zahler6 = 1
    if bitand(guictrlread($checkbox7),$GUI_UNCHECKED) then $Zahler7 = 1
    if bitand(guictrlread($checkbox8),$GUI_UNCHECKED) then $Zahler8 = 1
    if bitand(guictrlread($checkbox9),$GUI_UNCHECKED) then $Zahler9 = 1
    $Zahler10 = $Zahler1 + $Zahler2 + $Zahler3 + $Zahler4 + $Zahler5 + $Zahler6 + $Zahler7 + $Zahler8 + $Zahler9

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

    if $Zahler10 = 9 then ;Nur weil 9 Checkboxen zur verfügung stehen sonnt eben 9 oder co. --- Nun 9 mit der dns
    GUICtrlSetData ( $Label2, "ES MUSS MINDESTENS EINE OPTION ANGEKLICKT SEIN" )
    GUICtrlSetData ( $Progress1, 0 )
    EndIf

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

    Dim $Zahler1 = 0; Variablen wieder auf 0 Setzen
    Dim $Zahler2 = 0
    Dim $Zahler3 = 0
    Dim $Zahler4 = 0
    Dim $Zahler5 = 0
    Dim $Zahler6 = 0
    Dim $Zahler7 = 0
    Dim $Zahler8 = 0
    Dim $Zahler9 = 0
    Dim $Zahler10 = 0

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

    EndSwitch
    WEnd

    [/autoit]

    PS: Ich muss erlich sagen, ich habe eigentlich nochnie Func genutzt. Habe davon keine Ahnung. Ich weis klingt blöd, aber habe es immer so gelöst wie mein Script zeigt :)


    EDIT5: Habe Ich die Möglichkeit mir die Größe eines Ordner, also z.B. vom Temp Ordner anzeigen zu lassen --> In eine Variable speichern. Ich habe gesucht und
    FileGetSize() gefunden. Ich habe das Problem, das dies nur mit einer Datei geht, und nicht mit einem Ordner. Was kann cih da machen ?

    lg Tim

  • cmd

    • AutoTim
    • 26. Juli 2010 um 17:28

    Haha, habs in der Zeit auch gefunden, und wollte es eben editieren ;)

    DANKE dir ;)

    lg Tim

  • cmd

    • AutoTim
    • 26. Juli 2010 um 17:10

    Danke dir. Ähm, wie meinst du das ? Also alle dateien vom Typ mp3. Oder wie meinst du das ?

    So kann der benutzer ja wählen, was er löschen will. Cookies, Temp,... oder sowas.


    mfg Tim


    OK, noch mal zu diesem hier komment:

    @UserProfileDir & "\Cookies"


    Das Problem ist, bei dem Pfad:
    "C:\Windows\Temp" geht das nicht, weil es ja nich in der Juser ist. Gibt es dafür auch was ?

    lg Tim

  • cmd

    • AutoTim
    • 25. Juli 2010 um 19:23

    Hey, danke dir. Super nun ist das auch mit eingebunden. Hat noch jemand zufällig etwas was man nicht mehr auf dem PC braucht.

    Dann her damit ;)

    Das Programm funktioniert soweit super !! Hat noch jemand eine Idee, wie ich es schaffe, den Pfad zu kürzen ?

    Also stadt so: C:\Dokumente und Einstellungen\administrator\Cookies
    z.B. C:\*\Cookies <-- Also das sich der PC dabei auf der Platte C den Ordner Cookies vornimmt ;)

    lg Tim

  • AutoIT mit USB EXPERIMENT INTERFACE BOARD - BAUSATZ

    • AutoTim
    • 25. Juli 2010 um 16:57

    Meine Empfehlung:

    http://www.codemercs.com/shop/index.php?page=categorie&cat=1&x17cd1=9cc483ef44ea14db2a1e57bd8450a2e3

    mfg Tim

  • cmd

    • AutoTim
    • 25. Juli 2010 um 09:56

    Ok, habe das nun mit File Delete gelöst. Nun möchte cih aber auch noch alle unterordner die sich im angegebenem Ordner befinden löschen. Ist dies mit File Delete möglich, oder brauche ich da eine andere Funktion ?

    mfg Tim

    Habe nun mit FileRemove gearbeitet, aber es werden immer noch Ordner in dem Angegebenem Ordner stehen gelasssen.

    Ach, hier mein Momentanes Script:

    Spoiler anzeigen
    [autoit]

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

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

    Dim $Zahler1 = 0
    Dim $Zahler2 = 0
    Dim $Zahler3 = 0
    Dim $Zahler4 = 0
    Dim $Zahler5 = 0
    Dim $Zahler6 = 0
    Dim $Zahler7 = 0
    Dim $Zahler8 = 0
    Dim $Zahler9 = 0
    Dim $Zahler10 = 0

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

    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaner.kxf
    $SimpleCleaner = GUICreate("Simple Cleaner", 390, 493, 275, 166)
    GUISetIcon("S-ico.ico")
    $Checkbox1 = GUICtrlCreateCheckbox("Coockies löschen", 46, 48, 297, 33)
    $Checkbox2 = GUICtrlCreateCheckbox("Lokale Verlauf löschen", 46, 80, 297, 33)
    $Checkbox3 = GUICtrlCreateCheckbox("Temporare Internet Dateien löschen", 46, 112, 297, 33)
    $Checkbox4 = GUICtrlCreateCheckbox("Temp- Ordner leeren", 46, 144, 297, 33)
    $Checkbox5 = GUICtrlCreateCheckbox("Recent- Ordner leeren", 46, 176, 297, 33)
    $Checkbox6 = GUICtrlCreateCheckbox("Microsoft Office Dateien Löschen", 46, 208, 297, 33)
    $Checkbox7 = GUICtrlCreateCheckbox("Installation Informationen", 46, 240, 297, 33)
    $Checkbox8 = GUICtrlCreateCheckbox("Windows Temp- Ordner leeren", 46, 272, 297, 33)
    $Checkbox9 = GUICtrlCreateCheckbox("--- NOCH NICHT BELEGT ---", 46, 304, 297, 33)
    $Button1 = GUICtrlCreateButton("Markiertes Löschen", 134, 352, 121, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(26, 440, 337, 33)
    $Label1 = GUICtrlCreateLabel("Simple Cleaner", 119, 16, 151, 33)
    GUICtrlSetFont(-1, 18, 800, 2, "Script MT Bold")
    $Label2 = GUICtrlCreateLabel("Bitte zu löschende Dateien auswählen.", 23, 408, 343, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    if bitand(guictrlread($checkbox1),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Coockies löschen" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Cookies",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 10 )
    endif

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

    if bitand(guictrlread($checkbox2),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Lokale Verlauf löschen" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Verlauf",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 20 )
    endif

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

    if bitand(guictrlread($checkbox3),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Temporare Internet Dateien löschen" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Temporary Internet Files",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 30 )
    endif

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

    if bitand(guictrlread($checkbox4),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Temp- Ordner leeren" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Temp",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 40 )
    endif

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

    if bitand(guictrlread($checkbox5),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Recent- Ordner leeren" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Recent",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 50 )
    endif

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

    if bitand(guictrlread($checkbox6),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Microsoft Office Dateien Löschen" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Anwendungsdaten\Microsoft\Office\Zuletzt verwendet",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 60 )
    endif

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

    if bitand(guictrlread($checkbox7),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Installation Informationen" )
    DirRemove("C:\Programme\InstallShield Installation Information",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 70 )
    endif

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

    if bitand(guictrlread($checkbox8),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Windows Temp- Ordner leeren",1)
    DirRemove("C:\Windows\Temp",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 80 )
    endif

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

    ;~ if bitand(guictrlread($checkbox9),$GUI_CHECKED) then
    ;~ _RunDOS("BEFEHL")
    ;~ GUICtrlSetData ( $Label2, "Coockies löschen" )
    ;~ GUICtrlSetData ( $Progress1, 90 )
    ;~ else
    ;~ endif

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

    GUICtrlSetData ( $Progress1, 100 )

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

    if bitand(guictrlread($checkbox1),$GUI_UNCHECKED) then $Zahler1 = 1
    if bitand(guictrlread($checkbox2),$GUI_UNCHECKED) then $Zahler2 = 1
    if bitand(guictrlread($checkbox3),$GUI_UNCHECKED) then $Zahler3 = 1
    if bitand(guictrlread($checkbox4),$GUI_UNCHECKED) then $Zahler4 = 1
    if bitand(guictrlread($checkbox5),$GUI_UNCHECKED) then $Zahler5 = 1
    if bitand(guictrlread($checkbox6),$GUI_UNCHECKED) then $Zahler6 = 1
    if bitand(guictrlread($checkbox7),$GUI_UNCHECKED) then $Zahler7 = 1
    if bitand(guictrlread($checkbox8),$GUI_UNCHECKED) then $Zahler8 = 1
    ;~ if bitand(guictrlread($checkbox9),$GUI_UNCHECKED) then $Zahler9 = 1
    $Zahler10 = $Zahler1 + $Zahler2 + $Zahler3 + $Zahler4 + $Zahler5 + $Zahler6 + $Zahler7 + $Zahler8 + $Zahler9

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

    if $Zahler10 = 8 then ;Nur weil 8 Checkboxen zur verfügung stehen sonnt eben 9 oder co.
    GUICtrlSetData ( $Label2, "ES MUSS MINDESTENS EINE OPTION ANGEKLICKT SEIN" )
    GUICtrlSetData ( $Progress1, 0 )
    EndIf

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

    EndSwitch
    WEnd

    [/autoit]

    PS: Ach und wenn cih einmal etwas anhake, und dann auf löschen drücke, wird das gelöscht. Und dann wenn cih erneut löschen will, geht es nciht mehr. Ich muss das Script erst erneut öffnen, das es geht.

    Woran liegt es ?

    lg Tim

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™