Posted by bjkaiser on Wed 13 May 11:05
report abuse | download | new post
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.2.4.9
- Author: Björn Kaiser <kaiser.bjoern@gmx.net>
- Script Function:
- #ce ----------------------------------------------------------------------------
- #include <wimgapi.au3>
- ;~ #include <DllCallback.au3>
- $pProgress = DllCallBackRegister ("_Progress", "int", "dword;lparam;wparam;ptr")
- ConsoleWriteError("DllCallBack error: " & @error & @CRLF & "_DllCallBack rc: " & $pProgress & @CRLF)
- $pProgress = DllCallbackGetPtr($pProgress)
- Apply("c:\temp\test.wim", "C:\temp\")
- ;~ ProgressOn("Wimgapi.dll","Capturing image ...")
- ;~ Capture("c:\temp\test.wim", "C:\temp\1\")
- DllCallBackFree($pProgress)
- ;~ If $1 = 38008 Then
- ;~ EndIf
- Return $wim_msg_success
- ;~ Return 0
- $fhandle = _wim_createfile ($wim, $wim_generic_read)
- ;~ ConsoleWrite("_wim_createfile : " & $fhandle & @CRLF)
- $rc_temppath = _wim_settemporarypath($fhandle,@TempDir)
- ;~ ConsoleWrite("_wim_settemporarypath : " & $rc_temppath & @CRLF)
- $lhandle = _wim_loadimage ($fhandle,1)
- ;~ ConsoleWrite("_wim_loadimage : " & $lhandle & @CRLF)
- _wim_registermessagecallback($fhandle,$pProgress)
- $rc_apply = _wim_applyimage ($lhandle, $sPath)
- ;~ ConsoleWrite("_wim_applyimage : " & $rc_apply & @CRLF)
- _wim_unregistermessagecallback($fhandle,$pProgress)
- $rc_close = _wim_closehandle ($lhandle)
- ;~ ConsoleWrite("_wim_closehandle : " & $rc_close & @CRLF)
- $rc_close = _wim_closehandle ($fhandle)
- ;~ ConsoleWrite("_wim_closehandle : " & $rc_close & @CRLF)
- $rc_shutdown = _wim_shutdown ()
- ;~ ConsoleWrite("_wim_shutdown : " & $rc_shutdown & @CRLF)
- EndFunc ;==>Apply
- $fhandle = _wim_createfile ($wim,$wim_generic_write,$wim_create_always,$wim_flag_verify,$wim_compress_xpress)
- ;~ $imageinfo = _wim_getimageinformation ($fhandle)
- ;~ ConsoleWrite("-- ImageInfo createFile" & @CRLF & UBound($imageinfo) & @CRLF)
- ;~ For $i = 0 To UBound($imageinfo) - 1
- ;~ ConsoleWrite("$imageinfo[" & $i & "]: " & $imageinfo[$i] & @CRLF)
- ;~ Next
- ;~ _wim_setimageinformation ($fhandle, $imageinfo[3], $imageinfo[1])
- _wim_registermessagecallback($fhandle,$pProgress)
- $vhandle = _wim_captureimage ($fhandle, $sPath)
- _wim_unregistermessagecallback($fhandle,$pProgress)
- ;~ $imageinfo = _wim_getimageinformation ($vhandle)
- ;~ ConsoleWrite("-- ImageInfo catureImage" & @CRLF & UBound($imageinfo) & @CRLF)
- ;~ For $i = 0 To UBound($imageinfo) - 1
- ;~ ConsoleWrite("$imageinfo[" & $i & "]: " & $imageinfo[$i] & @CRLF)
- ;~ Next
- ;~ _wim_setimageinformation ($vhandle, $imageinfo[3], $imageinfo[1])
- _wim_closehandle ($vhandle)
- _wim_closehandle ($fhandle)
- _wim_shutdown ()
- EndFunc ;==>Capture
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.