Library wxodemo;


uses
  ShareMem,
  Windows,
  Messages,
  SysUtils,
  Variants,
  Classes,
  Graphics,
  Controls,
  Forms,
  Dialogs,
  WxoUnit in 'WxoUnit.pas',
  Main in 'Main.pas' {Form_Wxo};

{$E .wxo}

function LoadWebXoneForm(
          ApplicationHandle : THandle;  //WebXone Handle
          IEHandle : THandle;           //IE Handle
          CtrlHandle : THandle;         //Control Handle for IE6
          Url : PAnsiChar;              //URL
          Flag : PAnsiChar              //Reserved
          ):THandle;cdecl;

begin
     try
          //注：如果主窗体不是"Form_WXO", 如"MainForm", 全部替换一下就可以了
          //You can replace all "Form_WXO" with "MainForm" if your main form name is "MainForm"
          Form_Wxo  := TForm_WXO.Create(nil);
          giCtrl    := CtrlHandle;
          giApp     := ApplicationHandle;
          giIE      := IEHandle;
          wxoShowForm(Form_Wxo);
     finally
     end;
     Result    := Form_Wxo.Handle;
end;


exports
     LoadWebXoneForm;

//--------------------------------------------------------------------------------------------------
procedure Halt0;
begin
     Halt;
end;

procedure DLLEntryPoint(dwReason : DWORD);
begin
     if (dwReason = DLL_PROCESS_DETACH) then begin
          asm
               xor  edx,edx
               push ebp
               push OFFSET @@safecode
               push dword ptr fs:[edx]
               mov  fs:[edx],esp
               call Halt0
               jmp  @@exit;
               @@safecode:
               call Halt0
               @@exit:
          end;
     end;
end;

begin
     DllProc := @DLLEntryPoint;
     DllProcEx := @DLLEntryPoint;
//--------------------------------------------------------------------------------------------------

end.
