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

Beiträge von vivus

  • ObjCreate Error bei BSTR* übergabe

    • vivus
    • 6. November 2012 um 16:43

    Hi funkey !

    Ja .. hab ich probiert gehabt .. ohne Erfolg .. war ja fast klar ...

    [autoit]


    ==> The requested action with this object has failed.:
    $bError = $ls.GetVersion()
    $bError = $ls.GetVersion()^ ERROR

    [/autoit]

    kann man da vielleicht was mit "ObjCreateInterface" was machen ?

  • Liste von Ordnerinhalt erzeugen

    • vivus
    • 6. November 2012 um 15:43

    du benutzt $ListeNeu = StringRegExpReplace($Ordnerliste, '.mp3', '', 3) für das ganze Array !!

    das geht nicht ..

    du must das durch ne schleife jagen

    z.b.

    [autoit]


    for $i=1 to $Ordnerliste[0]
    $ListeNeu[$i] = StringRegExpReplace($Ordnerliste[$i], '.mp3', '', 3)
    next

    [/autoit]
  • ObjCreate Error bei BSTR* übergabe

    • vivus
    • 6. November 2012 um 15:39

    Hallo lieber Leser !
    Ich versuche gerade ein OLE/COM-Object via Autoit anzusprechen.

    das erstellen des Handle mit

    [autoit]

    $ls = ObjCreate("Label32")

    [/autoit]

    funktioniert.

    so bekomme ich bei der Funktion

    [autoit]

    $bError = $ls.ShowWindow(1)

    [/autoit]

    die in der Documentation beschriebene Reaktion.

    D.h. soweit keine Fehler. :thumbup:

    Wenn ich aber eine Funktion aufrufen will, welche einen Pointer auf einen String verlangt ( in VB.Net [ BSTR* ] )
    Raucht mir die ganze Schose ab.

    zb.

    [autoit]

    ;Versions nummer ?!?
    $szLabel = ''
    $bError = $ls.GetVersion($szLabel)
    MsgBox(0, @ScriptName, $szLabel & " = $ls.GetVersion($szLabel)")

    [/autoit]

    In der Doku wird die Funktion in VB.Net mit
    Dim SVersion as String = ""
    iResult = oLSP.GetVersion(sVersion)
    ' sVersion enhält den Versionsstring


    ich bekomme aber lediglich die Fehlermeldung

    [autoit]

    ==> The requested action with this object has failed.:
    $bError = $ls.GetVersion($szLabel)
    $bError = $ls.GetVersion($szLabel)^ ERROR

    [/autoit]

    Hab schon eine ganze Weile gesucht und nur das AutoItObject.UDF gefunden wo da anscheinend helfen soll.... aber damit bin ich TOTAL überfordert !!! ?(

    hat jemand n Tip ?

  • 64Bit Problem mit UDF

    • vivus
    • 18. Oktober 2012 um 08:31

    wenn ich "Rechte-Maustaste" -> "Run Script (x86)" oder "Compile Script (x86)" funktioniert das Script.

    nur als "Run Script (x8)4" oder "Compile Script (x64)" antwortet das UDF nicht ..

  • 64Bit Problem mit UDF

    • vivus
    • 17. Oktober 2012 um 15:54

    Hi @ all
    Ich habe einen neuen Rechner incl. neuem Betriebssystem Win 7 64Bit.
    Installierte AutoIt Version habe ich 3.3.9.4 (beta) das die "Hilfe" nicht funktioniert, damit habe ich mir mittlerweile abgefunden. :cursing:;(

    Aber jetzt zum eigentlichen Problem.
    bisher hab ich RS232 immer über die MScomm eingebunden, das funktioniert mit 64Bit 8 laut Google-Suche nur über einen extremen Spagat, d.h. emulation von 32Bit BLA BLA ... ?(

    also habe ich die commmg.dll ausprobiert ( siehe hierzu http://www.autoitscript.com/forum/topic/12…t-com-port-udf/ )

    das komische ist, dass wenn ich das Script im Editor laufen lassen, alles funktioniert !!!!!!!

    Sobald ich aber das Script Compiliere tut sich nichts mehr. ( oder wenn ich "rechte Maustaste"-> "run Script")
    Es kommt nicht mal ein Fehler. . . . Es geht einfach nicht ... :wacko:

    hier ein kleines Test Script : mit der man den Fehler sehr schön sehen kann.

    Spoiler anzeigen
    [autoit]


    #include "CommMG.au3"

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

    ;; Parameters: $iType - integer: = 1 to reurn the commg2_2.dll version
    ; = 2 to return the UDF version
    MsgBox(0, "debug", _CommGetVersion(1) & " @ " & _CommGetVersion(2))

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

    Als MsgBox müssten 2 Strings kommen : a) commg2_2.dll V irgendwass b) UDF Verion

    mein erster verdacht, war die Quelle der *.dll selber

    weil auch extra in dem Beispiel Script :

    [autoit]

    #include 'CommMG.au3';or if you save the commMg.dll in the @scripdir use #include @SciptDir & '\commmg.dll'

    [/autoit]

    steht.

    allerdings meckert mein SciTE wenn ich

    [autoit]

    #include @SciptDir & '\commmg.dll'

    [/autoit]

    in das Script einfüge.

    HAT IRGEND JEMAND N TIP ???????? wo ich da die Suche beginnen kann ??

  • 10 Hz UDP mit nur 5 Hz empfangen

    • vivus
    • 26. Juni 2012 um 08:23

    hi .. also soweit ist weis, wird anders als bei tcp -> udp NICHT der Reihenfolge nach abgearbeitet ...( kein FIFO )

    d.h. du solltest schneller abfragen, als Daten kommen .. sonst bekommst du ein durcheinander ..

    also würde ich eine Abfrage schreiben, die die Daten schneller holt, als diese reell ankommen und dir dann lieber nur jeden 2 oder keine Ahnung 5 Wert erst rauspicken und verarbeiten ..
    und wenn du schneller abfragst als geliefert wird dann haste halt n Zero Bit .. das du einfach nicht beachtest ..

    .. oder reden wir jetzt aneinander vorbei ... ?

  • WebCam Auflösung ändern

    • vivus
    • 20. Juni 2012 um 08:16

    DANKE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Ich hab wirklich alles gegooglet, was mir eingefallen isch, aber zu dem Ergebnis bin ich leider nicht gekommen.
    liegt wohl doch oft an der Formulierung.

    Ich werd jetzt mal mit dem Beispiel mein glück versuchen.

    NOCHMALS DANKE !!! das ist ein schritt in die richtige Richtung !!

    :thumbup:

  • WebCam Auflösung ändern

    • vivus
    • 18. Juni 2012 um 00:02

    gar keiner ne idee ? .. wirklich niemand n Lösungsansatz ? oder n workarround ?

  • AutoIt Error Message ignorieren

    • vivus
    • 4. Juni 2012 um 16:59

    guck dir des mal an ..

    Spoiler anzeigen
    [autoit]

    ;#=#INDEX#==================================================================#
    ;# Title .........: _Error Handler.au3 v 1.2 #
    ;# Description....: AutoIt3 Error Handler & Debugger #
    ;# Date ..........: 7.9.08 #
    ;# Authors .......: jennico (jennicoattminusonlinedotde) #
    ;# @MrCreatoR #
    ;# MadExcept (GUI inspiration by mrRevoked) #
    ;#==========================================================================#

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

    #cs
    im main scrip muss lediglich
    #include <_ErrorHandler_Restart.au3> ; this is all you need !

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

    eingebaut werden.

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

    #ce

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

    #include-once

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

    _OnAutoItError()

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

    ;#=#Function#===============================================================#
    ;# Name ..........: _OnAutoItError ( ) #
    ;# Description....: AutoIt3 Error Handler & Debugger GUI #
    ;# Parameters.....: (None) #
    ;# Date ..........: 7.9.08 #
    ;# Authors .......: jennico (jennicoattminusonlinedotde) #
    ;# @MrCreatoR #
    ;# MadExcept (GUI inspiration by mrRevoked) #
    ;#==========================================================================#

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

    ; this function is made to be customized !

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

    Func _OnAutoItError()

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

    If StringInStr($CmdLineRaw,"/AutoIt3ExecuteScript") Then Return

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

    Opt("TrayIconHide",1) ; run a second instance

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

    $iPID=Run(@AutoItExe&' /ErrorStdOut /AutoIt3ExecuteScript "'&@ScriptFullPath&'"',@ScriptDir,0,6)
    Dim $sErrorMsg

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

    ProcessWait($iPID)

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

    While 1 ; trap the error message
    $sErrorMsg&=StdoutRead($iPID)

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

    If @error Then ExitLoop
    Sleep(1)
    WEnd
    If $sErrorMsg="" Then Exit

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

    GUISetState()

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

    Opt("TrayIconHide",0)
    Opt("TrayAutoPause",0)
    WinSetOnTop(@ScriptName,"",1)
    ;SoundPlay(@WindowsDir&"\Media\chord.wav")
    TraySetToolTip(@ScriptName&@CRLF&"An error occurred in the application.")

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

    $returnVal =MsgBox(17,"Error",$sErrorMsg,5)
    If $returnVal = 1 or $returnVal = -1 then
    Run(@AutoItExe&' "'&@ScriptFullPath& '"',@ScriptDir,0,6)
    ;SoundPlay(@WindowsDir&"\Media\start.wav")
    EndIf
    Exit
    EndFunc

    [/autoit]
  • COM - Port Daten empfangen und senden und in AutoIT anzeigen lassen...

    • vivus
    • 4. Juni 2012 um 16:55

    soweit ich weis, brauchst du nur das ..

    [autoit]

    $MsComm = ObjCreate("MSCOMMLib.MsComm.1")
    $MsComm.CommPort =1
    $MsComm.Settings = "57600,N,8,1"
    $MsComm.Handshaking = 0
    $MsComm.InBufferSize = 1024
    $MsComm.InputLen = 1

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

    $MsComm.PortOpen = 1

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

    $nTimeCtr = 0
    $sBuffer = ""

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

    while 1
    ;$nTimeCtr += 1
    If $MsComm.InBufferCount > 0 Then
    $sBuffer = $sBuffer & $MsComm.Input
    tooltip($sbuffer,0,0)
    EndIf
    sleep(10)

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

    WEnd

    [/autoit]

    must dir nur die "MSCOMM32.OCX" irgend wo saugen ..

  • CuiCTRLCreateCombo soll bei manueller Eingabe auf Enter reagieren

    • vivus
    • 4. Juni 2012 um 16:37

    ist es denn gewollt von dir, dass du in die ComboBox etwas ausser die vordefinierten Item's auswählen kannst ?

    ich glaube nämlich, dass du mit GUICtrlSetData das erst komplettieren musst, da sonst kein korrekter Index verfügbar ist.

    andernfalls würde ich ein workarround mit "HotKeySet " im verweis auf ENTER in Erwägung ziehen ..

  • WebCam Auflösung ändern

    • vivus
    • 4. Juni 2012 um 16:22

    Hi @ all !

    Ich bin seid vollen 2 Tagen am googeln und probieren, komm aber zu keinem Ergebnis.

    ich habe eine 2MP Webcam und würde die gerne in voller Qualität in einer GUI einbauen. ( also 1600*1280 )

    durch die UDF's <WebcamConstants.au3> und <Web_Cam.au3> von BugFix ist das eigentlich schon alles erledigt.
    allerdings NUR mit der einer Auflösung 640 * 480 !!

    auch Bilder lassen sich NUR in dieser Qualität abspeichern/ aufnehmen .

    Die mitgelieferte Software ( DNT-MicroCapture ) der WebCam unterstützt aber die auflösung von 2MP.
    ALSO MÜSSTE ES JA IRGEND WIE FUNKTIONIEREN !! Ich bin aber wohl zu blöd.

    Ich kann zwar via

    [autoit]

    Func _WebcamVideoFormat($sId)
    DllCall($Dll_user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_DLG_VIDEOFORMAT, "int", 1, "int", 0)
    EndFunc

    [/autoit]

    einen Dialog öffnen, mit diesem aber NUR schlechtere Auflösungen auswählen, nicht bessere als die 640*480.

    Ich weis absolut nicht mehr weiter. ;(

    jemand ne Idee ? BITTE ?

  • Möglichkeiten Sound einzubinden

    • vivus
    • 27. April 2012 um 11:41

    meinst du jetzt explizit sound ausgabe ..

    oder auch aufnahme / verzerrung / modifizierung / verbinden / überlagern / sampeln / reversen / usw ..

    n weng genauer wäre echt nice ..

  • Audio Output aufnehmen

    • vivus
    • 27. April 2012 um 10:34

    hu hu !
    ich misch mich hier mal kurz ein ..
    .. also um zu testen, ob das überhaupt mit deiner Sound Karte funktioniert, würde ich dir empfehlen von Chip das Programm No23 runterzuladen ..
    dort kannst du diese Funktion auswählen .. .. bzw. testen ..

    wenn das dann funktioniert, kannst du mit autoit weiter machen ..
    und zwar, basiert No23 auf dem LAME dacoder ( d.h. No23 ist nur ein Frontend ) welcher auch komplett als UDF in autoit zu finden ist ..
    damit kannst du dann deine custom software basteln ..

    hoff dir hilft's ..

  • Brennen

    • vivus
    • 18. April 2012 um 10:31

    .. ich weis , dass der ein oder andere mich jetzt hier wieder als Leichenschänder beschimpfen wird...
    IST mir aber egal .... ;)

    bin auch grad am Thema CD-Brennen mit AutoIT und natürlich hier über diesen Thread gestolpert ..

    und wollte lediglich mitteilen, dass es hierzu eine UDF gibt namen's IMAPI2__11_36_.au3

    Spoiler anzeigen
    [autoit]


    ;;Source http://autoit.forumcommunity.net/?t=36642321

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

    #include <winapi.au3>

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

    #CS List of Functions
    _IMAPI2_AddFileToFS (15/8-08)
    _IMAPI2_AddFolderToFS (16/6-08)
    _IMAPI2_BurnFSToDrive (16/6-08)
    _IMAPI2_BurnImageToDrive (15/8-08)
    _IMAPI2_CreateFSForDrive (16/6-08)
    _IMAPI2_CreateFSForMedia (14/8-08)
    _IMAPI2_CreateDirectoryInFS (06/6-09)
    _IMAPI2_DriveClose (16/6-08)
    _IMAPI2_DriveEject (16/6-08)
    _IMAPI2_DriveEraseDisc (16/6-08)
    _IMAPI2_DriveGetLetter (16/6-08)
    _IMAPI2_DriveGetMedia (16/6-08)
    _IMAPI2_DriveGetObj (16/6-08)
    _IMAPI2_DriveGetProductId (20/6-09)
    _IMAPI2_DriveGetSpeeds (08/7-08)
    _IMAPI2_DriveGetSupportedMedia (14/8-08)
    _IMAPI2_DriveMediaIsBlank (14/8-08)
    _IMAPI2_DrivesGetID (16/6-08)
    _IMAPI2_DriveGetVendorId (20/6-09)
    _IMAPI2_FSCountDirectories (15/8-08)
    _IMAPI2_FSCountFiles (15/8-08)
    _IMAPI2_FSItemExists (15/8-08)
    _IMAPI2_RemoveFolderFromFS (08/7-08)
    _IMAPI2_RemoveFileFromFS (06/6-09)
    _IMAPI2_DriveMediaFreeSpace (15/8-08)
    _IMAPI2_DriveMediaTotalSpace (15/8-08)
    _IMAPI2_WaveIsValid (10/9-08)
    #CE

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

    Global $IMAPI2_Error = ObjEvent("AutoIt.Error", "_IMAPI2_COM_Error")
    Global $IMAPI2_ErrorCode
    Global $IMAPI2_UserCallback

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

    #Region IMAPI2 Constants
    Global Const $IMAPI_MEDIA_TYPE_UNKNOWN = 0x00
    Global Const $IMAPI_MEDIA_TYPE_CDROM = 0x01
    Global Const $IMAPI_MEDIA_TYPE_CDR = 0x02
    Global Const $IMAPI_MEDIA_TYPE_CDRW = 0x03
    Global Const $IMAPI_MEDIA_TYPE_DVDROM = 0x04
    Global Const $IMAPI_MEDIA_TYPE_DVDRAM = 0x05
    Global Const $IMAPI_MEDIA_TYPE_DVDPLUSR = 0x06
    Global Const $IMAPI_MEDIA_TYPE_DVDPLUSRW = 0x07
    Global Const $IMAPI_MEDIA_TYPE_DVDPLUSR_DUALLAYER = 0x08
    Global Const $IMAPI_MEDIA_TYPE_DVDDASHR = 0x09
    Global Const $IMAPI_MEDIA_TYPE_DVDDASHRW = 0x0A
    Global Const $IMAPI_MEDIA_TYPE_DVDDASHR_DUALLAYER = 0x0B
    Global Const $IMAPI_MEDIA_TYPE_DISK = 0x0C
    Global Const $IMAPI_MEDIA_TYPE_DVDPLUSRW_DUALLAYER = 0x0D
    Global Const $IMAPI_MEDIA_TYPE_HDDVDROM = 0x0E
    Global Const $IMAPI_MEDIA_TYPE_HDDVDR = 0x0F
    Global Const $IMAPI_MEDIA_TYPE_HDDVDRAM = 0x10
    Global Const $IMAPI_MEDIA_TYPE_BDROM = 0x11
    Global Const $IMAPI_MEDIA_TYPE_BDR = 0x12
    Global Const $IMAPI_MEDIA_TYPE_BDRE = 0x13
    Global Const $IMAPI_MEDIA_TYPE_MAX = 0x13

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

    Global Const $IMAPI_SECTOR_SIZE = 2048
    Global Const $IMAPI_SECTORS_PER_SECOND_AT_1X_CD = 75
    Global Const $IMAPI_SECTORS_PER_SECOND_AT_1X_DVD = 680
    #EndRegion IMAPI2 Constants

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

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _IMAPI2_DrivesGetID
    ; Description ...: Returns the unique id for all the drives on the system
    ; Syntax.........: _IMAPI2_GetDrivesID()
    ; Parameters ....:
    ; Return values .: Success - An array with all the unique ids for the drives on the system (element 0 is count)
    ; : Failure -
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_StartDrive
    ; Link ..........;
    ; Example .......; No
    ;
    ; ;==========================================================================================
    Func _IMAPI2_DrivesGetID()
    Local $oDiscmaster, $iCount
    $oDiscmaster = ObjCreate("IMAPI2.MsftDiscMaster2")
    If Not IsObj($oDiscmaster) Then Return -1
    $iCount = $oDiscmaster.Count()
    Local $sArray[$iCount + 1]
    $sArray[0] = $iCount
    For $i = 1 To $iCount
    $sArray[$i] = $oDiscmaster.Item($i - 1)
    Next
    $oDiscmaster = ""
    Return $sArray
    EndFunc ;==>_IMAPI2_DrivesGetID

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

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _IMAPI2_WaveIsValid
    ; Description ...: Checks if a wave file is valid for writing as audio track on cd-r
    ; Syntax.........: MAPI2_WaveIsValid($sFileName)
    ; Parameters ....:
    ; Return values .: Success - Returns true if the file is a valid 16-bit 44,1 kHz stereo track
    ; : Failure - False
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......:
    ; Link ..........;
    ; Example .......; No
    ;
    ; ;==========================================================================================
    Func _IMAPI2_WaveIsValid($sFileName)
    Local $NULL
    Local $hFileHandle
    Local $WAVE_HEADER = DllStructCreate("char ChunkID[4];int ChunkSize;char Format[4];char Subchunk1ID[4];" & _
    "int Subchunk1Size;short AudioFormat;short NumChannels;int SampleRate;" & _
    "int ByteRate;short BlockAlign;short BitsPerSample;char Subchunk2ID[4];" & _
    "int Subchunk2Size")
    $hFileHandle = _WinAPI_CreateFile($sFileName, 2, 2, 2)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "ChunkID"), 4, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "ChunkSize"), 4, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "Format"), 4, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "Subchunk1ID"), 4, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "Subchunk1Size"), 4, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "AudioFormat"), 2, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "NumChannels"), 2, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "SampleRate"), 4, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "ByteRate"), 4, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "BlockAlign"), 2, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "BitsPerSample"), 2, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "Subchunk2ID"), 4, $NULL)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($WAVE_HEADER, "Subchunk2Size"), 4, $NULL) ; 44 offset
    _WinAPI_CloseHandle($hFileHandle)
    If DllStructGetData($WAVE_HEADER, "AudioFormat") = 1 And DllStructGetData($WAVE_HEADER, "SampleRate") = 44100 And _
    DllStructGetData($WAVE_HEADER, "BitsPerSample") = 16 And DllStructGetData($WAVE_HEADER, "NumChannels") = 2 Then
    Return True
    Else
    Return False
    EndIf
    EndFunc ;==>_IMAPI2_WaveIsValid

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

    Func _IMAPI2_BurnAudioCD($oRecorder, $aWaveFiles)
    Local $hFileHandle
    Local $NULL
    Local $hDummyStruct = DllStructCreate("byte[44]")
    Local $hWaveData
    Local $oTrackAtOnce = ObjCreate("IMAPI2.MsftDiscFormat2TrackAtOnce")
    $oTrackAtOnce.ClientName = @AutoItVersion
    $oTrackAtOnce.recorder = $oRecorder
    $oTrackAtOnce.PrepareMedia()
    For $i = 0 To UBound($aWaveFiles) - 1
    If _IMAPI2_WaveIsValid($aWaveFiles[$i]) Then
    $hFileHandle = _WinAPI_CreateFile($aWaveFiles[$i], 2, 2, 2)
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($hDummyStruct), 44, $NULL)
    $hWaveData = DllStructCreate("ushort[" & (FileGetSize($aWaveFiles[$i]) - 44) / 2 & "]")
    _WinAPI_ReadFile($hFileHandle, DllStructGetPtr($hWaveData), DllStructGetSize($hWaveData), $NULL)
    _WinAPI_CloseHandle($hFileHandle)
    $hFileHandle = $hFileHandle = _WinAPI_CreateFile(@TempDir & "\~raw.data", 2, 4, 4)
    _WinAPI_WriteFile($hFileHandle, DllStructGetPtr($hWaveData), DllStructGetSize($hWaveData), $NULL)
    _WinAPI_CloseHandle($hFileHandle)
    EndIf
    Next
    EndFunc ;==>_IMAPI2_BurnAudioCD

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_DriveGetObj
    ; Description ...: Get the object of a drive using the unique id for the drive
    ; Syntax.........: _IMAPI2_DriveGetObj($sUniqueId)
    ; Parameters ....: $sUniqueId - Unique id for the drive to get object
    ; Return values .: Success - Object to the drive
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_GetDrivesID
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_DriveGetObj($sUniqueId)
    Local $oRecorder = ObjCreate("IMAPI2.MsftDiscRecorder2")
    $oRecorder.InitializeDiscRecorder($sUniqueId)
    Return $oRecorder
    EndFunc ;==>_IMAPI2_DriveGetObj

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

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _IMAPI2_DriveGetMedia
    ; Description ...: Returns the type of media inserted in a drive
    ; Syntax.........: _IMAPI2_DriveGetMedia(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: Success - A code corresponding to one of the constants at the top of this UDF
    ; .; Failure - -1 (Drive may not be ready!)
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_StartDrive
    ; Link ..........;
    ; Example .......; No
    ;
    ; ;==========================================================================================
    Func _IMAPI2_DriveGetMedia(ByRef $oRecorder)
    $IMAPI2_ErrorCode = 0
    Local $oMediaObj = ObjCreate("IMAPI2.MsftDiscFormat2Data")
    Local $iCode
    $oMediaObj.recorder = $oRecorder
    $oMediaObj.ClientName = @AutoItVersion
    $iCode = Hex($oMediaObj.CurrentPhysicalMediaType())
    $oMediaObj = ""
    If $IMAPI2_ErrorCode <> 0 Then Return -1
    Return $iCode
    EndFunc ;==>_IMAPI2_DriveGetMedia

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

    Func _IMAPI2_DriveGetSpeeds(ByRef $oRecorder)
    Local $oSpeedObj = ObjCreate("IMAPI2.MsftDiscFormat2Data")
    Local $iArray
    $oSpeedObj.recorder = $oRecorder
    $oSpeedObj.ClientName = @AutoItVersion
    $iArray = $oSpeedObj.SupportedWriteSpeeds()
    $oSpeedObj = ""
    Return $iArray
    EndFunc ;==>_IMAPI2_DriveGetSpeeds

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

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _IMAPI2_DriveGetSupportedMedia
    ; Description ...: Returns an array of supported media, refer to the constants at the top of the UDF for information
    ; Syntax.........: _IMAPI2_DriveGetSupportedMedia(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: Success - An array of media constants
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_StartDrive
    ; Link ..........;
    ; Example .......; No
    ;
    ; ;==========================================================================================
    Func _IMAPI2_DriveGetSupportedMedia(ByRef $oRecorder)
    Local $oMediaObj = ObjCreate("IMAPI2.MsftDiscFormat2Data")
    $oMediaObj.recorder = $oRecorder
    Local $iArray = $oMediaObj.SupportedMediaTypes()
    For $i = 0 To UBound($iArray) - 1
    $iArray[$i] = Hex($iArray[$i], 2)
    Next
    $oMediaObj = ""
    Return $iArray
    EndFunc ;==>_IMAPI2_DriveGetSupportedMedia

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

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _IMAPI2_DriveMediaIsBlank
    ; Description ...: Used to check if the inserted media is blank
    ; Syntax.........: _IMAPI2_DriveMediaIsBlank(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: Success - True if media is blank, false otherwise.
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_StartDrive
    ; Link ..........;
    ; Example .......; No
    ;
    ; ;==========================================================================================
    Func _IMAPI2_DriveMediaIsBlank(ByRef $oRecorder)
    Local $oMediaObj = ObjCreate("IMAPI2.MsftDiscFormat2Data")
    $oMediaObj.recorder = $oRecorder
    Local $iResult = $oMediaObj.MediaPhysicallyBlank()
    $oMediaObj = ""
    Return $iResult
    EndFunc ;==>_IMAPI2_DriveMediaIsBlank

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

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _IMAPI2_DriveMediaFreeSpace
    ; Description ...: Gets the number of free bytes on the currently inserted media in drive
    ; Syntax.........: _IMAPI2_DriveMediaFreeSpace(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: Success - Number of free bytes on the inserted media
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_StartDrive
    ; Link ..........;
    ; Example .......; No
    ;
    ; ;==========================================================================================
    Func _IMAPI2_DriveMediaFreeSpace(ByRef $oRecorder)
    Local $oMediaObj = ObjCreate("IMAPI2.MsftDiscFormat2Data")
    Local $iFreeSpace
    $oMediaObj.recorder = $oRecorder
    $iFreeSpace = $oMediaObj.FreeSectorsOnMedia() * $IMAPI_SECTOR_SIZE
    Return $iFreeSpace
    EndFunc ;==>_IMAPI2_DriveMediaFreeSpace

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

    ; #FUNCTION# ;===============================================================================
    ;
    ; Name...........: _IMAPI2_DriveMediaTotalSpace
    ; Description ...: Gets the total size of media in drive, in bytes
    ; Syntax.........: __IMAPI2_DriveMediaTotalSpace(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: Success - Number of bytes on the currently inserted media
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_StartDrive
    ; Link ..........;
    ; Example .......; No
    ;
    ; ;==========================================================================================
    Func _IMAPI2_DriveMediaTotalSpace(ByRef $oRecorder)
    Local $oMediaObj = ObjCreate("IMAPI2.MsftDiscFormat2Data")
    Local $iFreeSpace
    $oMediaObj.recorder = $oRecorder
    $iFreeSpace = $oMediaObj.TotalSectorsOnMedia() * $IMAPI_SECTOR_SIZE
    Return $iFreeSpace
    EndFunc ;==>_IMAPI2_DriveMediaTotalSpace

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_DriveGetLetter
    ; Description ...: Gets the letter of a drive using the object for the drive
    ; Syntax.........: _IMAPI2_DriveGetLetter(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: Success - Letter
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_DriveGetLetter(ByRef $oRecorder)
    Local $sTemp = $oRecorder.VolumePathNames
    Return StringLeft($sTemp[0], 1)
    EndFunc ;==>_IMAPI2_DriveGetLetter

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_DriveEject
    ; Description ...: Ejects the tray of a drive
    ; Syntax.........: _IMAPI2_DriveEject(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: None
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_DriveEject(ByRef $oRecorder)
    $oRecorder.EjectMedia()
    EndFunc ;==>_IMAPI2_DriveEject

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_DriveClose
    ; Description ...: Close the tray of a drive
    ; Syntax.........: _IMAPI2_DriveCLose(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: None
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_DriveClose(ByRef $oRecorder)
    $oRecorder.CloseTray()
    EndFunc ;==>_IMAPI2_DriveClose

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_CreateDirectoryInFS
    ; Description ...: Creates a directory in the specified file system
    ; Syntax.........: _IMAPI2_CreateDirectoryInFS(ByRef $oFileSystem, $sDirName)
    ; Parameters ....: $oFileSystem - The file system
    ; $sDirName - Relative path in fs to the dir
    ; Return values .: Success - None
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_CreateDirectoryInFS($oFileSystem,$sDirName)
    Local $oRootDir=$oFileSystem.Root
    $oRootDir.AddDirectory($sDirName)
    EndFunc

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_CreateFSForDrive
    ; Description ...: Creates a filesystem which can hold files that later can be burnt to a drive
    ; Syntax.........: _IMAPI2_CreateFSForDrive(ByRef $oRecorder, $sDiscname)
    ; Parameters ....: $oRecorder - Object of the drive
    ; $sDiscname - The name of the future disc
    ; Return values .: Success - A filesystem object
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_CreateFSForDrive(ByRef $oRecorder, $sDiscname)
    Local $oFileSystem = ObjCreate("IMAPI2FS.MsftFileSystemImage")
    $oFileSystem.ChooseImageDefaults($oRecorder)
    $oFileSystem.VolumeName = $sDiscname
    Return $oFileSystem
    EndFunc ;==>_IMAPI2_CreateFSForDrive

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_CreateFSForMedia
    ; Description ...: Creates a filesystem which can hold files that later can be burnt to a drive
    ; Syntax.........: _IMAPI2_CreateFSForDrive(ByRef $oRecorder, $sDiscname)
    ; Parameters ....: $iMediaType - One of the constants defined at the top of the UDF
    ; $sDiscname - The name of the future disc
    ; Return values .: Success - A filesystem object
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_CreateFSForMedia($iMediaType, $sDiscname)
    Local $oFileSystem = ObjCreate("IMAPI2FS.MsftFileSystemImage")
    $oFileSystem.ChooseImageDefaultsForMediaType($iMediaType)
    $oFileSystem.VolumeName = $sDiscname
    Return $oFileSystem
    EndFunc ;==>_IMAPI2_CreateFSForMedia

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_FSCountFiles
    ; Description ...: Counts the number of files in a filesystem
    ; Syntax.........: _IMAPI2_FSCountFiles(ByRef $oFileSystem)
    ; Parameters ....: $oFileSystem - The FS to count files in
    ; Return values .: Success - Number of files
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_CreateFSForMedia, _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_FSCountFiles($oFileSystem)
    Return $oFileSystem.FileCount()
    EndFunc ;==>_IMAPI2_FSCountFiles

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_FSCountDirectories
    ; Description ...: Counts the number of directories in a filesystem
    ; Syntax.........: _IMAPI2_FSCountDirectories(ByRef $oFileSystem)
    ; Parameters ....: $oFileSystem - The FS to count directories in
    ; Return values .: Success - Number of directories
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_CreateFSForMedia, _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_FSCountDirectories(ByRef $oFileSystem)
    Return $oFileSystem.DirectoryCount()
    EndFunc ;==>_IMAPI2_FSCountDirectories

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_FSItemExists
    ; Description ...: Checks to see if a an item in a filsystem oject exists
    ; Syntax.........: _IMAPI2_FSItemExists(ByRef $oFileSystem)
    ; Parameters ....: $oFileSystem - The FS to count files in
    ; .; $sItemName - THe name of the item
    ; Return values .: Success - 1 if the item is a directory, 2 if the item is a file, 0 if item not found
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_CreateFSForMedia, _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_FSItemExists(ByRef $oFileSystem, $sItemName)
    Return $oFileSystem.Exists($sItemName)
    EndFunc ;==>_IMAPI2_FSItemExists

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_AddFolderToFS
    ; Description ...: Adds a folder to an existing filesystem object
    ; Syntax.........: _IMAPI2_AddFolderToFS(ByRef $oFileSystem, $sPath)
    ; Parameters ....: $oFileSystem - A filesystem object returned by _IMAPI2_CreateFSForDrive
    ; $sPath - Folder to add to the filsystem object
    ; Return values .: None
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......: You cannot use relative paths
    ; Related .......: _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_AddFolderToFS(ByRef $oFileSystem, $sPath)
    Local $oRootDir
    $oRootDir = $oFileSystem.Root
    $oRootDir.AddTree($sPath, False)
    EndFunc ;==>_IMAPI2_AddFolderToFS

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_AddFileToFS
    ; Description ...: Adds a file to an existing filesystem object
    ; Syntax.........: _IMAPI2_AddFolderToFS(ByRef $oFileSystem, $sFileName, $sDestinationDir)
    ; Parameters ....: $oFileSystem - A filesystem object returned by _IMAPI2_CreateFSForDrive
    ; $sFileName - File to add to the filsystem object
    ; $sDestinationDir - Foler in the fs where the file is added
    ; Return values .: None
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......: You cannot use relative paths
    ; .: Due to how the IStream interface works the entire file is buffered into memory, therefore big files is not recomended to add with this function
    ; Related .......: _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_AddFileToFS(ByRef $oFileSystem, $sFileName, $sDestinationDir)
    Local $oRootDir, $oStream
    $oRootDir = $oFileSystem.Root
    $oStream = ObjCreate("ADODB.Stream")
    $oStream.Open
    $oStream.Type = 1
    $oStream.LoadFromFile($sFileName)
    $oRootDir.AddFile($sDestinationDir, $oStream)
    EndFunc ;==>_IMAPI2_AddFileToFS

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_RemoveFolderFromFS
    ; Description ...: Removes a folder from an existing filesystem object
    ; Syntax.........: _IMAPI2_RemoveFolderFromFS(ByRef $oFileSystem, $sPath)
    ; Parameters ....: $oFileSystem - A filesystem object returned by _IMAPI2_CreateFSForDrive
    ; $sPath - Folder to remove to the filsystem object
    ; Return values .: None
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_RemoveFolderFromFS(ByRef $oFileSystem, $sPath)
    Local $oRootDir
    $oRootDir = $oFileSystem.Root
    $oRootDir.RemoveTree($sPath, False)
    EndFunc ;==>_IMAPI2_RemoveFolderFromFS

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_RemoveFileFromFS
    ; Description ...: Removes a file from an existing filesystem object
    ; Syntax.........: _IMAPI2_RemoveFileFromFS(ByRef $oFileSystem, $sPath)
    ; Parameters ....: $oFileSystem - A filesystem object returned by _IMAPI2_CreateFSForDrive
    ; $sPath - File to remove to the filsystem object
    ; Return values .: None
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......:
    ; Related .......: _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_RemoveFileFromFS(ByRef $oFileSystem, $sPath)
    Local $oRootDir
    $oRootDir = $oFileSystem.Root
    $oRootDir.Remove($sPath, False)
    EndFunc ;==>_IMAPI2_RemoveFolderFromFS

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_BurnFSToDrive
    ; Description ...: Burns the contents of a filesystem object into a empty disc
    ; Syntax.........: _IMAPI2_BurnFSToDrive(ByRef $oFileSystem, ByRef $oRecorder[, $sFunction])
    ; Parameters ....: $oFileSystem - A filesystem object returned by _IMAPI2_CreateFSForDrive
    ; $oRecorder - A object to a drive
    ; $oFunction - Function that will be called during the burning to get the progress of the burning
    ; Return values .: Success - 0
    ; Failure - Error code in Hex format, check http://msdn.microsoft.com/en-us/library/aa364892(VS.85).aspx for values
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......: The callback function must take an array as parameter, this is the structure of the array:
    ; $array[0]: The current action of the drive
    ; $array[1]: Remaining time
    ; $array[2]: Elapsed time
    ; $array[3]: Total estimated time
    ; Related .......: _IMAPI2_CreateFSForDrive, $IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_BurnFSToDrive(ByRef $oFileSystem, ByRef $oRecorder, $sFunction = "")

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

    Local $oResult, $vStream, $iTemp
    Local $oWriter = ObjCreate("IMAPI2.MsftDiscFormat2Data")
    $oWriter.recorder = $oRecorder
    $oWriter.ClientName = @AutoItVersion
    $oResult = $oFileSystem.CreateResultImage()
    $vStream = $oResult.ImageStream
    $IMAPI2_UserCallback = $sFunction
    ObjEvent($oWriter, "_IMAPI2_")
    $oWriter.write($vStream)
    If $IMAPI2_ErrorCode Then
    $iTemp = $IMAPI2_ErrorCode
    $IMAPI2_ErrorCode = 0
    Return $iTemp
    EndIf
    $oWriter = ""
    EndFunc ;==>_IMAPI2_BurnFSToDrive

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_BurnImageToDrive
    ; Description ...: Burns a image file to media in specified drive
    ; Syntax.........: _BurnImageToDrive(ByRef $oRecorder, $sImage[, $sFunction=""])
    ; Parameters ....: $oRecorder - Drive that is going to burn the image
    ; $sImage - Path to the image file
    ; $oFunction - Function that will be called during the burning to get the progress of the burning
    ; Return values .: Success - 0
    ; Failure - Error code in Hex format, check http://msdn.microsoft.com/en-us/library/aa364892(VS.85).aspx for values
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......: The callback function must take an array as parameter, this is the structure of the array:
    ; $array[0]: The current action of the drive
    ; $array[1]: Remaining time
    ; $array[2]: Elapsed time
    ; $array[3]: Total estimated time
    ;
    ; Due to how the IStream interface works the entire image is loaded into memory
    ; Related .......: _IMAPI2_CreateFSForDrive, $IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_BurnImageToDrive(ByRef $oRecorder, $sImage, $sFunction = "")
    Local $oStream, $iTemp
    Local $oWriter = ObjCreate("IMAPI2.MsftDiscFormat2Data")
    $oWriter.recorder = $oRecorder
    $oWriter.ClientName = @AutoItVersion
    $oStream = ObjCreate("ADODB.Stream")
    $oStream.Open
    $oStream.Type = 1
    $oStream.LoadFromFile($sImage)
    $IMAPI2_UserCallback = $sFunction
    ObjEvent($oWriter, "_IMAPI2_")
    $oWriter.write($oStream)
    If $IMAPI2_ErrorCode Then
    $iTemp = $IMAPI2_ErrorCode
    $IMAPI2_ErrorCode = 0
    Return $iTemp
    EndIf
    $oWriter = ""
    EndFunc ;==>_IMAPI2_BurnImageToDrive

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _IMAPI2_DriveEraseDisc
    ; Description ...: Erase a cd-rw or dvd-rw in the drive
    ; Syntax.........: _IMAPI2_AddFolderToFS(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - The recorder in which the disc lies that will be erased
    ; Return values .: None
    ; Author ........: Andreas Karlsson (monoceres)
    ; Modified.......:
    ; Remarks .......: No progress update...yet
    ; Related .......: _IMAPI2_CreateFSForDrive
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================================================================
    Func _IMAPI2_DriveEraseDisc(ByRef $oRecorder)
    Local $oEraseObj = ObjCreate("IMAPI2.MsftDiscFormat2Erase")
    $oEraseObj.ClientName = @AutoItVersion
    $oEraseObj.recorder = $oRecorder
    $oEraseObj.EraseMedia()
    $oEraseObj = ""
    EndFunc ;==>_IMAPI2_DriveEraseDisc

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

    ; #FUNCTION# =====================================================================
    ; Name...........: _IMAPI2_DriveGetVendorId
    ; Description ...: Gets the VendorId of a drive using the object for the drive
    ; Syntax.........: _IMAPI2_DriveGetVendorId(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: Success - VendorId
    ; Author ........: FrouFrou
    ; Modified.......:
    ; Remarks .......: derived from Imapi2 UDFs by Andreas Karlsson (monoceres)
    ; Related .......: _IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ===============================================================================
    Func _IMAPI2_DriveGetVendorId(ByRef $oRecorder)
    Local $sTemp = $oRecorder.VendorId
    Return ($sTemp)
    EndFunc ;==>_IMAPI2_DriveGetVendorId

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

    ; #FUNCTION# =====================================================================
    ; Name...........: _IMAPI2_DriveProductId
    ; Description ...: Gets the ProductId of a drive using the object for the drive
    ; Syntax.........: _IMAPI2_DriveProductId(ByRef $oRecorder)
    ; Parameters ....: $oRecorder - Object of the drive
    ; Return values .: Success - ProductId
    ; Author ........: FrouFrou
    ; Modified.......:
    ; Remarks .......: derived from Imapi2 UDFs by Andreas Karlsson (monoceres)
    ; Related .......: _IMAPI2_DriveGetObj
    ; Link ..........;
    ; Example .......; No
    ; ================================================================================
    Func _IMAPI2_DriveGetProductId(ByRef $oRecorder)
    Local $sTemp = $oRecorder.ProductId
    Return ($sTemp)
    EndFunc ;==>_IMAPI2_DriveGetProductId

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

    ; Helper func, no peeking :P
    Func _IMAPI2_Update($oObjThatFired, $oProgress)
    Local $vArray[4]
    $vArray[0] = $oProgress.CurrentAction
    $vArray[1] = $oProgress.RemainingTime
    $vArray[2] = $oProgress.ElapsedTime
    $vArray[3] = $oProgress.TotalTime
    If $IMAPI2_UserCallback Then
    Call($IMAPI2_UserCallback, $vArray)
    EndIf
    $oObjThatFired = ""
    EndFunc ;==>_IMAPI2_Update

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

    ; Worlds greatest error handling....NOT
    Func _IMAPI2_COM_Error()
    $IMAPI2_ErrorCode = 0
    If IsObj($IMAPI2_Error) Then
    $IMAPI2_ErrorCode = Hex($IMAPI2_Error.number)
    $IMAPI2_Error.clear
    EndIf
    EndFunc ;==>_IMAPI2_COM_Error

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

    wie's genau funktioniert, werde ich jetzt noch testen,...

    bei Erfolg natürlich hier Posten ..

    €dit :
    LINK !! http://www.autoitscript.com/forum/topic/73…vd-burning-udf/

  • Android Forum

    • vivus
    • 13. Januar 2012 um 07:42

    kann nicht einfach irgend einer der's brutal drauf hat "Andoit" basteln ;) also Autoit für Android . . . wird doch auch irgend wie machbar sein ...

    oder gibt's da definitiv keine chance sowas umzusetzen .. ?

  • Bluetooth

    • vivus
    • 21. Oktober 2011 um 17:01

    hab was ... allerdings nur für java .. http://linuxpoison.blogspot.com/2009/08/open-s…-bluetooth.html

  • Bluetooth

    • vivus
    • 21. Oktober 2011 um 16:59

    also soweit ich weis, gibt es eine sogenannte "Wireless Communication Library"

    auch WCL genannt .. kostet aber ne kleinigkeit ..

    ob's da auch was open sourciges gibt .. ?!!? musste mal google fragen.

    was ist es denn für ein gerät, mit dem du kommunizieren willst ?

  • problem mit switch

    • vivus
    • 21. Oktober 2011 um 08:30

    dann ist da noch das leerzeichen zwischen sleep und der klammer ..

    und es fehlt noch das endswitch ..

    und die Formatierung ist auch kacke ..

    Spoiler anzeigen
    [autoit]

    Sleep(10000)
    $i = Random(1, 8, 1)
    Switch $i
    Case 1
    MouseClick("left", 45, 104)
    Sleep(1300)
    Case 2
    MouseClick("left", 583, 115)
    Sleep(1300)
    Case 3
    MouseClick("left", 1170, 189)
    Sleep(1300)
    Case 4
    MouseClick("left", 1248, 467)
    Sleep(1300)
    Case 5
    MouseClick("left", 605, 931)
    Sleep(1300)
    Case 6
    MouseClick("left", 49, 927)
    Sleep(1300)
    Case 7
    MouseClick("left", 47, 534)
    Sleep(1300)
    Case 8
    MouseClick("left", 1199, 880)
    Sleep(1300)
    EndSwitch

    [/autoit]

    so

  • Excel-Sheet als Dtenbank nutzen und mit Autoit-Anwendung Daten auslesen / eintragen / ersetzen

    • vivus
    • 13. Oktober 2011 um 21:26

    kannst du die datei nicht in *.csv speichern ?!?!?

    und dann via Fileread auslesen ?

    ich finde das einfacher .. wie mit dem excel udf. zumal man da doch excel am laufen haben muss .. oder nicht = ?

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™