Ver Mensaje Individual
  #1  
Antiguo 06-07-2007
ArielMendoza ArielMendoza is offline
Registrado
 
Registrado: dic 2005
Posts: 5
Reputación: 0
ArielMendoza Va por buen camino
Talking Imagex, WIMGAPI.DLL y Delphi

Hola a todos,

No se si esto le interesa a alguien, pero he buscado en Internet y no he encontrado nada para delphi.

Necesitaba aplicar una imagen WIM desde mi aplicación. Investigando con el WinDebuger y con Google encontré las declaraciones de las funciones. Me falta obtener el progreso que lo haré el lunes. Si ha alguien le interesa que me lo diga y pongo el código, o si alguien ya lo tiene mejor.

Un saludo a todos,

Ariel


Código Delphi [-]
 Function WIMApplyImage(hImage:thandle; lpszPath:widestring;dzApplyFlags:cardinal):LongBool; stdcall; external 's:\tools\WIMGAPI.DLL';
 function WIMCreateFile(lpszWimPath:widestring;dwDesiredAccess:Longint;dwCreationDisposition:Longint;dwFlagsAn  dAttributes:Longint;dwCompressionType:Longint;var lpdwCreationResult:Longint):THandle;  stdcall; external 's:\tools\WIMGAPI.DLL';
 Function WIMSetTemporaryPath(hWnd:THandle;TemporaryPath:widestring):Integer;stdcall; external 's:\tools\WIMGAPI.DLL';
 Function WIMLoadImage(hWnd:THandle;ImageIndex:longint):THandle;stdcall; external 's:\tools\WIMGAPI.DLL';
 Function WIMCloseHandle(Handle:Thandle):longbool; stdcall; external 's:\tools\WIMGAPI.DLL';
 Implementation
  {$R *.dfm}
          const WIM_GENERIC_READ = $80000000;
          const WIM_GENERIC_WRITE = $40000000;
          const WIM_CREATE_NEW = 1;
          const WIM_CREATE_ALWAYS = 2;
          const WIM_OPEN_EXISTING = 3;
          const WIM_OPEN_ALWAYS = 4;
          const WIM_COMPRESS_NONE = 0;
          const WIM_COMPRESS_XPRESS = 1;
          const WIM_COMPRESS_LZX = 2;
          const WIM_CREATED_NEW = 0;
          const WIM_OPENED_EXISTING = 1;
          const WIM_FLAG_VERIFY = $00000002;

 procedure TForm1.Button1Click(Sender: TObject);
 var   Created:integer;
   hImage,ptrImageHandle:THandle;
   intResult:boolean;
 begin
   hImage:=WIMCreateFile(pchar('S:\IMAGEN\WINXP32.WIM'),WIM_GENERIC_READ, WIM_OPEN_EXISTING, WIM_FLAG_VERIFY, WIM_COMPRESS_NONE, created);
   WIMSetTemporaryPath(hImage, pchar('C:\Temp'));
   ptrImageHandle := WIMLoadImage(hImage, 1);
   intResult := WIMApplyImage(ptrImageHandle, pchar('C:\Temp'), 0);
   showmessage(SysErrorMessage(getlasterror));
   WIMCloseHandle(ptrImageHandle);
   WIMCloseHandle(hImage);
 end;

Última edición por ArielMendoza fecha: 08-07-2007 a las 13:56:38.
Responder Con Cita